67 lines
2.3 KiB
Ruby
67 lines
2.3 KiB
Ruby
class VarnishAT4 < Formula
|
|
desc "High-performance HTTP accelerator"
|
|
homepage "https://www.varnish-cache.org/"
|
|
url "https://repo.varnish-cache.org/source/varnish-4.1.3.tar.gz"
|
|
sha256 "9f9469b9fda2a578da2a9d282c71c34eeb5c42eda7f8d8728284d92282108429"
|
|
|
|
bottle do
|
|
sha256 "b5b1bd53802b5cf9c5ebb990a9802be8dd78dad2b6af30bf7c89192e0e946df1" => :sierra
|
|
sha256 "f6ccd8d31f046d53257e4d36cf2f9c5a4e1cf1159b6bc9c39a687088a8686cba" => :el_capitan
|
|
sha256 "53c5be1fc285c6b87be4e4fc745095d17f8c7cde37873250e671a1520b62fcc5" => :yosemite
|
|
end
|
|
|
|
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
|
|
<?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
|
|
|
|
test do
|
|
assert_match version.to_s, shell_output("#{sbin}/varnishd -V 2>&1")
|
|
end
|
|
end
|