# $Id: Portfile 68097 2010-05-27 00:26:07Z toby@macports.org $

PortSystem 1.0
name             nawk
version          20100523
categories       lang
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        md5 aca604d1b4c5429f089ecea59422f4dd \
                 sha1 f351df8a98ce8df47b04aa16b86730cd8faf7d91 \
                 rmd160 9e83954c7bd11c198b53955fec3a3d092ed8fb3d
dist_subdir      ${name}/${version}

extract.mkdir    yes

patchfiles       patch-makefile patch-run.c

configure {
	reinplace s|__CFLAGS__|${configure.cflags}| ${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   f794a7e47760bdacf89ed769c6789805
