# $Id: Portfile 56369 2009-08-26 19:02:36Z jmr@macports.org $

PortSystem 1.0
name              	centerim
version           	4.22.7
categories        	net
maintainers       	nomaintainer
platforms		darwin
description       	Console multi-IM client.
long_description  	Console client for AIM/ICQ/Yahoo/IRC/LiveJournal.
checksums		md5     2db303baa9b7680c2cccb3314bfa7ae2 \
			sha1    c0b3433ed260fca23f8e10999c1cf91895489b35 \
			rmd160  83c579db34fe6e7c5d539cf78102a2de6b89f47a
homepage          	http://www.centerim.org/
master_sites      	${homepage}download/releases/
use_bzip2		yes
depends_lib		port:libiconv port:gettext port:ncurses port:openssl \
			port:jpeg port:gpgme
patchfiles		patch-configure.diff \
			patch-kkconsui_include_conscommon.h.diff

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

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."
        }
    }
}
