forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
hadoop0202.rb
37 lines (31 loc) · 984 Bytes
/
hadoop0202.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'formula'
class Hadoop0202 < Formula
url 'http://archive.apache.org/dist/hadoop/common/hadoop-0.20.2/hadoop-0.20.2.tar.gz'
homepage 'http://hadoop.apache.org/'
sha1 'c15d89f8f379e5ef242e36a881e45e79c934bfd7'
keg_only "Conflicts with hadoop in core."
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 contrib]
libexec.install Dir['*.jar']
bin.write_exec_script Dir["#{libexec}/bin/*"]
# But don't make rcc visible, it conflicts with Qt
(bin/'rcc').unlink
inreplace "#{libexec}/conf/hadoop-env.sh",
"# export JAVA_HOME=/usr/lib/j2sdk1.5-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