homebrew-core/Formula/memcached.rb

54 lines
1.3 KiB
Ruby
Raw Normal View History

require 'formula'
2009-08-30 00:07:52 +00:00
class Memcached <Formula
2010-04-10 04:19:48 +00:00
url "http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz"
2009-12-01 19:40:28 +00:00
homepage 'http://www.danga.com/memcached/'
2010-04-10 04:19:48 +00:00
sha1 'c7d6517764b82d23ae2de76b56c2494343c53f02'
2009-08-30 00:07:52 +00:00
depends_on 'libevent'
2009-08-30 00:07:52 +00:00
def install
2009-12-01 19:40:28 +00:00
system "./configure", "--prefix=#{prefix}"
2009-08-30 00:07:52 +00:00
system "make install"
2009-11-05 09:18:23 +00:00
(prefix+'com.danga.memcached.plist').write startup_plist
end
def caveats; <<-EOS
You can enabled memcached to automatically load on login with:
cp #{prefix}/com.danga.memcached.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/com.danga.memcached.plist
2009-11-05 09:18:23 +00:00
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>-l</string>
<string>127.0.0.1</string>
2009-11-05 09:18:23 +00:00
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOPLIST
2009-08-30 00:07:52 +00:00
end
end