# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 64480 2010-03-07 09:00:17Z mnick@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                Vidalia
version             0.2.7
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             OSI-Approved
homepage            https://www.torproject.org/vidalia/
master_sites        ${homepage}/dist/
distname            vidalia-${version}

checksums           md5     71fd5c040d7b20536d5226915c49e89a \
                    sha1    be0b5714bb060728618acfc5ee11a67886240930 \
                    rmd160  f20d3a3be9741b2e00d91e0da2365b4b1eadb205

patchfiles          patch-trayicon.diff

depends_lib-append  port:tor path:bin/qmake-mac:qt4-mac

set qmake_path      ${prefix}/bin/qmake

configure.args  \
        -DQT_LIBRARY_DIR=${frameworks_dir} \
        -DQT_QMAKE_EXECUTABLE=${qmake_path}-mac

post-patch {
    foreach f [glob ${filespath}/trayicons/*] {
        file copy ${f} ${worksrcpath}/src/vidalia/res/128x128
    }
}

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

variant x11 description {build with qt4-x11} {
    depends_lib-delete path:bin/qmake-mac:qt4-mac
    configure.args-delete -DQT_QMAKE_EXECUTABLE=${qmake_path}-mac
    
    depends_lib-append port:qt4-x11
    configure.args-append -DQT_QMAKE_EXECUTABLE=${qmake_path}-x11
}

livecheck.type  	regexm
livecheck.url 		${homepage}
livecheck.regex 	stable release is:\n<a href=\"https://trac.vidalia-project.net/milestone/Vidalia%20(\[\\d\.\]+)\">
