2010-01-05 23:57:58 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Tor < Formula
|
2011-09-25 03:28:35 +00:00
|
|
|
url 'https://www.torproject.org/dist/tor-0.2.2.33.tar.gz'
|
2010-01-05 23:57:58 +00:00
|
|
|
homepage 'https://www.torproject.org/'
|
2011-09-25 03:28:35 +00:00
|
|
|
md5 'ea99aba49694bb982d2fccc57a70d58e'
|
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 patches
|
2010-11-10 18:16:28 +00:00
|
|
|
{:p0 => 'https://gist.github.com/raw/344132/d27d1cd3042d7c58120688d79ed25a2fc959a2de/config.guess-x86_64patch.diff' }
|
2010-01-05 23:57:58 +00:00
|
|
|
end
|
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
|