require 'formula' class Varnish < Formula homepage 'http://www.varnish-cache.org/' url 'http://repo.varnish-cache.org/source/varnish-3.0.5.tar.gz' sha1 '2f3eae44cc44d263fe9513b856f49707a64cc840' depends_on 'pkg-config' => :build depends_on 'pcre' def install system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--localstatedir=#{var}" system "make install" (var+'varnish').mkpath end def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_prefix}/sbin/varnishd -n #{var}/varnish -f #{etc}/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:80 KeepAlive RunAtLoad WorkingDirectory #{HOMEBREW_PREFIX} StandardErrorPath #{var}/varnish/varnish.log StandardOutPath #{var}/varnish/varnish.log EOS end end