# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils linux-info DESCRIPTION="A CAPI 2.0 channel module for Asterisk" HOMEPAGE="http://www.junghanns.net/asterisk/page1.html" SRC_URI="http://www.junghanns.net/asterisk/downloads/chan_capi.0.3.5.tar.gz" S="${WORKDIR}/chan_capi-${PV}" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86" DEPEND="net-misc/asterisk net-dialup/capi4k-utils" # Note: if you ever want to use isdn4k enable the CONFIG_AVM? option # in the config file which will build the AVM driver and in turn the # CAPI library and headers. This works for sure with the following # version, but compile fails with other versions currently in the tree. # =net-dialup/isdn4k-utils-3.5_pre20041110-r4" pkg_setup() { linux-info_pkg_setup # check that kernel supports CAPI 2 if ! linux_chkconfig_present ISDN_CAPI_CAPI20 ; then einfo "Sorry, your kernel doesn't support CAPI 2.0" einfo "Rebuild your kernel to enable CONFIG_ISDN_CAPI_CAPI20," einfo "reboot, and re-emerge" die fi } src_unpack() { unpack ${A} cd ${S} epatch ${FILESDIR}/chan_capi-${PV}-gentoo.diff } src_compile() { emake || die "Make failed" } src_install() { insinto /usr/lib/asterisk/modules emake DESTDIR=${D} install || die "Make install failed" insinto /etc/asterisk emake DESTDIR=${D} config || die "Make config failed" } pkg_postinst() { einfo "Please configure Asterisk as following:" einfo "" einfo " In /etc/asterisk/modules.conf insert the line:" einfo "" einfo " load => chan_capi.so" einfo "" einfo " And in the [global] section:" einfo "" einfo " chan_capi.so=yes" }