class Tor < Formula desc "Anonymizing overlay network for TCP" homepage "https://www.torproject.org/" url "https://www.torproject.org/dist/tor-0.3.5.8.tar.gz" mirror "https://www.torservers.net/mirrors/torproject.org/dist/tor-0.3.5.8.tar.gz" sha256 "d5c56603942a8927670f50a4a469fb909e29d3571fdd013389d567e57abc0b47" bottle do sha256 "fd1f5c7aa141aebb3d6885641fd4de721c43264a654172db05f698413307bc55" => :mojave sha256 "71c152e925b7f9c600c54bad67e6bd4efbd9faee13c084150a2ea33a3188edd3" => :high_sierra sha256 "6e1252d94f3a531b3265f5f5cf3012b67b1d3c198707017cc356714d025a85d8" => :sierra end depends_on "pkg-config" => :build depends_on "libevent" depends_on "libscrypt" depends_on "openssl" def install args = %W[ --disable-dependency-tracking --disable-silent-rules --prefix=#{prefix} --sysconfdir=#{etc} --localstatedir=#{var} --with-openssl-dir=#{Formula["openssl"].opt_prefix} ] 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