homebrew-core/Formula/hadoop.rb
Adam Vandenberg 0f562d1a40 Update hadoop to install to libexec.
Install Hadoop to libexec, and then create shim scripts for the binaries
that run from the installed location.

This prevents PREFIX/lib from being spammed with  jars.
2010-05-05 08:48:41 -07:00

31 lines
684 B
Ruby

require 'formula'
class Hadoop < Formula
url 'http://www.carfab.com/apachesoftware/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
#!/usr/bin/env bash
cd #{libexec}/bin
./#{target} $*
EOS
end
def install
rm_f Dir["bin/*.bat"]
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