# -*- 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

PortSystem          1.0

name                sylpheed
version             3.7.0
revision            1
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          mail
platforms           darwin
maintainers         {hotplate.co.nz:michael @fincham} openmaintainer
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  09ee37dfc063e76fc3780de613cfd80be917d6d8 \
                    sha256  eb23e6bda2c02095dfb0130668cf7c75d1f256904e3a7337815b4da5cb72eb04 \
                    size    3612328

depends_build       port:pkgconfig

depends_lib         path:lib/pkgconfig/gtk+-2.0.pc:gtk2

patchfiles          dynamic_lookup-11.patch

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

post-destroot {
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    foreach f {AUTHORS ChangeLog* COPYING* LICENSE NEWS* README* TODO*} {
        copy {*}[glob ${worksrcpath}/${f}] ${destroot}${docdir}
    }
}

variant ssl {
    depends_lib-append      path:lib/libssl.dylib: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      path:lib/libldap.dylib: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}
