aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-02-28 02:12:28 +0800
committerXu Cheng2015-02-28 13:11:12 +0800
commit604319ab92c156dfba2d4203542843ca51412c59 (patch)
treec709fb175a9b4ea61b4a2f64ff774c70330af1ae /Library
parent48a55548d414500f8d6c26dfbde5a694cc03fbf2 (diff)
downloadhomebrew-604319ab92c156dfba2d4203542843ca51412c59.tar.bz2
pig: set JAVA_HOME PIG_HOME in script
Also modernize and test it. Closes #36603 Closes #37189. Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/pig.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/Library/Formula/pig.rb b/Library/Formula/pig.rb
index 4e1cd3f7a..b9447310c 100644
--- a/Library/Formula/pig.rb
+++ b/Library/Formula/pig.rb
@@ -1,21 +1,23 @@
-require 'formula'
-
class Pig < Formula
- homepage 'http://pig.apache.org/'
- url 'http://www.apache.org/dyn/closer.cgi?path=pig/pig-0.14.0/pig-0.14.0.tar.gz'
- sha256 '6aea66dda4791f82bad9654ec5290efc6179d333077b0ce9f07624c9c8b071a0'
+ homepage "http://pig.apache.org/"
+ url "http://www.apache.org/dyn/closer.cgi?path=pig/pig-0.14.0/pig-0.14.0.tar.gz"
+ sha256 "6aea66dda4791f82bad9654ec5290efc6179d333077b0ce9f07624c9c8b071a0"
+
+ depends_on :java
patch :DATA
def install
- bin.install 'bin/pig'
- prefix.install ["pig-#{version}-core-h1.jar", "pig-#{version}-core-h2.jar"]
+ (libexec/"bin").install "bin/pig"
+ libexec.install ["pig-#{version}-core-h1.jar", "pig-#{version}-core-h2.jar", "lib"]
+ (bin/"pig").write_env_script libexec/"bin/pig", Language::Java.java_home_env.merge(:PIG_HOME => libexec)
end
- def caveats; <<-EOS.undent
- You may need to set JAVA_HOME:
- export JAVA_HOME="$(/usr/libexec/java_home)"
+ test do
+ (testpath/"test.pig").write <<-EOS.undent
+ sh echo "Hello World"
EOS
+ system bin/"pig", "-x", "local", "test.pig"
end
end