aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJohn Colvin2015-03-27 11:00:15 +0000
committerMike McQuaid2015-04-02 14:33:58 +0100
commit80f5751cb48db74dc50d0e8f643869a3339a41a3 (patch)
tree6dabfa1cc4ea2fe9246deef5f7bf6247916f2e69 /Library
parente174afb9a24488060f9dee0b55d16f3f109d2d57 (diff)
downloadhomebrew-80f5751cb48db74dc50d0e8f643869a3339a41a3.tar.bz2
dcd 0.5.1 (new formula)
Closes #38117. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/dcd.rb40
1 files changed, 40 insertions, 0 deletions
diff --git a/Library/Formula/dcd.rb b/Library/Formula/dcd.rb
new file mode 100644
index 000000000..9dc816aed
--- /dev/null
+++ b/Library/Formula/dcd.rb
@@ -0,0 +1,40 @@
+class Dcd < Formula
+ homepage "https://github.com/Hackerpilot/DCD"
+ url "https://github.com/Hackerpilot/DCD.git",
+ :tag => "v0.5.1",
+ :revision => "351bf2ee2d5f1c4986c2c5957f542dda17b1d085"
+
+ bottle do
+ end
+
+ depends_on "dmd" => :build
+
+ def install
+ system "make"
+ bin.install "bin/dcd-client", "bin/dcd-server"
+ end
+
+ test do
+ begin
+ # spawn a server, using a non-default port to avoid
+ # clashes with pre-existing dcd-server instances
+ puts "==> dcd-server -p9167"
+ # would use spawn, can't on M-L as ruby 1.8
+ server = fork do
+ exec "dcd-server", "-p9167"
+ end
+ # Give it generous time to load
+ sleep 0.5
+ # query the server from a client
+ system "dcd-client", "-q", "-p9167"
+ rescue
+ if server
+ # clean up the server process
+ Process.kill "TERM", server
+ end
+ raise
+ end
+ # Ditto
+ Process.kill "TERM", server
+ end
+end