# $Id: Portfile 66315 2010-04-09 03:53:28Z boeyms@macports.org $

PortSystem 1.0

name             tor
version          0.2.1.25
categories       security
maintainers      boeyms openmaintainer
description      anonymizing overlay network for TCP
long_description \
	Tor provides a distributed network of servers \
	(onion routers). Users bounce their TCP streams \
	(web traffic, FTP, SSH, etc.) around the \
	routers. This makes it hard for recipients, \
	observers, and even the onion routers \
	themselves to track the source of the stream.
homepage         http://www.torproject.org/
platforms        darwin
master_sites     ${homepage}dist/
checksums        md5 f58540b3c5835ac4f5de1b02bbddc703 \
                 sha1 11c176374be47825b4b7fa00b5654277d0838022 \
                 rmd160 e691b904e0d447b3f590f1e9e71b4daad020bd8d

depends_lib      port:libevent port:openssl port:zlib
configure.args   --mandir=${prefix}/share/man

post-destroot {
    set tsocksconf  ${destroot}${prefix}/etc/tor/tor-tsocks.conf 
    move ${tsocksconf} ${tsocksconf}.sample
}

test.run         yes
test.target      check
livecheck.type   regex
livecheck.url    ${master_sites}?C=M\;O=D
livecheck.regex  [suffix tor-(\\d+\\.\\d+\\.\\d+\\.\\d+)]
