class Tor < Formula desc "Anonymizing overlay network for TCP" homepage "https://www.torproject.org/" url "https://www.torproject.org/dist/tor-0.3.0.6.tar.gz" mirror "https://tor.eff.org/dist/tor-0.3.0.6.tar.gz" sha256 "a3e512e93cb555601fd207d914d7c5fe981d66d6ebb5821ecdf5dea738c2fb14" bottle do sha256 "d86ea3617596757b46f6e3861370dae83ebe35665c7894b6728ce29d8ece1c0d" => :sierra sha256 "88e892eff3d0e69714d5a0fed6bb6690fd2ceb796d82d596f22e887e40e5efde" => :el_capitan sha256 "c879e5337cee907158b544c28bdadc3cfc8d9534fd659a4a2cb8ee4532fd0aae" => :yosemite 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.undent 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 (testpath/"authority_certificate").exist? assert (testpath/"authority_signing_key").exist? assert (testpath/"authority_identity_key").exist? end end