# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 89354 2012-01-26 09:43:13Z ryandesign@macports.org $

PortSystem          1.0

name                tor-devel
conflicts           tor
version             0.2.3.11-alpha
categories          security
platforms           darwin
maintainers         nomaintainer
license             BSD

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            https://www.torproject.org/
master_sites        ${homepage}dist/
dist_subdir         tor
distname            tor-${version}

checksums           rmd160  669385496cef14775e7d1093dac65d7e02429fbd \
                    sha256  65a760d805ca672fb6a5bda71906759d7dcc1ac1d2f2336e4039c0460d334131

patchfiles          patch-contrib__torify.in.diff

depends_lib         port:libevent \
                    port:openssl \
                    port:zlib

configure.args      --with-libevent-dir=${prefix} \
                    --with-openssl-dir=${prefix} \
                    --with-zlib-dir=${prefix} \
                    --disable-asciidoc

test.run            yes
test.target         check

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

livecheck.type      regex
livecheck.url       ${master_sites}?C=M\;O=D
livecheck.regex     [suffix tor-(\\d+\\.\\d+\\.\\d+\\.\\d+(-alpha|-beta|-rc)?)]
