Skip to content

Instantly share code, notes, and snippets.

@marblejenka
Created April 9, 2011 06:26
Show Gist options
  • Save marblejenka/911188 to your computer and use it in GitHub Desktop.
Save marblejenka/911188 to your computer and use it in GitHub Desktop.
cdh3bのバージョン4になってて微妙感はあり
require 'formula'
class Hadoop0202Cdh3b < Formula
url 'http://archive.cloudera.com/cdh/3/hadoop-0.20.2-CDH3B4.tar.gz'
homepage ''
md5 '18652c52229390752f354b0667e075d6'
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]
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment