# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 72605 2010-10-21 12:41:08Z michaelld@macports.org $

PortSystem          1.0
PortGroup           xcode 1.0
PortGroup           qt4 1.0

name                QMK-Groundstation
version             1.0.1
revision            1
maintainers         lilalinux.net:macports
description         Configuration and Debugging Utility for the MikroKopter Project
long_description    Configuration and Debugging Utility for the MikroKopter Project.
homepage            http://www.mikrokopter.de/

master_sites        http://svn.mikrokopter.de/filedetails.php?repname=Projects&path=%2FQMK-Groundstation%2FRelease%2F
distname            ${name}-v${version}
extract.suffix      .tgz

checksums           md5     9b131ccbaebf6bfdd6c5aaf3094b0328 \
                    sha1    ced3a82e50fd2c69abbda23d3d091e5d158e7f1f \
                    rmd160  10de4f90afa99abbfa2638d8e09fa005a50a1579

worksrcdir          ${name}_${version}

post-extract {
    # rename worksrcdir to remove a space
    file rename "${workpath}/${name} ${version}" ${workpath}/${worksrcdir}
}

post-patch {
    # make sure ${prefix}/include and ${prefix}/include/qwt are in
    # 'qmake's INCLUDEPATH
    reinplace "/INCLUDEPATH/ s@include@include ${prefix}/include/qwt@" \
        ${worksrcpath}/osx.pro
}

configure.cmd       ${qt_qmake_cmd}
configure.pre_args  -spec macx-xcode osx.pro
use_configure       yes

post-build {
        delete ${worksrcpath}/build/bin/${name}.app
}

destroot {
       	set appPath ${destroot}${applications_dir}
       	xinstall -d -m 755 ${appPath}
       	file copy ${worksrcpath}/build/Default/${name}.app ${appPath}/${name}.app
}

variant qwt conflicts qwt52 description {Use qwt} {
    depends_lib-append  port:qwt
}

variant qwt52 conflicts qwt description {Use qwt52} {
    depends_lib-append  port:qwt52
}

if {![variant_isset qwt] && ![variant_isset qwt52]} {
    default_variants    +qwt52
}
