class VarnishAT4 < Formula desc "High-performance HTTP accelerator" homepage "https://www.varnish-cache.org/" url "https://repo.varnish-cache.org/source/varnish-4.1.6.tar.gz" sha256 "c7ac460b521bebf772868b2f5aefc2f2508a1e133809cd52d3ba1b312226e849" bottle do sha256 "aecd2d0903cf3b7db9ac053ca5b4df827b30f76dc8635a771070e8af89ef1732" => :sierra sha256 "4a1943c1c5e0aef77e214108dbbf36d90660d96ae48d625745fb133e5f44439c" => :el_capitan sha256 "beda0e89f0c8c9018f67867aa01fab39b4ce3661e839ca2744ac44bc8d3cfde0" => :yosemite end depends_on "pkg-config" => :build depends_on "docutils" => :build depends_on "pcre" def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--localstatedir=#{var}" system "make", "install" (etc+"varnish").install "etc/example.vcl" => "default.vcl" (var+"varnish").mkpath end plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/varnishd -n #{HOMEBREW_PREFIX}/var/varnish -f #{HOMEBREW_PREFIX}/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:8080" def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_sbin}/varnishd -n #{var}/varnish -f #{etc}/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:8080 KeepAlive RunAtLoad WorkingDirectory #{HOMEBREW_PREFIX} StandardErrorPath #{var}/varnish/varnish.log StandardOutPath #{var}/varnish/varnish.log EOS end test do assert_match version.to_s, shell_output("#{sbin}/varnishd -V 2>&1") end end