homebrew-core/Formula/hadoop.rb
Max Howell 77c73ecb89 Use Apache’s closer.cgi where appropriate
Some of these were pointing at archive.apache.org. Now they aren’t, I investigated for good rationale for using the archive before altering it.

mod_python still uses archive.apache.org as that is the only place it exists that I could find.

jsvc *now* uses apache.archive.org as the formula was otherwise broken and the binary tarball it needs no longer exists on the main mirrors.
2011-07-27 10:41:17 +01:00

37 lines
942 B
Ruby

require 'formula'
class Hadoop < Formula
url 'http://www.apache.org/dyn/closer.cgi?path=hadoop/core/hadoop-0.21.0/hadoop-0.21.0.tar.gz'
homepage 'http://hadoop.apache.org/common/'
md5 'ec0f791f866f82a7f2c1319a54f4db97'
def shim_script target
<<-EOS.undent
#!/bin/bash
exec #{libexec}/bin/#{target} $@
EOS
end
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin conf lib webapps mapred]
libexec.install Dir['*.jar']
bin.mkpath
Dir["#{libexec}/bin/*"].each do |b|
n = Pathname.new(b).basename
(bin+n).write shim_script(n)
end
inreplace "#{libexec}/conf/hadoop-env.sh",
"# export JAVA_HOME=/usr/lib/j2sdk1.6-sun",
"export JAVA_HOME=$(/usr/libexec/java_home)"
end
def caveats; <<-EOS.undent
In Hadoop's config file:
#{libexec}/conf/hadoop-env.sh
$JAVA_HOME has been set to be the output of:
/usr/libexec/java_home
EOS
end
end