homebrew-core/Formula/memcached.rb
2017-01-31 10:01:14 +01:00

63 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.34.tar.gz"
sha256 "5064c87f91a37d822dfeab8768490c55fe686a742f07f67c7121101e48d87c79"
revision 1
bottle do
cellar :any
sha256 "0ffe1d65c709372aab427d0edc61e13038ff09facb22a7c27d8c69603b200243" => :sierra
sha256 "35445a6e7e7a958947b07c1f79bb61a847ce01b591a56b9a231b74a094375041" => :el_capitan
sha256 "c966d6177fa3d492df276996234297b6552a592988c56741a73d9dbc77c8c19b" => :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