# $Id: Portfile 87061 2011-11-08 23:41:02Z ryandesign@macports.org $

PortSystem 1.0

name		dumpasn1
version		20110202
categories	textproc security
platforms	darwin
maintainers	cjr
description	an ASN.1 decoder and pretty-printer
long_description	The dumpasn1 program decodes BER and DER-encoded \
			ASN.1 data, and is configured with knowledge of \
			many security-related objects.
homepage	http://www.cs.auckland.ac.nz/~pgut001/
master_sites	${homepage}
dist_subdir	${name}/${version}
distfiles	dumpasn1.c dumpasn1.cfg

checksums	dumpasn1.c \
		rmd160  65fbc959dcf36729f29d2c81d148002e934d192a \
		sha256  514e3b49adb0b2e49f8bcfc47c20c5f4202bc7e9f7b1e90bcd4d4cf592d469f4 \
		dumpasn1.cfg \
		rmd160  27c96f45ae762b202fe7ee5a3973d7e7447415ca \
		sha256  b7c0ad5a4186fcef9b37d5a95419886e8ed16f0c69603f9725c4007026958241

extract.only
extract.mkdir	yes
post-extract {
	xinstall -m 644 -W ${distpath} dumpasn1.c dumpasn1.cfg ${worksrcpath}
}

post-patch {
	reinplace "s|/etc/dumpasn1/|$prefix/etc/|g" \
		"${worksrcpath}/dumpasn1.c"
}

use_configure	no

variant universal {}

build {
	system -W ${worksrcpath} "${configure.cc} [get_canonical_archflags] -o dumpasn1 dumpasn1.c"
}

destroot {
	xinstall -c -m 0755 ${worksrcpath}/dumpasn1 \
		${destroot}${prefix}/bin/dumpasn1
	xinstall -c -m 0644 ${worksrcpath}/dumpasn1.cfg \
		${destroot}${prefix}/etc/dumpasn1.cfg
}

livecheck.type	moddate
livecheck.url	[lindex ${master_sites} 0][lindex ${distfiles} 0]
