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.3.tar.gz" sha256 "aac1ff3e5079997985b6560f46bf265447d0cd841f11c4d77f15942c9fe4b770" bottle do cellar :any sha256 "3d6a561f60928f04f454c931bb7319c5641ec8cf6e5621116f0e39c557a9bf27" => :mojave sha256 "6e6338da97c36d81916cf48dc2107c4d16ca6a910768e25ff728e61662bd3ccc" => :high_sierra sha256 "c6c9b20991d8533582b956c4c584e56e6750a998d5e693e87ac1d7190d021c31" => :sierra 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_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