# $Id: Portfile,v 1.5 2005/08/11 21:33:27 rshaw Exp $
PortSystem 1.0
PortGroup perl5 1.0

perl5.setup		Mail-Audit 2.1
revision		2
maintainers		darwinports@opendarwin.org
categories-append	mail
description		Library for creating easy mail filters
long_description	Mail::Audit was inspired by Tom Christiansen's \
					audit_mail and deliverlib programs. It allows a \
					piece of email to be logged, examined, accepted into \
					a mailbox, filtered, resent elsewhere, rejected, and \
					so on. It's designed to allow you to easily create \
					filter programs to stick in a .forward file or \
					similar.
checksums		md5 b52b1142fa9ed7d847c531186f913ea6
platforms		darwin

# Depends on these Perl modules
depends_lib-append		port:p5-mailtools \
				port:p5-mail-pop3client \
				port:p5-mime-tools \
				port:p5-parse-recdescent

post-patch {
	reinplace "s|#!.*perl|#!${perl5.bin}|" \
		${worksrcpath}/proc2ma \
		${worksrcpath}/popread
}

post-build {
	system "pod2man ${worksrcpath}/proc2ma ${worksrcpath}/proc2ma.1"
}

post-destroot {
	cd ${worksrcpath}
	xinstall -m 0755 proc2ma ${destroot}${prefix}/bin/proc2ma
	xinstall -m 0644 proc2ma.1 ${destroot}${prefix}/share/man/man1/proc2ma.1
	xinstall -d -m 0755 ${destroot}${prefix}/share/${perl5.module}
	xinstall -m 0644 popread ${destroot}${prefix}/share/${perl5.module}/popread
}

