class VarnishAT4 < Formula desc "High-performance HTTP accelerator" homepage "https://www.varnish-cache.org/" url "https://repo.varnish-cache.org/source/varnish-4.1.7.tar.gz" sha256 "c52ee2f5d052a496f3700d8ac8eb4da45144779c863f09f7be70daec3cfed105" bottle do sha256 "e34cb934931f91ae0691e69455dbf0710ad4b455ed3d4713470b5cbae1a78efb" => :sierra sha256 "cf20c9bb932bfacf42c92e07fa6f822f5db5bc89e4057bb08c2c60801953baa4" => :el_capitan sha256 "da5777b7b53efa6bcad9bb4054ed84565d56f977fde127441734ee6f3dfc7cb4" => :yosemite end keg_only :versioned_formula 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