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.8.tar.gz" sha256 "c37e1e8515ad6f9781a0ac336ca88787f3bb52252fb2bdad9919ba16323c280a" bottle do cellar :any sha256 "07b65ac587a6d22b8641911778302e635e4df6d0d77714689261a4eed156afd9" => :catalina sha256 "27865b6d245166ae4a6a03c866635e24fbb4702eb059254817eaf33f9a3ae355" => :mojave sha256 "afe7c40e173fa908b7c049b4e235a7e114f857ae550513b2cf44b1f74922e9c8" => :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