63 lines
1.8 KiB
Ruby
63 lines
1.8 KiB
Ruby
class Haproxy < Formula
|
|
desc "Reliable, high performance TCP/HTTP load balancer"
|
|
homepage "https://www.haproxy.org/"
|
|
url "https://www.haproxy.org/download/1.8/src/haproxy-1.8.0.tar.gz"
|
|
sha256 "07b6e041b477c01543fd365cb7e7fc1b7219e0f86d810828eedd593ae98b6ca0"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "34cd42d70412ff04b378c0a01050d21411c43642611f0ac3218b752e7d829c82" => :high_sierra
|
|
sha256 "29d67396d69d43009bf5369a9d10c4b1f0bad816b3c65dcf2194e1465114f80f" => :sierra
|
|
sha256 "90119a9648cd095bd99e9851ef9f08e0404c217998759aa0185cddea1e930729" => :el_capitan
|
|
end
|
|
|
|
depends_on "openssl"
|
|
depends_on "pcre"
|
|
|
|
def install
|
|
args = %w[
|
|
TARGET=generic
|
|
USE_KQUEUE=1
|
|
USE_POLL=1
|
|
USE_PCRE=1
|
|
USE_OPENSSL=1
|
|
USE_ZLIB=1
|
|
ADDLIB=-lcrypto
|
|
]
|
|
|
|
# We build generic since the Makefile.osx doesn't appear to work
|
|
system "make", "CC=#{ENV.cc}", "CFLAGS=#{ENV.cflags}", "LDFLAGS=#{ENV.ldflags}", *args
|
|
man1.install "doc/haproxy.1"
|
|
bin.install "haproxy"
|
|
end
|
|
|
|
plist_options :manual => "haproxy -f #{HOMEBREW_PREFIX}/etc/haproxy.cfg"
|
|
|
|
def plist; <<~EOS
|
|
<?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>KeepAlive</key>
|
|
<true/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/haproxy</string>
|
|
<string>-f</string>
|
|
<string>#{etc}/haproxy.cfg</string>
|
|
</array>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/haproxy.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/haproxy.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system bin/"haproxy", "-v"
|
|
end
|
|
end
|