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

name            launch
license         BSD
maintainers     nomaintainer

description     command-line launcher for macOS in the spirit of open

long_description \
    Apple provides a simple command-line launching program called open \
    with macOS. It offers few options - launching applications by name \
    or by path, launching TextEdit, or opening a number of applications, \
    documents, folders, or URLs. With the exception of special support for \
    TextEdit (open -a), launch does all this and more.

homepage        https://sabi.net/nriley/software/
master_sites    ${homepage}

if {${os.major} > 11} {
    version         1.2.5
    revision        0
    checksums       rmd160  2307093f481984c53572cbfbce5e82730e9db310 \
                    sha256  486632b11bee04d9f6bcb595fd2a68b5fde2f748ebdc182274778cc5cf97ff70 \
                    size    111217
} else {
    version         1.1
    revision        1
    checksums       rmd160  7eba376fdedd322ecfcc4d429bf608dcd1e79c34 \
                    sha256  5e3121c96274106466ac1dad8a7fc1d97ffe5cde6c8f07c29fc70e2a6409be62 \
                    size    35995

    patchfiles      patch-main.c.diff

    livecheck.type  none
}

xcode.destroot.path ${prefix}/bin

post-destroot {
    xinstall -m 0444 ${worksrcpath}/${name}.1 \
        ${destroot}${prefix}/share/man/man1

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 ${worksrcpath}/README ${destroot}${docdir}
}
