2013-10-31 23:53:36 +00:00
|
|
|
class Mahout < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Library to help build scalable machine learning libraries"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "https://mahout.apache.org/"
|
2015-08-25 05:20:42 +00:00
|
|
|
url "https://www.apache.org/dyn/closer.cgi?path=mahout/0.11.0/apache-mahout-distribution-0.11.0.zip"
|
|
|
|
sha256 "3b4a68c69cff2ce41b9ddd789469eaa85ea3d7bab980717182bf94ea71c22904"
|
2013-10-31 23:53:36 +00:00
|
|
|
|
2014-02-25 14:45:10 +00:00
|
|
|
head do
|
2015-08-25 05:20:42 +00:00
|
|
|
url "https://github.com/apache/mahout.git"
|
2015-08-03 12:55:31 +00:00
|
|
|
depends_on "maven" => :build
|
2014-02-25 14:45:10 +00:00
|
|
|
end
|
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
depends_on "hadoop"
|
2015-04-22 18:25:19 +00:00
|
|
|
depends_on :java
|
2013-10-31 23:53:36 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
if build.head?
|
2015-08-03 12:55:31 +00:00
|
|
|
chmod 755, "./bin"
|
2015-08-25 05:20:42 +00:00
|
|
|
system "mvn", "-DskipTests", "clean", "install"
|
2013-10-31 23:53:36 +00:00
|
|
|
end
|
|
|
|
|
2014-02-25 14:45:10 +00:00
|
|
|
libexec.install "bin"
|
2013-10-31 23:53:36 +00:00
|
|
|
|
|
|
|
if build.head?
|
2015-08-03 12:55:31 +00:00
|
|
|
libexec.install Dir["buildtools/target/*.jar"]
|
|
|
|
libexec.install Dir["core/target/*.jar"]
|
|
|
|
libexec.install Dir["examples/target/*.jar"]
|
|
|
|
libexec.install Dir["math/target/*.jar"]
|
2013-10-31 23:53:36 +00:00
|
|
|
else
|
2015-08-03 12:55:31 +00:00
|
|
|
libexec.install Dir["*.jar"]
|
2013-10-31 23:53:36 +00:00
|
|
|
end
|
|
|
|
|
2015-08-25 05:20:42 +00:00
|
|
|
bin.install Dir["#{libexec}/bin/*"]
|
|
|
|
bin.env_script_all_files(libexec/"bin", Language::Java.java_home_env)
|
2013-10-31 23:53:36 +00:00
|
|
|
end
|
|
|
|
|
2015-08-25 05:20:42 +00:00
|
|
|
test do
|
|
|
|
(testpath/"test.csv").write <<-EOS.undent
|
|
|
|
"x","y"
|
|
|
|
0.1234567,0.101201201
|
2013-10-31 23:53:36 +00:00
|
|
|
EOS
|
2015-08-25 05:20:42 +00:00
|
|
|
|
|
|
|
assert_match /0.101201201/, pipe_output("#{bin}/mahout cat #{testpath}/test.csv")
|
2013-10-31 23:53:36 +00:00
|
|
|
end
|
|
|
|
end
|