class Tor < Formula desc "Anonymizing overlay network for TCP" homepage "https://www.torproject.org/" url "https://www.torproject.org/dist/tor-0.3.3.6.tar.gz" mirror "https://tor.eff.org/dist/tor-0.3.3.6.tar.gz" sha256 "99bc59f6dbf395894de12f3a83b3251a82dfd93dc7f6d3afcbbd80f6111433b7" bottle do sha256 "59aaedd430ab5d2c51ef67f22d1ced4a1ee6c302d99902bb765fe11154c7c824" => :high_sierra sha256 "0c18ed378cf3191db901cc53da28eb6ef9e05e77d6411771af4c7b83a4561fac" => :sierra sha256 "422fc422db19f9a22663761d4da9a03dc6381cad10a77fd1bb69bf64bb79938f" => :el_capitan end depends_on "pkg-config" => :build depends_on "libevent" depends_on "openssl" depends_on "libscrypt" => :optional def install args = %W[ --disable-dependency-tracking --disable-silent-rules --prefix=#{prefix} --sysconfdir=#{etc} --localstatedir=#{var} --with-openssl-dir=#{Formula["openssl"].opt_prefix} ] args << "--disable-libscrypt" if build.without? "libscrypt" system "./configure", *args system "make", "install" end plist_options :manual => "tor" def plist; <<~EOS Label #{plist_name} RunAtLoad KeepAlive ProgramArguments #{opt_bin}/tor WorkingDirectory #{HOMEBREW_PREFIX} StandardErrorPath #{var}/log/tor.log StandardOutPath #{var}/log/tor.log EOS end test do pipe_output("script -q /dev/null #{bin}/tor-gencert --create-identity-key", "passwd\npasswd\n") assert_predicate testpath/"authority_certificate", :exist? assert_predicate testpath/"authority_signing_key", :exist? assert_predicate testpath/"authority_identity_key", :exist? end end