homebrew-core/Formula/memcached.rb
Eric DeLabar 852263634a memcached: add --enable-sasl-pwdb option
Added --enable-sasl-pwdb configure parameter to enable SASL2
authentication on an OSX Lion (10.7) machine. Details:
http://code.google.com/p/memcached/wiki/ReleaseNotes145

Closes Homebrew/homebrew#9143.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-30 18:44:54 -06:00

71 lines
2.1 KiB
Ruby

require 'formula'
class Memcached < Formula
url "http://memcached.googlecode.com/files/memcached-1.4.11.tar.gz"
homepage 'http://memcached.org/'
sha1 '30ac7cf87d1714803c265ea543312a702e09eb99'
depends_on 'libevent'
def options
[
["--enable-sasl", "Enable SASL support -- disables ASCII protocol!"],
["--enable-sasl-pwdb", "Enable SASL with memcached's own plain text password db support -- disables ASCII protocol!"],
]
end
def install
args = ["--prefix=#{prefix}"]
args << "--enable-sasl" if ARGV.include? "--enable-sasl"
args << "--enable-sasl-pwdb" if ARGV.include? "--enable-sasl-pwdb"
system "./configure", *args
system "make install"
(prefix+'com.danga.memcached.plist').write startup_plist
(prefix+'com.danga.memcached.plist').chmod 0644
end
def caveats; <<-EOS.undent
You can enable memcached to automatically load on login with:
mkdir -p ~/Library/LaunchAgents
cp #{prefix}/com.danga.memcached.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/com.danga.memcached.plist
If this is an upgrade and you already have the com.danga.memcached.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/com.danga.memcached.plist
cp #{prefix}/com.danga.memcached.plist ~/Library/LaunchAgents/com.danga.memcached.plist
launchctl load -w ~/Library/LaunchAgents/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>-l</string>
<string>localhost</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOPLIST
end
end