class VarnishAT4 < Formula desc "High-performance HTTP accelerator" homepage "https://www.varnish-cache.org/" url "https://varnish-cache.org/_downloads/varnish-4.1.10.tgz" sha256 "364833fbf6fb7540ddd54b62b5ac52b2fb00e915049c8446d71d334323e87c22" bottle do sha256 "92ba094ad81290badf5058e7741651e7b9b5e4e549c4693eeeaaca40d2fe4d19" => :mojave sha256 "e9231087ada4329fb23bb4b76afaf6545ecfa2567197abd90584513143edd20e" => :high_sierra sha256 "c7b61727e6a392c17fc72eb7683d7699b7f9c5851cd3818647eac9ab2ba67bee" => :sierra sha256 "06565d5821f9054953cced9d141765f018b116e57986a470a15142ec6cfb420e" => :el_capitan end keg_only :versioned_formula depends_on "docutils" => :build depends_on "pkg-config" => :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}/opt/varnish@4/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 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