# -*- 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 20260426
github.tarball_from archive
checksums           rmd160  bf47f69bf1628f8b21ea150003580b21196c44d6 \
                    sha256  7ae5b9fc6a8149bc45ea0ba3ba434a69a16d1460d19f6d01b6f04cc885b8e02b \
                    size    1846240

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
