# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-nds/gq/gq-1.0_beta1-r1.ebuild,v 1.4 2005/12/14 23:54:49 weeve Exp $

inherit eutils

S=${WORKDIR}/${PN}-${PV/_/}
DESCRIPTION="GTK-based LDAP client"

SRC_URI="mirror://sourceforge/gqclient/${PN}-${PV/_/}.tar.gz"
HOMEPAGE="http://www.biot.com/gq/"
IUSE="kerberos nls ssl sasl"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~x86"

RDEPEND=">=x11-libs/gtk+-2
	>=net-nds/openldap-2
	kerberos? ( app-crypt/mit-krb5 )
	ssl? ( dev-libs/openssl )
	dev-libs/libxml2
	>=dev-libs/glib-2
	x11-libs/pango
	sasl? ( dev-libs/cyrus-sasl )
	virtual/libc"

DEPEND="${RDEPEND}
	dev-util/pkgconfig"

#src_unpack() {
#	unpack ${A} || die
#	cd ${S} || die

	# Fix timestamp skews
#	touch aclocal.m4 configure `find . -name Makefile.in`

#	if use amd64 ; then
#		rm config.sub config.guess
#		automake --add-missing --copy
#	fi
#}

src_compile() {
	local myconf="--enable-browser-dnd --enable-cache"

	use nls \
		&& myconf="${myconf} --with-included-gettext" \
		|| myconf="${myconf} --disable-nls"

	use kerberos && myconf="${myconf} --with-kerberos-prefix=/usr"

	econf $myconf || die "./configure failed"

	emake || die "Compilation failed"
}

src_install() {
	emake DESTDIR=${D} install || die "Installation failed"
	rm -f ${D}/usr/share/locale/locale.alias
	dodoc ABOUT-NLS AUTHORS ChangeLog COPYING NEWS README* TODO
}