aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Roach2011-09-25 12:39:02 -0700
committerCharlie Sharpsteen2011-09-28 20:27:25 -0700
commitfc77feba126642c8b25e63a01ac025477a81e6a5 (patch)
treeebe171a7a3c9c65e710b35df83d17043318503ac
parent4b9c9fb1f97e16b7cdf31891959b80a538ccdb2e (diff)
downloadhomebrew-fc77feba126642c8b25e63a01ac025477a81e6a5.tar.bz2
New Formula: gremlin
Added a new formula for Gremlin, the graph traversal language. Closes #7853. Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
-rw-r--r--Library/Formula/gremlin.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/Library/Formula/gremlin.rb b/Library/Formula/gremlin.rb
new file mode 100644
index 000000000..e446df9d6
--- /dev/null
+++ b/Library/Formula/gremlin.rb
@@ -0,0 +1,41 @@
+require 'formula'
+
+class Gremlin < Formula
+ url 'https://github.com/downloads/tinkerpop/gremlin/gremlin-1.3.zip'
+ homepage 'http://gremlin.tinkerpop.com/'
+ md5 'c524ee20e119c3b6059cfd0b7873d94c'
+ head 'https://github.com/tinkerpop/gremlin.git', :using => :git
+
+ depends_on 'maven' if ARGV.build_head?
+
+ def install
+ # If this is a head build, checkout the source and build it with maven
+ if ARGV.build_head?
+
+ # Setup a couple of paths for the build
+ pwd = Pathname.new('.')
+ m2 = pwd+'.m2'
+
+ # Create a local settings file to make sure that all cached downloads
+ # are saved in a local repository which will be deleted once the build
+ # is complete.
+ (pwd+'settings.xml').write <<-EOF.undent
+ <?xml version="1.0" encoding="UTF-8"?>
+ <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 \
+ http://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <localRepository>#{m2}</localRepository>
+ </settings>
+ EOF
+
+ # Perform the build
+ system 'mvn clean install -s ./settings.xml'
+ end
+
+ target = Pathname.glob('./target/gremlin-*-standalone')[0]
+ libexec.install Dir[target+'lib'+'*.jar']
+ inreplace target+'bin'+'gremlin.sh', '`dirname $0`/../lib', libexec
+ bin.install target+'bin'+'gremlin.sh' => 'gremlin'
+ end
+end \ No newline at end of file