# -*- 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 89560 2012-02-02 20:31:05Z royliu@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                Vidalia
version             0.2.15
categories          security net aqua
maintainers         mnick openmaintainer
description         Vidalia is a controller GUI for the Tor software
long_description    Vidalia is a cross-platform controller GUI for the Tor software, \
                    built using the Qt framework. Vidalia runs on most platforms \
                    supported by Qt 4.2 or later

platforms           darwin
license             {GPL-2+ OpenSSLException}
homepage            https://www.torproject.org/projects/vidalia.html.en
master_sites        https://www.torproject.org/dist/vidalia/
distname            vidalia-${version}

checksums           rmd160  26dccaba3be689ab815f35ebc07b060b9581a583 \
                    sha256  4598fdd9fb8e1d6fcdd02b908f331dba6e34ffdd72046ab94c2ef091a8c18809

depends_lib-append  port:tor

patchfiles          patch-TorSettings.h.diff

destroot {
    file copy ${worksrcpath}/src/vidalia/Vidalia.app ${destroot}${applications_dir}/Vidalia.app
}

variant qt_mac conflicts qt_x11 description {build with qt4-mac} {
    PortGroup qt4 1.0
    configure.args ${qt_cmake_defines}
}

variant qt_x11 conflicts qt_mac description {build with qt4-x11} {
    depends_lib-append port:qt4-x11
    configure.args  \
        -DQT_LIBRARY_DIR=${prefix}/libexec/qt4-x11/lib \
        -DQT_QMAKE_EXECUTABLE=${prefix}/libexec/qt4-x11/bin/qmake
}

if {![variant_isset qt_mac] && ![variant_isset qt_x11]} {
    default_variants +qt_mac
}

livecheck.type      regexm
livecheck.url       ${homepage}
livecheck.regex     The most recent stable release is: (\[\\d\.\]+)
