aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mahout.rb
blob: 146786b55189dde42afa1eb0a8888dde85a4f068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'formula'

class Mahout < Formula
  homepage 'https://mahout.apache.org/'
  url 'https://www.apache.org/dyn/closer.cgi?path=mahout/0.10.0/mahout-distribution-0.10.0.tar.gz'
  sha1 'c8dcb51a04eb026eb9fd0fe6cb496cb101cf632d'

  head do
    url 'https://svn.apache.org/repos/asf/mahout/trunk'
    depends_on 'maven' => :build
  end

  depends_on 'hadoop'
  depends_on :java

  def install
    if build.head?
      chmod 755, './bin'
      system 'mvn -DskipTests clean install'
    end

    libexec.install "bin"

    if build.head?
      libexec.install Dir['buildtools/target/*.jar']
      libexec.install Dir['core/target/*.jar']
      libexec.install Dir['examples/target/*.jar']
      libexec.install Dir['math/target/*.jar']
    else
      libexec.install Dir['*.jar']
    end

    bin.write_exec_script Dir["#{libexec}/bin/*"]
  end

  def caveats; <<-EOS.undent
    Mahout requires JAVA_HOME to be set:
      export JAVA_HOME=$(/usr/libexec/java_home)
    EOS
  end
end