# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

DESCRIPTION="A second generation telephony application server"
HOMEPAGE="http://www.gnu.org/software/bayonne/bayonne.html"
SRC_URI="mirror://sourceforge/gnutelephony/${PF}.tar.gz"

inherit eutils

LICENSE="GPL2"
SLOT="0"
KEYWORDS="~x86"
IUSE="capi openh323 sip"

DEPEND="media-sound/ccaudio2 media-sound/ccscript3 dev-tex/latex2html
	capi? ( net-dialup/capi4k-utils )
	openh323? ( net-libs/openh323 )
	sip? ( net-libs/ccrtp )
	sip? ( <=net-libs/libeXosip-1.9.0 )"

# Can use voicetronix http://www.voicetronix.com
pkg_setup() {
	enewgroup bayonne
	enewuser bayonne -1 /bin/false /dev/null bayonne
}

pkg_preinst() {
	enewgroup bayonne
	enewuser bayonne -1 /bin/false /dev/null bayonne
}

src_compile() {
	econf	\
		$(use_enable openh323)					\
		$(use_enable openh323 openh323-codecs)	\
		--enable-voices
	mkdir docs/TMP
	emake || die "make failed"
}

src_install () {
	dodir /etc/init.d
	make DESTDIR=${D} install
	dodoc AUTHORS ChangeLog FAQ NEWS README THANKS TODO docs/*.pdf
	dohtml -r docs/*
}