homebrew-core/Formula/memcached.rb
2017-03-20 13:41:46 +01:00

62 lines
2 KiB
Ruby

class Memcached < Formula
desc "High performance, distributed memory object caching system"
homepage "https://memcached.org/"
url "https://www.memcached.org/files/memcached-1.4.36.tar.gz"
sha256 "773b6bb20bf80223ca6a15d75f570fbab346ad11ec98595e5af5e33f54bd82d8"
bottle do
cellar :any
sha256 "bdd0aa093595f71eb60f5d80d2db4cf1c648695f5ba5244671a77450cd69f20c" => :sierra
sha256 "1cfff2115f1a6c8336e5575d0512d6ea03178720a3e57967cc02ba07675b0b5e" => :el_capitan
sha256 "12d6c28f78cae0b7ca22dfabe35d631489430b48560cb3bd71c123b2842b3928" => :yosemite
end
option "with-sasl", "Enable SASL support -- disables ASCII protocol!"
option "with-sasl-pwdb", "Enable SASL with memcached's own plain text password db support -- disables ASCII protocol!"
depends_on "libevent"
deprecated_option "enable-sasl" => "with-sasl"
deprecated_option "enable-sasl-pwdb" => "with-sasl-pwdb"
conflicts_with "mysql-cluster", :because => "both install `bin/memcached`"
def install
args = ["--prefix=#{prefix}", "--disable-coverage"]
args << "--enable-sasl" if build.with? "sasl"
args << "--enable-sasl-pwdb" if build.with? "sasl-pwdb"
system "./configure", *args
system "make", "install"
end
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/memcached/bin/memcached"
def plist; <<-EOS.undent
<?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>#{plist_name}</string>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/memcached</string>
<string>-l</string>
<string>localhost</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
system "#{bin}/memcached", "-h"
end
end