# -*- 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 120234 2014-05-20 00:47:42Z nicos@macports.org $

PortSystem          1.0
PortGroup           kde4   1.1

name                krdc
version             4.12.5
categories          kde kde4
license             GPL-2+ LGPL-2+
maintainers         nicos openmaintainer
description         KDE Remote Desktop Client
long_description    KRDC is a client application that allows you to view or \
                    even control the desktop session on another machine that \
                    is running a compatible server. VNC and RDP is supported.
platforms           darwin
homepage            http://www.kde.org/applications/internet/krdc/
master_sites        kde:stable/${version}/src/
use_xz              yes

checksums           rmd160  8a62c39d917d431b6f2470c2a4178c16e7cadebe \
                    sha256  ed4f184b20f5040b69729ab2dfd63a5168f910d0e349ea3a0c26691ef8591b28

#Binaries do not link to openssl, nor use the ssl backend of kdelibs4
license_noconflict  openssl

depends_lib-append  port:kdelibs4 \
                    port:LibVNCServer \
                    port:telepathy-qt

patchfiles-append   patch-vncclientthread.diff

if {![variant_isset docs]} {
    patchfiles-append   patch-CMakeLists.diff
}

pre-activate {
    #Deactivate hack for when kdenetwork4 port has been fragmented into small ports
    if {[file exists ${prefix}/lib/kde4/sambausershareplugin.so]
        && ![catch {set vers [lindex [registry_active kdenetwork4] 0]}] 
        && [rpm-vercomp [lindex $vers 1] 4.11.0] < 0} {
            registry_deactivate_composite kdenetwork4 "" [list ports_nodepcheck 1] 
    } 
}

livecheck.url       http://kde.mirrors.hoobly.com/stable/
livecheck.regex     (\\d+(\\.\\d+)+)
