class Tor < Formula desc "Anonymizing overlay network for TCP" homepage "https://www.torproject.org/" url "https://tor.eff.org/dist/tor-0.3.0.9.tar.gz" mirror "https://www.torproject.org/dist/tor-0.3.0.9.tar.gz" sha256 "48d4880bf6ccb19ce9af2abde6946d7cf0635cc807548badbf4a221a79581e42" bottle do sha256 "95fb42ba3fbaa1d6a82f4925b81e17b4c482758015307db07885840415a05cf2" => :sierra sha256 "ca6b4270b67ec03412005a7ab185b0e5956bdab34a6a9e453e26df51db826a73" => :el_capitan sha256 "ce46158820e601f3863f3ea2004a522321200c4c3ae38970c8920fecbe0fd263" => :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