# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 64763 2010-03-15 16:31:33Z nox@macports.org $

PortSystem 1.0

name                centerim-devel
version             4.22.7-36-g6ba0
revision            2
categories          net
maintainers         nomaintainer
platforms           darwin
description         Console multi-IM client.
long_description    Console client for AIM/ICQ/Yahoo/IRC/LiveJournal.
distname            centerim-${version}
checksums           md5     be3f231956ceca41e716c679e5e175ed \
                    sha1    69bf0f824fd11ff96110867c9ebf29355e7475ff \
                    rmd160  d7690ef9eb47caa5931fbafc8181ac9a163fc750
homepage            http://www.centerim.org/
master_sites        ${homepage}download/mobshots/
depends_lib         port:libiconv port:gettext port:ncurses port:openssl \
      port:jpeg port:gpgme

configure.args \
    --disable-msn \
    --disable-yahoo \
    --with-libiconv-prefix=${prefix} \
    --with-libintl-prefix=${prefix} \
    --with-ssl --with-openssl=${prefix}/include \
    --with-libjpeg --with-gpgme-prefix=${prefix} \
    --without-libcurl

variant msn description {Enable MSN support (requires curl+ssl)} {
    depends_build-append port:pkgconfig
    depends_lib-append port:curl
    configure.args-delete --disable-msn --without-libcurl
    configure.args-append --with-libcurl=${prefix}
    pre-fetch {
        set fd [open "|pkg-config --variable=supported_features libcurl"]
        eval set features [gets $fd]
        close $fd
        if {[lsearch -exact $features SSL] == -1} {
            return -code error "curl must be installed with +ssl to enable MSN support."
        }
    }
}
