# -*- 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        laurikari tre 0.9.0 v
github.tarball_from releases
revision            0
categories          devel
maintainers         nomaintainer
license             BSD
conflicts           agrep glimpse

description         TRE is a lightweight POSIX compliant regular expression library
long_description    {*}${description}.

homepage            https://laurikari.net/tre/

checksums           rmd160  5679f091936a3fee894f2feb95211aa8f5047386 \
                    sha256  f57f5698cafdfe516d11fb0b71705916fe1162f14b08cf69d7cf86923b5a2477 \
                    size    579986

# See: https://lists.macports.org/pipermail/macports-dev/2021-December/044042.html
depends_lib-append  port:gettext-runtime \
                    port:libiconv

test.run            yes
test.target         check

post-build {
    reinplace -E {s|-arch [a-z0-9_]+||g} ${worksrcpath}/tre.pc
}

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS \
        LICENSE \
        NEWS \
        README.md \
        THANKS \
        TODO \
        ${docdir}
}
