class Varnish < Formula desc "High-performance HTTP accelerator" homepage "https://www.varnish-cache.org/" url "https://varnish-cache.org/_downloads/varnish-5.2.1.tgz" sha256 "b8452c9d78c16f78c8cfd1c1a1e696523bf64b7721c330150dcc0852459014b3" bottle do sha256 "382cd91df3dcb06cb4e741036e061f64bf42cc8f22615baf2c3c88c5e6796dce" => :high_sierra sha256 "4376d9964660db9e28b1075560bfec753d0bfd5c04fbbf9c6f2c2d9eb9d29088" => :sierra sha256 "508da7c537c4d41c9a4af5e5c8faceec47c7768bf5e9542806514f3f718a2f2b" => :el_capitan 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 -F" def plist <<~EOS 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 -F 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