# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 118800 2014-04-11 00:15:01Z sean@macports.org $

PortSystem          1.0
PortGroup           github 1.0
PortGroup           python 1.0

github.setup        OfflineIMAP offlineimap 6.5.5 v
revision            0
categories          mail python
platforms           darwin
license             GPL-2+
maintainers         sean openmaintainer
supported_archs     noarch

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/

checksums           rmd160  6d2ad6bbd3ef728cf236b9220dd092786e4e5647 \
                    sha256  9724245dbd7822a6b1eca340101d8eb785394e8d949b08932d887c41c5ab411d

python.default_version 27
python.link_binaries_suffix

depends_build       port:py${python.version}-docutils \
                    port:py${python.version}-sphinx

conflicts           offlineimap-devel

livecheck.type      regex
livecheck.regex     (\\d\\.\\d\\.\\d)\[^-\]

subport offlineimap-devel {
    github.setup        aroig offlineimap 181bfe6d4e1b
    name                offlineimap-devel
    version             6.5.5.99
    revision            2

    conflicts           offlineimap

    checksums           rmd160  46712e8f60d0af39c0e91ed6ab7d1eef3c2086d8 \
                        sha256  73a8c22244079b334d23833284a63d0b099ce680f42e4e878038b9c34d9ea90e
}

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

post-destroot {
    xinstall -m 644 -W ${worksrcpath} \
        COPYING Changelog.html Changelog.rst \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath}/docs \
        MANUAL.rst \
        ${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
}
