class Varnish < Formula desc "High-performance HTTP accelerator" homepage "https://www.varnish-cache.org/" url "https://varnish-cache.org/_downloads/varnish-6.3.0.tgz" sha256 "95ccdec5f1dcba8b41d24e685b3f2379fbc6b9701d106cc78011d4d09a73947f" bottle do sha256 "9146f3c910f56ae9e837b0be9f4360240acc3f00543388b40e8b2dd86dc14554" => :catalina sha256 "718953a191b073f4c1c0bd7fdb67af10ea84c788a18094552bd2332df95ebe83" => :mojave sha256 "258db2ff48086b7d0050c816dbf37bb93b59fea5d80b0aa6b09c375efc050bdd" => :high_sierra end depends_on "docutils" => :build depends_on "graphviz" => :build depends_on "pkg-config" => :build depends_on "python" => :build depends_on "sphinx-doc" => :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