# $Id: Portfile 82553 2011-08-15 19:22:39Z jmr@macports.org $

PortSystem 		1.0
name			mailqfmt
version			0.6
revision        1
categories		mail
maintainers		sky.fr:cbellot
homepage		http://www.dt.e-technik.uni-dortmund.de/~ma/postfix/
description		Postfix mailq file reformatter
long_description	mailqfmt reformats postfix mail queue with single \
			lines entries that are easier to parse
platforms	 	darwin
master_sites	 	http://www.dt.e-technik.uni-dortmund.de/~ma/postfix/
distfiles		${name}.pl
checksums	 	md5 e1d452850f59cd004d2d4930758a4a28
depends_lib-append	port:p5.12-libwww-perl port:postfix

variant apple_postfix description {uses the mail queues of macosx postfix} {
	depends_lib-delete	port:postfix
}

use_configure		no
extract	{
	  file copy ${distpath}/mailqfmt.pl ${workpath}/mailqfmt
	}
post-patch { 
	  reinplace "s|/usr/bin/perl|${prefix}/bin/perl5.12|g" \
	    ${workpath}/mailqfmt

if { ![variant_isset apple_postfix] } {
	  reinplace "s|/usr/bin/mailq|${prefix}/bin/mailq|g" \
	    ${workpath}/mailqfmt
   }
	}
build {}
destroot { 
	  xinstall -m 755 -d ${destroot}${prefix}/bin
	  xinstall -m 755 ${workpath}/mailqfmt ${destroot}${prefix}/bin/mailqfmt
	}
