homebrew-core/Formula/varnish.rb
BrewTestBot 5def231280 varnish: update 4.0.3_1 bottle.
Closes Homebrew/homebrew#45595.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>

Closes Homebrew/homebrew#45571.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-01 22:01:24 -08:00

79 lines
2.8 KiB
Ruby

class Varnish < Formula
desc "High-performance HTTP accelerator"
homepage "https://www.varnish-cache.org/"
url "https://repo.varnish-cache.org/source/varnish-4.0.3.tar.gz"
sha256 "94b9a174097f47db2286acd2c35f235e49a2b7a9ddfdbd6eb7aa4da9ae8f8206"
revision 1
bottle do
sha256 "d33eaf2a6dfa517b4ee61c0dee4af786d28ab07068d5afdfc3ff731e4177d06f" => :el_capitan
sha256 "76969be042dd6cd03024eb8f85f0e4c5a48fa45fc6d616430154665d6fddd25a" => :yosemite
sha256 "e96d457b8e7641f696a38c4301f1739874b65a181bcaabba2ad5cb07c3744b69" => :mavericks
end
depends_on "pkg-config" => :build
depends_on "pcre"
resource "docutils" do
url "https://pypi.python.org/packages/source/d/docutils/docutils-0.11.tar.gz"
sha256 "9af4166adf364447289c5c697bb83c52f1d6f57e77849abcccd6a4a18a5e7ec9"
end
def install
ENV.prepend_create_path "PYTHONPATH", buildpath+"lib/python2.7/site-packages"
resource("docutils").stage do
system "python", "setup.py", "install", "--prefix=#{buildpath}"
end
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--localstatedir=#{var}",
"--with-rst2man=#{buildpath}/bin/rst2man.py",
"--with-rst2html=#{buildpath}/bin/rst2html.py"
system "make", "install"
(etc+"varnish").install "etc/example.vcl" => "default.vcl"
(var+"varnish").mkpath
end
test do
system "#{opt_sbin}/varnishd", "-V"
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_sbin}/varnishd</string>
<string>-n</string>
<string>#{var}/varnish</string>
<string>-f</string>
<string>#{etc}/varnish/default.vcl</string>
<string>-s</string>
<string>malloc,1G</string>
<string>-T</string>
<string>127.0.0.1:2000</string>
<string>-a</string>
<string>0.0.0.0:8080</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
<key>StandardErrorPath</key>
<string>#{var}/varnish/varnish.log</string>
<key>StandardOutPath</key>
<string>#{var}/varnish/varnish.log</string>
</dict>
</plist>
EOS
end
end