diff options
| author | Seth Pellegrino | 2014-10-09 14:45:57 -0700 |
|---|---|---|
| committer | Mike McQuaid | 2014-11-05 12:04:45 +0000 |
| commit | 3cf3f6893566b01dd9d13f0c441279d9d5b9ae3f (patch) | |
| tree | 35d28df03ebdf58cdbcec6460aa3f1266d344953 /Library/Formula | |
| parent | b3455a59ea80106a9af246a380f4b93a68164d42 (diff) | |
| download | homebrew-3cf3f6893566b01dd9d13f0c441279d9d5b9ae3f.tar.bz2 | |
nailgun 0.9.1 (new formula)
As per #21880 nailgun was removed because it was woefully outdated and
had moved to a new packaging format. This commit brings the nailgun
formula back from the boneyard and updates it to 0.9.1.
Closes #33068
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/nailgun.rb | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Library/Formula/nailgun.rb b/Library/Formula/nailgun.rb new file mode 100644 index 000000000..0d9b2a5ee --- /dev/null +++ b/Library/Formula/nailgun.rb @@ -0,0 +1,53 @@ +require "formula" + +class Nailgun < Formula + homepage "http://www.martiansoftware.com/nailgun/" + url "https://github.com/martylamb/nailgun/archive/nailgun-all-0.9.1.tar.gz" + sha1 "75f21504e8a6d41f263560b74c33188e91ec1a27" + + resource "nailgun-jar" do + url "http://central.maven.org/maven2/com/martiansoftware/nailgun-server/0.9.1/nailgun-server-0.9.1.jar" + sha1 "d57ea0a6f6c1bb1b616c5b3b311b3726c6ff35ad" + end + + # The makefile is not prefix aware: https://github.com/martylamb/nailgun/pull/45 + patch :DATA + + def install + system "make", "install", "CC=#{ENV.cc}", "PREFIX=#{prefix}", "CFLAGS=#{ENV.cflags}" + libexec.install resource("nailgun-jar").files("nailgun-server-#{version}.jar") + bin.write_jar_script libexec/"nailgun-server-#{version}.jar", "ng-server", "-server" + end + + test do + fork { exec "ng-server", "8765" } + sleep 1 # the server does not begin listening as fast as we can start a background process + system "ng", "--nailgun-port", "8765", "ng-version" + Kernel.system "ng", "--nailgun-port", "8765", "ng-stop" + # ng-stop always returns a non-zero exit code even on successful exit + true + end +end + +__END__ +diff --git a/Makefile b/Makefile +index 21b55e9..e4adfa4 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,13 +10,15 @@ WIN32_CC=/usr/bin/i586-mingw32msvc-gcc + CC=gcc + CFLAGS=-Wall -pedantic -s -O3 + SRCDIR=nailgun-client ++PREFIX=/usr/local + + ng: ${SRCDIR}/ng.c + @echo "Building ng client. To build a Windows binary, type 'make ng.exe'" + ${CC} ${CFLAGS} -o ng ${SRCDIR}/ng.c + + install: ng +- install ng /usr/local/bin ++ install -d ${PREFIX}/bin ++ install ng ${PREFIX}/bin + + ng.exe: ${SRCDIR}/ng.c + ${WIN32_CC} -o ng.exe ${SRCDIR}/ng.c -lwsock32 -O3 ${CFLAGS} |
