# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           xcode 1.0

name                Lingon
license             Apache-2
categories          aqua sysutils
maintainers         nomaintainer
homepage            http://sourceforge.net/projects/lingon
description         Graphical interface for creating launchd configurations

long_description    Lingon is a graphical interface for creating launchd configuration \
                    files and controlling them through launchctl.

master_sites        sourceforge:lingon


if {${os.major} < 9} {

    # use a fallback version for Tiger

    version         1.2.1
    revision        0

    checksums       rmd160  9fc0c4ac4c7b05158b38d98a09b5e3bf91bd2d42 \
                    sha256  858efda8eeaeafe8c83278bef1c0187aa09bea9f5e6a7787491b62796a2a879f \
                    size    765560

    # this version needs an alternate destroot plan
    destroot    {
        xinstall -m 755 -d ${destroot}/Applications/MacPorts
        file copy ${workpath}/${name}Source/build/Release/${name}.app \
            ${destroot}/${applications_dir}
    }

    livecheck.type  none

} else {

    # use the main version everywhere else

    version         2.1.1
    revision        1

    checksums       rmd160  102e177caefd15ee00941c2ed88bc752ba40668c \
                    sha256  e56b1f1dac6acdea8746f73c015fae89af1ca32e9aa90bf75629218f49afbd46 \
                    size    781678

    post-patch {
        reinplace "s|http://tuppis.com/lingon|${homepage}|g" ${worksrcpath}/Classes/LINMainController.m
        reinplace "s|http://tuppis.com/lingon|${homepage}|g" ${worksrcpath}/Credits.rtf
    }

    # this port does not build with the new Xcode10+ build system at present
    if {[vercmp ${xcodeversion} 10.0] >= 0} {
        build.pre_args      -UseNewBuildSystem=NO
        destroot.pre_args   -UseNewBuildSystem=NO
    }
}

use_zip             yes
distname            ${name}Source-${version}

worksrcdir          ${name}Source
xcode.target        Lingon
xcode.configuration Release
