# -*- 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 103291 2013-02-20 08:15:58Z ryandesign@macports.org $

PortSystem          1.0

name                sylpheed
version             3.3.0
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          mail
platforms           darwin
maintainers         nomaintainer
license             {GPL-2 LGPL-2.1}

description         Fast, lightweight GTK+ mail client

long_description    Sylpheed is a fast, lightweight email client written \
                    in GTK+. The appearance and interface are similar to \
                    popular Windows clients, such as Outlook Express, \
                    Becky!, and Datula.

homepage            http://sylpheed.sraoss.jp/en/
master_sites        http://sylpheed.sraoss.jp/sylpheed/v${branch}
use_bzip2           yes

checksums           rmd160  bbdedf7e98848b4a24321e64ad8a21c311828e33 \
                    sha256  4d8f791aaf0f347439512aec72cd8262f90e020352cb2f7b63727ac5bc07353b

depends_build       port:pkgconfig

depends_lib         port:gtk2

configure.args      --disable-compface \
                    --disable-gpgme \
                    --disable-jpilot \
                    --disable-ssl \
                    --disable-gtkspell \
                    --enable-ipv6

post-destroot {
    set docpath ${destroot}${prefix}/share/doc/${name}
    file mkdir ${docpath}
    foreach f {AUTHORS ChangeLog* COPYING* LICENSE NEWS* README* TODO*} {
        eval file copy [glob ${worksrcpath}/${f}] ${docpath}
    }
}

variant ssl {
    depends_lib-append      port:openssl
    configure.args-delete   --disable-ssl
    configure.args-append   --enable-ssl
}

variant gpg {
    depends_lib-append      port:gpgme
    configure.args-delete   --disable-gpgme
    configure.args-append   --enable-gpgme \
                            --with-gpgme-prefix=${prefix}
}

variant ldap {
    depends_lib-append      port:openldap
    configure.args-append   --enable-ldap
}

variant gtkspell {
    depends_lib-append      port:gtkspell2
    configure.args-delete   --disable-gtkspell
    configure.args-append   --enable-gtkspell
}

variant compface {
    depends_lib-append      port:compface
    configure.args-delete   --disable-compface
    configure.args-append   --enable-compface
}

livecheck.type      regex
livecheck.url       ${homepage}download.html
livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}
