Skip to content

Instantly share code, notes, and snippets.

@j5ik2o
Created July 6, 2011 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j5ik2o/1066876 to your computer and use it in GitHub Desktop.
Save j5ik2o/1066876 to your computer and use it in GitHub Desktop.
hadoop 0.20.2のためのFormula
require 'formula'
class Hadoop0202 < Formula
url 'http://www.gtlib.gatech.edu/pub/apache/hadoop/core/hadoop-0.20.2/hadoop-0.20.2.tar.gz'
homepage 'http://hadoop.apache.org/common/'
md5 '8f40198ed18bef28aeea1401ec536cb9'
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 c++ contrib lib librecordio ivy 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
inreplace "#{libexec}/conf/hadoop-env.sh",
"# export JAVA_HOME=/usr/lib/j2sdk1.5-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment