class Tor < Formula desc "Anonymizing overlay network for TCP" homepage "https://www.torproject.org/" url "https://www.torproject.org/dist/tor-0.3.2.10.tar.gz" mirror "https://tor.eff.org/dist/tor-0.3.2.10.tar.gz" sha256 "60df77c31dcf94fdd686c8ca8c34f3b70243b33a7344ecc0b719d5ca2617cbee" bottle do sha256 "c9170852c7734a4703d60984d9394e5877a8d0346cad0e124565ede5fef154a4" => :high_sierra sha256 "29dc187af55647e455cfb5e7a62bc4da1316f7f1c753c387089d6a17a8940c40" => :sierra sha256 "6ccb7fbb44b052d4f6e5b3c27008d46a7772cc6a70266578b067e065ba9d59e3" => :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