# $Id: Portfile 80297 2011-07-08 20:47:50Z toby@macports.org $

PortSystem 1.0
name             nawk
version          20110506
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 4d2b1002db5979a2f3a578e11b7d2fb3 \
                 sha1 567eb99d30337cb323bee39284527cecd3d45b02 \
                 rmd160 b9286a65f6f1887ede837e2b6328c13bfc327fa3
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
