# $Id: Portfile 56063 2009-08-24 00:39:48Z ryandesign@macports.org $

PortSystem          1.0

name                mcabber
version             0.9.9
categories          net
maintainers         hitzemann.org:simon
description         Console Jabber client
long_description    \
    mcabber is a small Jabber console client. It includes features like \
    SSL, MUC, history logging, command completion, OpenPGP encryption, \
    OTR and external action triggers.
homepage            http://mcabber.com/
platforms           darwin
master_sites        http://mcabber.com/files/
use_bzip2           yes
checksums           md5     189fb9d23f5a8412bc660884528475ea \
                    sha1    334f483f554098af3768d5746bc0395bfe663c91 \
                    rmd160  6babdbfff6c2b5ab4a1336de412dc726b7ca0e4a

depends_lib          lib:libgpgme:gpgme \
                     port:libiconv \
                     port:ncursesw \
                     port:glib2 \
                     port:gettext \
                     port:libotr

depends_build        bin:gawk:gawk \
                     bin:pkg-config:pkgconfig \
                     bin:gpgme-config:gpgme \
                     bin:gcrypt-config:libgcrypt \
                     bin:gmkdir:coreutils

configure.args      --enable-otr \
                    --with-libotr-prefix=${prefix}/lib \
                    --with-libotr-inc-prefix=${prefix}/include \
                    --without-ssl \
                    --without-openssl

configure.env       LIBTOOL=glibtool

#TODO
#Check why I get errors during linking, until then keep disabled
#variant gnutls {
#                    configure.args-delete --without-ssl
#                    configure.args-append --with-ssl
#                    configure.args-append --with-libgnutls-extra-prefix=${prefix}
#                    depends_lib-append port:gnutls
#               }

variant ssl \
description "Use OpenSSL" {
                    configure.args-delete --without-ssl
                    configure.args-delete --without-openssl
                    configure.args-append --with-ssl
                    configure.args-append --with-openssl=${prefix}
                    depends_lib-append port:openssl
               }

variant aspell \
description "Use aspell spell checking" {
                    configure.args-append --enable-aspell
                    depends_lib-append port:aspell
               }

post-configure {
                    reinplace "s|#define HAVE_LOCALCHARSET_H 1|\/\* #undef HAVE_LOCALCHARSET_H \*\/|g" ${worksrcpath}/config.h
               }
