homebrew-core/Formula/hadoop.rb

37 lines
1.3 KiB
Ruby
Raw Normal View History

2009-12-18 20:07:06 +00:00
require 'formula'
class Hadoop < Formula
homepage 'http://hadoop.apache.org/'
url 'http://www.apache.org/dyn/closer.cgi?path=hadoop/common/hadoop-2.4.0/hadoop-2.4.0.tar.gz'
sha1 'fc94bb5cb6c50a09fd9fd3ed5e134893ccdf1dbe'
2009-12-18 20:07:06 +00:00
def install
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/*"]
sbin.write_exec_script Dir["#{libexec}/sbin/*"]
# But don't make rcc visible, it conflicts with Qt
(bin/'rcc').unlink
2011-03-13 17:10:09 +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)\""
end
2011-03-13 17:10:09 +00:00
def caveats; <<-EOS.undent
In Hadoop's config file:
#{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
EOS
2009-12-18 20:07:06 +00:00
end
end