2009-12-18 20:07:06 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Hadoop < Formula
|
2010-03-06 07:27:21 +00:00
|
|
|
url 'http://www.carfab.com/apachesoftware/hadoop/core/hadoop-0.20.2/hadoop-0.20.2.tar.gz'
|
2009-12-18 20:07:06 +00:00
|
|
|
homepage 'http://hadoop.apache.org/common/'
|
2010-03-06 07:27:21 +00:00
|
|
|
md5 '8f40198ed18bef28aeea1401ec536cb9'
|
2009-12-18 20:07:06 +00:00
|
|
|
|
2010-05-05 15:48:41 +00:00
|
|
|
def shim_script target
|
|
|
|
<<-EOS.undent
|
2010-04-07 05:58:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
exec #{libexec}/bin/#{target} $*
|
2010-05-05 15:48:41 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2009-12-18 20:07:06 +00:00
|
|
|
def install
|
2010-03-06 07:27:21 +00:00
|
|
|
rm_f Dir["bin/*.bat"]
|
2010-07-24 21:42:41 +00:00
|
|
|
libexec.install %w[bin conf contrib lib webapps]
|
|
|
|
libexec.install Dir['*.jar']
|
2010-05-05 15:48:41 +00:00
|
|
|
bin.mkpath
|
|
|
|
Dir["#{libexec}/bin/*"].each do |b|
|
|
|
|
n = Pathname.new(b).basename
|
|
|
|
(bin+n).write shim_script(n)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
<<-EOS.undent
|
|
|
|
$JAVA_HOME must be set for Hadoop commands to work.
|
|
|
|
EOS
|
2009-12-18 20:07:06 +00:00
|
|
|
end
|
|
|
|
end
|