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

github.setup            ietf-tools rfcdiff 1.49
github.tarball_from     archive

categories              textproc
license                 GPL-2+
platforms               any
supported_archs         noarch
maintainers             {sethm.id.au:dev @McDaMastR} \
                        openmaintainer

description             Compare Internet-Draft versions
long_description        The purpose of this program is to compare two versions \
                        of an internet-draft, and as output produce a diff in \
                        one of several formats.

installs_libs           no

depends_run-append      port:bash \
                        port:wdiff \
                        port:wget

checksums               rmd160  961e502c9232fc733ec3d5c5258c4a472577b588 \
                        sha256  a4401868137cc3e7711fcd8be3cd088a75955f8dba72ec472b91880c773a93a7 \
                        size    17123

patchfiles              fix-shebang.diff

post-patch {
    reinplace "s|@@PREFIX@@|${prefix}|" ${worksrcpath}/${name}
}

use_configure           no

build {}

destroot {
    set destbindir  ${destroot}${prefix}/bin
    set destdocdir  ${destroot}${prefix}/share/doc/${name}

    xinstall -d ${destbindir}
    xinstall ${worksrcpath}/${name} ${destbindir}

    xinstall -d ${destdocdir}
    xinstall -W ${worksrcpath} -m 644 \
        LICENSE \
        README.md \
        ${destdocdir}
}

if {${os.platform} ne "darwin" || ${os.major} < 20} {
    depends_run-append      port:gawk
}
