class Squid < Formula desc "Advanced proxy caching server for HTTP, HTTPS, FTP, and Gopher" homepage "http://www.squid-cache.org/" url "http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.23.tar.xz" sha256 "fa4c0c99f41e92fe1330bed3968d176c6f47ef2e3aea2f83977d5501afa40bdb" bottle do sha256 "81252cb6b996527204361c6d0d2a4ea7d88253cbb89af04d412538642c81afdd" => :sierra sha256 "a6d502f21b947fa1204f80dde1039761d078bf9abb60595da37bfa956984bb8b" => :el_capitan sha256 "b84d56e79dc041835b79790c5c85dc999156341130eec2e30d3c2f2f849ca3c3" => :yosemite end head do url "lp:squid", :using => :bzr depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end depends_on "openssl" def install # https://stackoverflow.com/questions/20910109/building-squid-cache-on-os-x-mavericks ENV.append "LDFLAGS", "-lresolv" # For --disable-eui, see: # http://squid-web-proxy-cache.1019090.n4.nabble.com/ERROR-ARP-MAC-EUI-operations-not-supported-on-this-operating-system-td4659335.html args = %W[ --disable-debug --disable-dependency-tracking --prefix=#{prefix} --localstatedir=#{var} --sysconfdir=#{etc} --enable-ssl --enable-ssl-crtd --disable-eui --enable-pf-transparent --with-included-ltdl --with-openssl --enable-delay-pools --enable-disk-io=yes --enable-removal-policies=yes --enable-storeio=yes ] if build.head? system "./bootstrap.sh" end system "./configure", *args system "make", "install" end plist_options :manual => "squid" def plist; <<-EOS.undent KeepAlive Label #{plist_name} ProgramArguments #{opt_sbin}/squid -N -d 1 RunAtLoad WorkingDirectory #{var} EOS end test do # This test should start squid and then check it runs correctly. # However currently dies under the sandbox and "Current Directory" # seems to be set hard on HOMEBREW_PREFIX/var/cache/squid. # https://github.com/Homebrew/homebrew/pull/44348#issuecomment-143477353 # If you can fix this, please submit a PR. Thank you! assert_match version.to_s, shell_output("#{sbin}/squid -v") end end