2010-10-28 23:06:27 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Hive < Formula
|
2010-10-28 23:06:27 +00:00
|
|
|
homepage 'http://hive.apache.org'
|
2012-07-26 14:34:31 +00:00
|
|
|
url 'http://www.apache.org/dyn/closer.cgi?path=hive/hive-0.9.0/hive-0.9.0-bin.tar.gz'
|
|
|
|
sha1 '8c8086ff9ec5de5c661d98d926bbedac62c28a61'
|
2010-10-28 23:06:27 +00:00
|
|
|
|
|
|
|
depends_on 'hadoop'
|
|
|
|
|
|
|
|
def shim_script target
|
|
|
|
<<-EOS.undent
|
|
|
|
#!/bin/bash
|
2012-02-11 23:42:22 +00:00
|
|
|
exec "#{libexec}/bin/#{target}" "$@"
|
2010-10-28 23:06:27 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
rm_f Dir["bin/*.bat"]
|
|
|
|
libexec.install %w[bin conf examples lib ]
|
|
|
|
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 must be in your path for hive executable to work.
|
|
|
|
After installation, set $HIVE_HOME in your profile:
|
|
|
|
export HIVE_HOME=#{libexec}
|
|
|
|
|
2012-01-28 19:22:36 +00:00
|
|
|
You may need to set JAVA_HOME:
|
2012-01-28 19:25:36 +00:00
|
|
|
export JAVA_HOME="$(/usr/libexec/java_home)"
|
2010-10-28 23:06:27 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|