aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/hive.rb
diff options
context:
space:
mode:
authordbrown2010-10-28 19:06:27 -0400
committerAdam Vandenberg2010-10-30 15:24:08 -0700
commita392a56097115bad24816c82814ca89ea5703f35 (patch)
treecf4fcba056555b8dab25ee52fddd15f88d4449d2 /Library/Formula/hive.rb
parent39c77d0106011b220046159af754e14b192a5b1e (diff)
downloadhomebrew-a392a56097115bad24816c82814ca89ea5703f35.tar.bz2
New formula: Hive
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/hive.rb')
-rw-r--r--Library/Formula/hive.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/Library/Formula/hive.rb b/Library/Formula/hive.rb
new file mode 100644
index 000000000..f725f2f1d
--- /dev/null
+++ b/Library/Formula/hive.rb
@@ -0,0 +1,37 @@
+require 'formula'
+
+class Hive <Formula
+ url 'http://www.bizdirusa.com/mirrors/apache/hadoop/hive/hive-0.5.0/hive-0.5.0-bin.tar.gz'
+ homepage 'http://hive.apache.org'
+ md5 '2d3b47ceaea6d5cdeaabc544aa9c2c28'
+
+ depends_on 'hadoop'
+
+ 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 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}
+
+ You may also need to set JAVA_HOME.
+ EOS
+ end
+end