homebrew-core/Formula/memcached.rb
2017-06-29 02:56:58 -07: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.37.tar.gz"
sha256 "2f335ab9110ce39036c5271ef39a582a852e424bc9659e421844073cfdf8606b"
bottle do
cellar :any
sha256 "c6bad3442e2e7c82e30c67804921d679e98c6bdfcdca0186a4517beff9dc1128" => :sierra
sha256 "f885a56c61c3a223f40604d8e283e51ac3f603376bff0f01d0c2e8e0fadf8af1" => :el_capitan
sha256 "b6da583fa7c76378434538a12628b0c46a2f9751dca27192fbc170c5854a3e0d" => :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