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.15.tar.xz" sha256 "9cfce3231c7b3b33816fc54414d8720a51ac5e723663e0685a8bb995b9f450d2" bottle do sha256 "db202eca2558ef39046aec75701778b45c53aadca32323e8754a38e2caeb115f" => :el_capitan sha256 "e771bfc371c6e75adcf6213e082516d21d9f1588bffab4a608fca722caa8c948" => :yosemite sha256 "d7124e081fc9008a50cdd321a9a82e961dfb83227c1dbafda6bf091fc8ceb9aa" => :mavericks end depends_on "openssl" def install # http://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 ] system "./configure", *args system "make", "install" end 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