# $Id$

PortSystem 1.0
name             nawk
version          20121220
categories       lang
license          BSD
maintainers      toby
description      the one true awk
long_description Kernighan's canonical implementation of awk.
homepage         http://www.cs.princeton.edu/~bwk/btl.mirror/
platforms        darwin

master_sites     ${homepage}
distname         awk
checksums        rmd160  3872ef2407a4ad57f55c45dc60fc917eca7a614e \
                 sha256  8dc092165c5a4e1449f964286483d06d0dbfba4b0bd003cb5dab30de8f6d9b83
dist_subdir      ${name}/${version}

extract.mkdir    yes

patchfiles       patch-makefile patch-run.c

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

build.target

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

livecheck.type  md5
livecheck.md5   f7938416b9255fdbcefc0e431a174dd7