# -*- 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        onetrueawk awk 20261106
github.tarball_from archive
checksums           rmd160  213ae0513eb4e86a246216534907d76c2dba3632 \
                    sha256  1b354fe6fa0089a959ef912085e7a064236d15a7d3c9e6ce86456c3b87d3f464 \
                    size    1849485

name                nawk
categories          lang
license             BSD
maintainers         {toby @tobypeterson} openmaintainer

description         the one true awk

long_description    Kernighan's canonical implementation of awk.

depends_build       port:bison

patchfiles          patch-makefile

configure {
    reinplace "s|__CFLAGS__|${configure.cflags} [get_canonical_archflags]|" ${worksrcpath}/makefile
    reinplace s|__CC__|${configure.cc}| ${worksrcpath}/makefile
    reinplace s|__PREFIX__|${prefix}| ${worksrcpath}/makefile
}

use_parallel_build  no
build.target

destroot {
    xinstall ${worksrcpath}/a.out ${destroot}${prefix}/bin/nawk
    xinstall ${worksrcpath}/awk.1 ${destroot}${prefix}/share/man/man1/nawk.1
}

test.run            yes
