2009-12-18 20:07:06 +00:00
|
|
|
class Hadoop < Formula
|
2015-03-02 05:59:47 +00:00
|
|
|
homepage "https://hadoop.apache.org/"
|
2015-05-03 16:29:04 +00:00
|
|
|
url "https://www.apache.org/dyn/closer.cgi?path=hadoop/common/hadoop-2.7.0/hadoop-2.7.0.tar.gz"
|
2015-05-03 09:35:59 +00:00
|
|
|
mirror "https://archive.apache.org/dist/hadoop/common/hadoop-2.7.0/hadoop-2.7.0.tar.gz"
|
|
|
|
sha1 "ed5a19a54f878dde96a8655290d624b15e280d96"
|
2009-12-18 20:07:06 +00:00
|
|
|
|
2015-03-02 05:59:47 +00:00
|
|
|
depends_on :java
|
|
|
|
|
2009-12-18 20:07:06 +00:00
|
|
|
def install
|
2014-01-15 15:47:34 +00:00
|
|
|
rm_f Dir["bin/*.cmd", "sbin/*.cmd", "libexec/*.cmd", "etc/hadoop/*.cmd"]
|
|
|
|
libexec.install %w[bin sbin libexec share etc]
|
2012-08-07 18:20:52 +00:00
|
|
|
bin.write_exec_script Dir["#{libexec}/bin/*"]
|
2014-01-15 15:47:34 +00:00
|
|
|
sbin.write_exec_script Dir["#{libexec}/sbin/*"]
|
2012-12-17 00:37:56 +00:00
|
|
|
# But don't make rcc visible, it conflicts with Qt
|
2014-07-17 08:50:39 +00:00
|
|
|
(bin/"rcc").unlink
|
2011-03-13 17:10:09 +00:00
|
|
|
|
2014-01-15 15:47:34 +00:00
|
|
|
inreplace "#{libexec}/etc/hadoop/hadoop-env.sh",
|
|
|
|
"export JAVA_HOME=${JAVA_HOME}",
|
|
|
|
"export JAVA_HOME=\"$(/usr/libexec/java_home)\""
|
|
|
|
inreplace "#{libexec}/etc/hadoop/yarn-env.sh",
|
|
|
|
"# export JAVA_HOME=/home/y/libexec/jdk1.6.0/",
|
|
|
|
"export JAVA_HOME=\"$(/usr/libexec/java_home)\""
|
|
|
|
inreplace "#{libexec}/etc/hadoop/mapred-env.sh",
|
|
|
|
"# export JAVA_HOME=/home/y/libexec/jdk1.6.0/",
|
2012-01-28 19:25:36 +00:00
|
|
|
"export JAVA_HOME=\"$(/usr/libexec/java_home)\""
|
2010-05-05 15:48:41 +00:00
|
|
|
end
|
|
|
|
|
2011-03-13 17:10:09 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
In Hadoop's config file:
|
2014-01-15 15:47:34 +00:00
|
|
|
#{libexec}/etc/hadoop/hadoop-env.sh,
|
|
|
|
#{libexec}/etc/hadoop/mapred-env.sh and
|
|
|
|
#{libexec}/etc/hadoop/yarn-env.sh
|
2011-03-13 17:10:09 +00:00
|
|
|
$JAVA_HOME has been set to be the output of:
|
|
|
|
/usr/libexec/java_home
|
2010-05-05 15:48:41 +00:00
|
|
|
EOS
|
2009-12-18 20:07:06 +00:00
|
|
|
end
|
2015-03-02 05:59:47 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
system bin/"hadoop", "fs", "-ls"
|
|
|
|
end
|
2009-12-18 20:07:06 +00:00
|
|
|
end
|