2010-01-05 23:57:58 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Tor < Formula
|
2011-12-19 08:29:23 +00:00
|
|
|
url 'https://www.torproject.org/dist/tor-0.2.2.35.tar.gz'
|
2010-01-05 23:57:58 +00:00
|
|
|
homepage 'https://www.torproject.org/'
|
2011-12-19 08:29:23 +00:00
|
|
|
md5 'dcecf699c4b929319d5f1ce0358d4835'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-01-05 23:57:58 +00:00
|
|
|
depends_on 'libevent'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-01-05 23:57:58 +00:00
|
|
|
def install
|
2011-05-07 18:58:03 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
2010-01-05 23:57:58 +00:00
|
|
|
system "make install"
|
2011-05-07 18:58:03 +00:00
|
|
|
|
|
|
|
(prefix+'org.tor.plist').write startup_plist
|
2011-09-02 21:41:57 +00:00
|
|
|
(prefix+'org.tor.plist').chmod 0644
|
2011-05-07 18:58:03 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def startup_plist
|
|
|
|
return <<-EOPLIST
|
|
|
|
<?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>org.tor</string>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
<key>UserName</key>
|
|
|
|
<string>#{`whoami`.chomp}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{bin}/tor</string>
|
|
|
|
</array>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{HOMEBREW_PREFIX}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOPLIST
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
You can start tor automatically on login with:
|
|
|
|
mkdir -p ~/Library/LaunchAgents
|
|
|
|
cp #{prefix}/org.tor.plist ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/org.tor.plist
|
|
|
|
EOS
|
2010-01-05 23:57:58 +00:00
|
|
|
end
|
|
|
|
end
|