2011-09-25 19:39:02 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Gremlin < Formula
|
|
|
|
homepage 'http://gremlin.tinkerpop.com/'
|
2012-04-19 02:37:43 +00:00
|
|
|
url 'https://github.com/downloads/tinkerpop/gremlin/gremlin-1.3.zip'
|
2011-09-25 19:39:02 +00:00
|
|
|
md5 'c524ee20e119c3b6059cfd0b7873d94c'
|
2012-04-19 02:37:43 +00:00
|
|
|
|
|
|
|
head 'https://github.com/tinkerpop/gremlin.git'
|
2011-09-25 19:39:02 +00:00
|
|
|
|
2012-08-09 23:22:17 +00:00
|
|
|
depends_on 'maven' if build.head?
|
2011-09-25 19:39:02 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# If this is a head build, checkout the source and build it with maven
|
2012-08-09 23:22:17 +00:00
|
|
|
if build.head?
|
2011-09-25 19:39:02 +00:00
|
|
|
|
|
|
|
# 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
|
2011-11-30 18:56:07 +00:00
|
|
|
end
|