# -*- 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

PortSystem          1.0
PortGroup           cmake 1.1

name                polkit-qt
version             0.112.0
revision            1
categories          kde security
license             {LGPL GPL-2+}
maintainers         {gmail.com:rjvbertin @RJVB} openmaintainer
description         Qt PolicyKit wrapper
long_description    Polkit-qt is a library that lets developers use the PolicyKit API through a nice \
                    Qt-styled API. It is mainly a wrapper around QAction and QAbstractButton that \
                    lets you integrate those two component easily with PolicyKit
platforms           darwin
homepage            https://techbase.kde.org/Polkit-Qt-1
master_sites        kde:stable/apps/KDE4.x/admin/
distname            ${name}-1-${version}
use_bzip2           yes

checksums           rmd160  6104a17a0b5ae4bd8c21426d30dbb3e49a225fbb \
                    sha256  67fb03bf6ca3e0bdbd98d374dfb5b1651a07d17ae6c23e11a81b4b084447e7c6

depends_build-append \
                    port:pkgconfig

depends_lib         port:policykit

conflicts           polkit-qt polkit-qt5 polkit-qt5-devel
conflicts-delete    ${subport}

if {[string match "*-qt5*" $subport]} {
    long_description \
                    Polkit-qt5 is a library that lets developers use the PolicyKit API through a nice \
                    Qt5-styled API. It is mainly a wrapper around QAction and QAbstractButton that \
                    lets you integrate those two component easily with PolicyKit
    categories-append \
                    kf5
    PortGroup       qt5 1.0
    configure.args-append \
                    -DUSE_QT5:BOOL=ON -DUSE_QT4:BOOL=OFF
}

subport polkit-qt5-devel {
    fetch.type      git
    git.url         git://anongit.kde.org/polkit-qt-1
    git.branch      1b4b6b721d4f853f0ef93808ccf6648f3a7b3b9f
    version         0.112.0.9
}

if {${subport} eq "polkit-qt"} {
    categories-append \
                    kde4
    PortGroup       qt4 1.0
    configure.args-append \
                    -DUSE_QT4:BOOL=ON -DUSE_QT5:BOOL=OFF
    depends_build-append \
                    port:automoc
}

post-patch {
    if {[file exists ${worksrcpath}/cmake/modules/FindAutomoc4.cmake]} {
        # remove the buggy prodided script for finding automoc
        delete ${worksrcpath}/cmake/modules/FindAutomoc4.cmake
    }
}

livecheck.type      regex
livecheck.url       http://download.kde.org/stable/apps/KDE4.x/admin/
livecheck.regex     "${name}-1-(\\d+(?:\\.\\d+)*)"
