aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJustin Hart2011-12-07 09:10:26 -0700
committerAdam Vandenberg2013-01-14 07:48:47 -0800
commit42bae7d190266999018d9e1eb697c45beb7aebf9 (patch)
treee04b41bec362d0659f00b7576df648136e984f9a /Library
parent329e7769e9de7d15a65c762b70ce2bb9c02ee075 (diff)
downloadhomebrew-42bae7d190266999018d9e1eb697c45beb7aebf9.tar.bz2
kestrel 2.1.4
Closes #16605. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/kestrel.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/Library/Formula/kestrel.rb b/Library/Formula/kestrel.rb
new file mode 100644
index 000000000..9e671cf41
--- /dev/null
+++ b/Library/Formula/kestrel.rb
@@ -0,0 +1,44 @@
+require 'formula'
+
+class Kestrel < Formula
+ homepage 'http://robey.github.com/kestrel/'
+ url 'http://robey.github.com/kestrel/download/kestrel-2.4.1.zip'
+ sha1 'd6e6dabf1848fea306419c19ada0b89b6d1ad571'
+
+ def install
+ inreplace 'scripts/kestrel.sh' do |s|
+ s.change_make_var! "APP_HOME", libexec
+
+ # Fix var paths.
+ s.gsub! "/var/", "/#{var}/"
+
+ # Fix path to script in help message.
+ s.gsub! "Usage: /etc/init.d/${APP_NAME}.sh", "Usage: kestrel"
+
+ # Don't call ulimit as not root.
+ s.gsub! "ulimit -", "# ulimit -"
+ end
+
+ inreplace 'config/production.scala' do |s|
+ # Fix var paths.
+ s.gsub! "/var/", "/#{var}/"
+ end
+
+ libexec.install Dir['*']
+ (libexec + 'scripts/kestrel.sh').chmod 0755
+ (libexec + 'scripts/devel.sh').chmod 0755
+
+ (var + 'log/kestrel').mkpath
+ (var + 'run/kestrel').mkpath
+ (var + 'spool/kestrel').mkpath
+
+ (bin + 'kestrel').write <<-EOS.undent
+ #!/bin/bash
+ exec "#{libexec}/scripts/kestrel.sh" "$@"
+ EOS
+ end
+
+ def test
+ system "#{bin}/kestrel status"
+ end
+end