2010-01-05 23:57:58 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Tor < Formula
|
2010-01-05 23:57:58 +00:00
|
|
|
homepage 'https://www.torproject.org/'
|
2012-05-29 23:54:05 +00:00
|
|
|
url 'https://www.torproject.org/dist/tor-0.2.2.36.tar.gz'
|
|
|
|
md5 '620b2110086aba01236b57f1d5aba416'
|
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
|
2012-02-15 06:09:56 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
2010-01-05 23:57:58 +00:00
|
|
|
system "make install"
|
2011-05-07 18:58:03 +00:00
|
|
|
|
2011-12-31 05:56:52 +00:00
|
|
|
plist_path.write startup_plist
|
|
|
|
plist_path.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>
|
2011-12-31 05:56:52 +00:00
|
|
|
<string>#{plist_name}</string>
|
2011-05-07 18:58:03 +00:00
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
<key>UserName</key>
|
|
|
|
<string>#{`whoami`.chomp}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
2011-12-31 22:13:31 +00:00
|
|
|
<string>#{HOMEBREW_PREFIX}/bin/tor</string>
|
2011-05-07 18:58:03 +00:00
|
|
|
</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
|
2011-12-31 05:56:52 +00:00
|
|
|
cp #{plist_path} ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
|
2011-05-07 18:58:03 +00:00
|
|
|
EOS
|
2010-01-05 23:57:58 +00:00
|
|
|
end
|
|
|
|
end
|