# $Id: Portfile 104689 2013-03-31 17:11:58Z and.damore@macports.org $

PortSystem          1.0

name                isync
version             1.0.6
categories          mail
platforms           darwin
license             GPL-2
maintainers         nomaintainer
description         Synchronizes a maildir with an imap server, provides mbsync command
homepage            http://isync.sourceforge.net/

long_description    isync is a command line utility for synchronizing a \
                    remote IMAP mailbox with a local maildir-style mailbox. \
                    This is useful for working in disconnected mode, such as \
                    on a laptop. Modifications made locally and remotely are \
                    synchronized so that no message status flags are lost. \
                    Due to massive changes in interfaces the new command is \
                    called mbsync, isync is still provided for compatibility.

master_sites        sourceforge

checksums           md5     18d2e3acb2fe6cae7233f7b5f6cc3292 \
                    sha1    5cd7403722584b9677fc6a4185c0b9a00f153453 \
                    rmd160  befdabb02ef88af6ab4b9cd0d5ceb40ede98f1cc

depends_lib         port:db46 port:openssl port:zlib

post-patch {
    reinplace "s|ldb|ldb-4|g" \
        ${worksrcpath}/src/compat/Makefile.in \
        ${worksrcpath}/src/compat/Makefile.am \
        ${worksrcpath}/src/Makefile.in \
        ${worksrcpath}/src/Makefile.am
}

configure.args      --mandir=${prefix}/share/man
configure.cppflags-append   -I${prefix}/include/db46
configure.ldflags-append    -L${prefix}/lib/db46 -ldb-4

post-destroot {
    xinstall -m 644 -W ${worksrcpath}/src \
        compat/isync.1 mbsync.1 mdconvert.1 \
        ${destroot}${prefix}/share/man/man1
}
