90 lines
2.7 KiB
Ruby
90 lines
2.7 KiB
Ruby
class Tor < Formula
|
|
desc "Anonymizing overlay network for TCP"
|
|
homepage "https://www.torproject.org/"
|
|
url "https://www.torproject.org/dist/tor-0.4.5.8.tar.gz"
|
|
mirror "https://www.torservers.net/mirrors/torproject.org/dist/tor-0.4.5.8.tar.gz"
|
|
sha256 "57ded091e8bcdcebb0013fe7ef4a4439827cb169358c7874fd05fa00d813e227"
|
|
# Complete list of licenses:
|
|
# https://gitweb.torproject.org/tor.git/plain/LICENSE
|
|
license all_of: [
|
|
"BSD-2-Clause",
|
|
"BSD-3-Clause",
|
|
"MIT",
|
|
"NCSA",
|
|
]
|
|
|
|
livecheck do
|
|
url "https://dist.torproject.org/"
|
|
regex(/href=.*?tor[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "b47b6b1608f8c1a14becf03b6dfe27d4f129353b515d1520931048bb79e57f8e"
|
|
sha256 big_sur: "1e21e596e47055fc6956f1caabb732542cf47c7ca25c1d1ff86ba9f3f099190c"
|
|
sha256 catalina: "634ab04bf972f10c0b23c72b75886a2233506f879fa776113c358ee8527227ba"
|
|
sha256 mojave: "7efcba4ab06298b03f489db233140ece3758597978fc026bdf272c33662bc55c"
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "libevent"
|
|
depends_on "libscrypt"
|
|
depends_on "openssl@1.1"
|
|
|
|
uses_from_macos "zlib"
|
|
|
|
def install
|
|
args = %W[
|
|
--disable-dependency-tracking
|
|
--disable-silent-rules
|
|
--prefix=#{prefix}
|
|
--sysconfdir=#{etc}
|
|
--localstatedir=#{var}
|
|
--with-openssl-dir=#{Formula["openssl@1.1"].opt_prefix}
|
|
]
|
|
|
|
system "./configure", *args
|
|
system "make", "install"
|
|
end
|
|
|
|
plist_options manual: "tor"
|
|
|
|
def plist
|
|
<<~EOS
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>KeepAlive</key>
|
|
<true/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/tor</string>
|
|
</array>
|
|
<key>WorkingDirectory</key>
|
|
<string>#{HOMEBREW_PREFIX}</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/tor.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/tor.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
on_macos do
|
|
pipe_output("script -q /dev/null #{bin}/tor-gencert --create-identity-key", "passwd\npasswd\n")
|
|
end
|
|
on_linux do
|
|
pipe_output("script -q /dev/null -e -c \"#{bin}/tor-gencert --create-identity-key\"", "passwd\npasswd\n")
|
|
end
|
|
assert_predicate testpath/"authority_certificate", :exist?
|
|
assert_predicate testpath/"authority_signing_key", :exist?
|
|
assert_predicate testpath/"authority_identity_key", :exist?
|
|
end
|
|
end
|