Created
November 17, 2010 18:32
-
-
Save pingles/703784 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Hadoop < Formula | |
if ARGV.include?('--CDH') | |
url 'http://archive.cloudera.com/cdh/3/hadoop-0.20.2+737.tar.gz' | |
md5 '96f4c6ec8fadd1e86c0dfc8d2fe16aeb' | |
homepage 'http://www.cloudera.com/developers/' | |
version '0.20.2+737' | |
else | |
url 'http://www.carfab.com/apachesoftware/hadoop/core/hadoop-0.20.2/hadoop-0.20.2.tar.gz' | |
md5 '8f40198ed18bef28aeea1401ec536cb9' | |
homepage 'http://hadoop.apache.org/common/' | |
end | |
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 contrib lib webapps] | |
libexec.install Dir['*.jar'] | |
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 | |
$HADOOP_HOME must be set to #{prefix} | |
$JAVA_HOME must be set for Hadoop commands to work. | |
EOS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment