class Haproxy < Formula desc "Reliable, high performance TCP/HTTP load balancer" homepage "https://www.haproxy.org/" url "https://www.haproxy.org/download/2.0/src/haproxy-2.0.10.tar.gz" sha256 "1d38ab3dd45e930b209e922a360ee8c636103e21e5b5a2656d3795401316a4ea" bottle do cellar :any sha256 "eb7467883a9fb408c32f2503eaeeb5f12f14183474c0d0f7282ba4136ce6ff4e" => :catalina sha256 "7b3c9737ffb968bf47793fb1b4843f765ccedc6193df2ce0371ce2bf21f4b709" => :mojave sha256 "5c8038a4a10a33307584aae6d9adeee56675f73550546e7cc2604838d63d2d39" => :high_sierra end depends_on "openssl@1.1" depends_on "pcre" def install args = %w[ TARGET=generic USE_KQUEUE=1 USE_POLL=1 USE_PCRE=1 USE_OPENSSL=1 USE_THREAD=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 Label #{plist_name} KeepAlive ProgramArguments #{opt_bin}/haproxy -f #{etc}/haproxy.cfg StandardErrorPath #{var}/log/haproxy.log StandardOutPath #{var}/log/haproxy.log EOS end test do system bin/"haproxy", "-v" end end