aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAlexander Solovyov2009-11-05 11:18:23 +0200
committerAlexander Solovyov2009-11-11 22:54:11 +0200
commit2b9f56dd7ff25dd86ed41e83aa19550fe6744881 (patch)
tree1b6bb0d5a4d9c46c18d9001668cf40f21d1fc86f /Library
parent2ce58bc55bf881ddd5c88e55bf8b424dff13e0c0 (diff)
downloadhomebrew-2b9f56dd7ff25dd86ed41e83aa19550fe6744881.tar.bz2
add plist to memcached
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/memcached.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/Library/Formula/memcached.rb b/Library/Formula/memcached.rb
index d7a24b204..3fd8bc065 100644
--- a/Library/Formula/memcached.rb
+++ b/Library/Formula/memcached.rb
@@ -10,5 +10,44 @@ class Memcached <Formula
def install
system "./configure --prefix='#{prefix}'"
system "make install"
+
+ (prefix+'com.danga.memcached.plist').write startup_plist
+ end
+
+ def caveats; <<-EOS
+You can enabled memcached to automatically load on login with:
+ launchctl load -w #{prefix}/com.danga.memcached.plist
+
+Or start it manually:
+ #{HOMEBREW_PREFIX}/bin/memcached
+
+Add "-d" to start it as a daemon.
+ EOS
+ end
+
+ def startup_plist
+ return <<-EOPLIST
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.danga.memcached</string>
+ <key>KeepAlive</key>
+ <true/>
+ <key>ProgramArguments</key>
+ <array>
+ <string>#{HOMEBREW_PREFIX}/bin/memcached</string>
+ <string>-d</string>
+ </array>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>UserName</key>
+ <string>#{`whoami`}</string>
+ <key>WorkingDirectory</key>
+ <string>#{HOMEBREW_PREFIX}</string>
+</dict>
+</plist>
+ EOPLIST
end
end