# $Id: Portfile,v 1.3 2005/08/11 21:33:21 rshaw Exp $
PortSystem		1.0

name			mb2md
version			3.20
categories		mail
maintainers		darwinports@opendarwin.org
description		Script for converting Mbox mailboxes to Maildir format
long_description	Perl script that takes one or more Mbox format \
					mailbox files in a directory and convert them to \
					Maildir format mailboxes.  It also converts the \
					mailspool file.  It is smart enough to not transfer \
					a dummy message such as the UW IMAPD puts at the \
					start of Mbox mailboxes - and you could add your own \
					search terms into the script to make it ignore other \
					forms of dummy first message.
homepage		http://batleth.sapienti-sat.org/projects/${name}
master_sites	${homepage}
distfiles		${name}-${version}.pl.gz
checksums		md5 b47eaa6ae4231a42f4a15564a08eb439
platforms		darwin

depends_run		bin:perl:perl5.8 \
				port:p5-timedate

pre-extract		{ file mkdir ${worksrcpath} }
extract.post_args	">${worksrcpath}/${name}-${version}.pl"

patchfiles		patch-${name}

use_configure	no

build {
	file copy ${worksrcpath}/${name}-${version}.pl ${worksrcpath}/${name}
	reinplace "s|^#!.*perl|#!${prefix}/bin/perl|" ${worksrcpath}/${name}
}

destroot {
	xinstall -d -m 0755 ${destroot}${prefix}/bin
	xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin
}

