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.1.tar.gz" sha256 "02ded32524353da2f3e29e952e656cc2f6b5f0189400831401f9de70a6560b30" bottle do cellar :any sha256 "9fe6a37388a765d1a7b03c0a907cacdc4d9462d2911c297537ca716bdb325ef8" => :high_sierra sha256 "b8e5e7df183d99e952459ce71f6fea7109b9dc3907e72f1f07629c25e7e3fb96" => :sierra sha256 "63a701b27e48e684f1dfe6e240acefc586c10a338bf99e6987234fb8e899b016" => :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 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