diff --git a/Formula/hadoop.rb b/Formula/hadoop.rb index de723b09d74..a4bd78e9228 100644 --- a/Formula/hadoop.rb +++ b/Formula/hadoop.rb @@ -5,8 +5,27 @@ class Hadoop < Formula homepage 'http://hadoop.apache.org/common/' md5 '8f40198ed18bef28aeea1401ec536cb9' + def shim_script target + <<-EOS.undent + #!/usr/bin/env bash + cd #{libexec}/bin + ./#{target} $* + EOS + end + def install rm_f Dir["bin/*.bat"] - prefix.install %w[bin conf contrib lib] + libexec.install %w[bin conf contrib lib] + 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 end end