# $Id: Portfile 90406 2012-03-04 23:23:21Z yeled@macports.org $

PortSystem 1.0
PortGroup github 1.0
PortGroup python27 1.0

github.setup	spaetz offlineimap 6.5.2.1 v
categories		mail python
platforms		darwin
license			GPL-2+
maintainers		nomaintainer
supported_archs	noarch

# The following were borrowed from the Debian package.
description		IMAP/Maildir synchronization and reader support
long_description	OfflineIMAP is a tool to simplify your e-mail reading.\
			With OfflineIMAP, you can:\
			- Read the same mailbox from multiple computers, and\
			  have your changes (deletions, etc.) be automatically\
			  reflected on all computers\
			- Use various mail clients to read a single mail box\
			- Read mail while offline (on a laptop) and have all\
			  changes synchronized when you get connected again\
			- Read IMAP mail with mail readers that do not support\
			  IMAP\
			- Use SSL (secure connections) to read IMAP mail even\
			  if your reader doesn't support SSL\
			- Synchronize your mail using a completely safe and\
			  fault-tolerant algorithm. (At least I think it is!)\
			- Customize which mailboxes to synchronize with regular\
			  expressions or lists\
			- Synchronize your mail two to four times faster than\
			  with other tools or other mail readers' internal IMAP\
			  support\
			In short, OfflineIMAP is a tool to let you read mail\
			how YOU want to.

homepage		http://offlineimap.org/
dist_subdir		${name}

checksums       rmd160  5097245e5d5470747aab0b79d96f1674e8dab65b \
                sha256  046a4625459dbd4930cc8849149ef4c4db660415f6610c081c7804d419ba3131

depends_build-append	port:py27-docutils port:py27-sphinx

post-build {
	system -W ${worksrcpath} "PATH='${python.prefix}/bin:$env(PATH)' make doc man"
}

python.link_binaries_suffix

post-destroot {
	xinstall -m 644 -W ${worksrcpath} \
		COPYING \
		COPYRIGHT \
		Changelog.html Changelog.rst \
		readme.html README.rst \
		SubmittingPatches.html SubmittingPatches.rst \
		${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${worksrcpath}/docs \
		FAQ.html FAQ.rst \
		HACKING.html HACKING.rst \
		MANUAL.html MANUAL.rst \
		UPGRADE.html UPGRADE.rst \
		${destroot}${prefix}/share/doc/${name}
	copy ${worksrcpath}/docs/dev-doc ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 ${worksrcpath}/offlineimap.1 ${destroot}${prefix}/share/man/man1
	xinstall -m 644 ${worksrcpath}/offlineimap.conf \
		${destroot}${prefix}/etc/offlineimap.conf.sample
	xinstall -m 644 ${worksrcpath}/offlineimap.conf.minimal \
		${destroot}${prefix}/etc/offlineimap.conf.minimal.sample
}
