# $Id: Portfile 78436 2011-05-08 01:45:30Z ryandesign@macports.org $

PortSystem 1.0

name			imapsync
version			1.411
categories		mail
platforms		darwin
maintainers		mww
license			WTFPL-2
supported_archs	noarch

description		imapsync is an IMAP synchronization, copy or migration tool.
long_description	imapsync is an IMAP synchronization, copy or migration \
				tool. Synchronize mailboxes between two imap servers. It is \
				especially good at IMAP migration.

homepage		http://www.linux-france.org/prj/imapsync/
master_sites	http://fedorahosted.org/released/imapsync/
extract.suffix	.tgz

checksums		sha1    c211aaf801a425aab5e14255399088a2a3058f15 \
				rmd160  4cedf8d974b21f7e3013808250a4a42ea30ba63a

depends_run		path:bin/perl:perl5 \
				port:p5-digest-md5 \
				port:p5-mail-imapclient \
				port:p5-term-readkey \
				port:p5-io-socket-ssl \
				port:p5-datemanip \
				port:p5-digest-hmac

post-patch {
	reinplace "s|^#!.*|#!${prefix}/bin/perl|g" ${worksrcpath}/imapsync
}

use_configure	no

build			{}

destroot {
	xinstall -m 755 ${worksrcpath}/imapsync ${destroot}${prefix}/bin/imapsync.pl
	system "cd ${destroot}${prefix}/bin && ln -s imapsync.pl imapsync"
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${worksrcpath} CREDITS ChangeLog FAQ COPYING INSTALL README \
		TODO VERSION ${destroot}${prefix}/share/doc/${name}
}

livecheck.type	regex
livecheck.url	[lindex ${master_sites} 0]
livecheck.regex	${name}-(\[.0-9\]+)\\.tgz
