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.6.tar.gz" sha256 "01e1da09452010111107ca1b3a8b7f1927731ba0fe4380bacae1c626fdc521e4" bottle do cellar :any sha256 "e030f79f8d4dc31515c826a87736a23170053d5f51e02a519d2e28a370b5e088" => :mojave sha256 "112ec31bf21214dbfad04d75472313a38d918093e73ac75d72ace5c37e97b8d1" => :high_sierra sha256 "3300911362c911f320aa93fd7f515310477e51f9e9e3126915840361ef0d9b9e" => :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