2009-12-18 20:07:13 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pig < Formula
|
2011-08-10 04:03:56 +00:00
|
|
|
homepage 'http://pig.apache.org/'
|
2012-06-16 12:30:45 +00:00
|
|
|
url 'http://www.apache.org/dyn/closer.cgi?path=pig/pig-0.10.0/pig-0.10.0.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'afb1bc2dc7393e1fda7bb0675354899e51114292'
|
2009-12-18 20:07:13 +00:00
|
|
|
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2011-11-28 00:20:32 +00:00
|
|
|
bin.install 'bin/pig'
|
2012-01-28 19:20:06 +00:00
|
|
|
prefix.install ["pig-#{version}.jar", "pig-#{version}-withouthadoop.jar"]
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
You may need to set JAVA_HOME:
|
2012-01-28 19:25:36 +00:00
|
|
|
export JAVA_HOME="$(/usr/libexec/java_home)"
|
2012-01-28 19:20:06 +00:00
|
|
|
EOS
|
2009-12-18 20:07:13 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# There's something weird with Pig's launch script, it doesn't find the correct
|
2011-11-28 00:20:32 +00:00
|
|
|
# path. This patch finds PIG_HOME from the pig binary path's symlink.
|
2009-12-18 20:07:13 +00:00
|
|
|
__END__
|
2011-11-28 00:20:32 +00:00
|
|
|
diff -u a/bin/pig b/bin/pig
|
|
|
|
--- a/bin/pig 2011-09-30 08:55:58.000000000 +1000
|
|
|
|
+++ b/bin/pig 2011-11-28 11:18:36.000000000 +1100
|
|
|
|
@@ -55,11 +55,8 @@
|
|
|
|
|
|
|
|
# resolve links - $0 may be a softlink
|
|
|
|
this="${BASH_SOURCE-$0}"
|
|
|
|
-
|
|
|
|
-# convert relative path to absolute path
|
|
|
|
-bin=$(cd -P -- "$(dirname -- "$this")">/dev/null && pwd -P)
|
|
|
|
-script="$(basename -- "$this")"
|
|
|
|
-this="$bin/$script"
|
|
|
|
+here=$(dirname $this)
|
|
|
|
+this="$here"/$(readlink $this)
|
2011-04-25 15:07:43 +00:00
|
|
|
|
2011-11-17 15:31:58 +00:00
|
|
|
# the root of the Pig installation
|
|
|
|
export PIG_HOME=`dirname "$this"`/..
|
2011-11-28 00:20:32 +00:00
|
|
|
|