# $Id: Portfile 70012 2010-07-26 11:20:36Z simon@macports.org $

PortSystem          1.0

name                mutt
version             1.4.2.3
revision            1
categories          mail
platforms           darwin linux
maintainers         nomaintainer
description         Mongrel of Mail User Agents (part Elm, Pine, Mush, mh, etc)
long_description    Mutt -- "The Mongrel of Mail User Agents" (part Elm, \
                    part Pine, part mh, part slrn, part everything else) is \
                    an interactive screen-oriented mailer program that \
                    supersedes Elm, Pine, mail and mailx.  Features include \
                    color support, message threading, MIME support \
                    (including RFC1522 support for encoded headers), \
                    customizable key bindings, POP3, Delivery Status \
                    Notification (DSN) support, PGP/MIME, and S/MIME.

homepage            http://www.mutt.org/
master_sites        ftp://ftp.mutt.org/mutt/
checksums           ${distfiles} \
                        md5 dcb94661827dd090fa813e73e122ea0c \
                        sha1 b23e46873f0247e85a4417cf338d64ea698c9b2c \
                        rmd160 59e66c308cd4967e587ad1dc73dd76c7f0d06ef1

depends_lib         port:gettext \
                    port:libiconv \
                    port:ncurses

patch.args          -p1

configure.args      --disable-warnings \
                    --mandir=${prefix}/share/man \
                    --with-docdir=${prefix}/share/doc/mutt

platform darwin {
    configure.args-append   --with-libiconv-prefix=${prefix}
    depends_lib             port:gettext
}

platform linux {
    configure.cflags    -I/usr/kerberos/include
}

variant pop description {POP support} {
    configure.args-append   --enable-pop
}
variant imap description {IMAP support} {
    configure.args-append   --enable-imap
}
variant ssl description {Secure Sockets Layer support} {
    configure.args-append   --with-ssl
    depends_lib-append      port:openssl
}

variant debug description {Debugging support} {
    configure.args-append   --enable-debug
}

# use file size attribute instead of access time
variant buffy {
    configure.args-append   --enable-buffy-size
}

variant compress description {Compressed folders} {
    configure.args-append   --enable-compressed
    patch_sites-append      http://www.spinnaker.de/mutt/compressed/
    patchfiles-append       patch-1.4.2.3.rr.compressed.1.gz
    checksums-append        patch-1.4.2.3.rr.compressed.1.gz md5 \
                                e681845be515a02f4607db66d7bed919
}

variant nntp conflicts compress description {NNTP support} {
    depends_lib-append      port:automake port:autoconf
    configure.args-append   --enable-nntp

    pre-configure {
        system "cd ${worksrcpath}; aclocal -I m4; autoheader;
                cd m4; make -f Makefile.am.in; cd ..;
                automake --foreign; autoconf"
    }

    patch_sites-append      http://www.mutt.org.ua/download/mutt-1.4.2.3/
    patchfiles-append       patch-1.4.2.3.vvv.nntp.gz
    checksums-append        patch-1.4.2.3.vvv.nntp.gz md5 \
                                94344bf43c12c771e234a6675d3acdc7
}
