homebrew-core/Formula/tor.rb
Philippe Latulippe fd0d74598d Tor 0.2.2.39
Closes Homebrew/homebrew#15044.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-09-21 14:33:22 -07:00

47 lines
1.2 KiB
Ruby

require 'formula'
class Tor < Formula
homepage 'https://www.torproject.org/'
url 'https://www.torproject.org/dist/tor-0.2.2.39.tar.gz'
sha1 'cc5021a7656c0cd22de42da9f0ce7335026852bf'
depends_on 'libevent'
def install
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
system "make install"
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>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>#{`whoami`.chomp}</string>
<key>ProgramArguments</key>
<array>
<string>#{HOMEBREW_PREFIX}/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 #{plist_path} ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
EOS
end
end