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-12-16 16:03:20 +00:00
|
|
|
url 'https://www.torproject.org/dist/tor-0.2.3.25.tar.gz'
|
|
|
|
sha1 'ef02e5b0eb44ab1a5d6108c39bd4e28918de79dc'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2013-06-26 01:01:26 +00:00
|
|
|
option "with-brewed-openssl", "Build with Homebrew's OpenSSL instead of the system version"
|
|
|
|
|
2010-01-05 23:57:58 +00:00
|
|
|
depends_on 'libevent'
|
2013-06-26 01:01:26 +00:00
|
|
|
depends_on 'openssl' if build.with? 'brewed-openssl'
|
2010-04-07 05:58:35 +00:00
|
|
|
|
2010-01-05 23:57:58 +00:00
|
|
|
def install
|
2013-06-26 01:01:26 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
|
|
|
|
|
|
|
args << "-with-ssl=#{Formulary.factory('openssl').opt_prefix}" if build.with? 'brewed-openssl'
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-01-05 23:57:58 +00:00
|
|
|
system "make install"
|
2011-05-07 18:58:03 +00:00
|
|
|
end
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?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_prefix}/bin/tor</string>
|
|
|
|
</array>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{HOMEBREW_PREFIX}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
2011-05-07 18:58:03 +00:00
|
|
|
EOS
|
2010-01-05 23:57:58 +00:00
|
|
|
end
|
|
|
|
end
|