diff options
author | Stefan Knoblich <stkn@gentoo.org> | 2006-02-02 01:14:58 +0000 |
---|---|---|
committer | Stefan Knoblich <stkn@gentoo.org> | 2006-02-02 01:14:58 +0000 |
commit | 6ff9e4fa3344f8ef3972fb30fef5815008c72d54 (patch) | |
tree | 78734c1fd3113469427478c878baedd1659e2428 /net-misc/zaptel | |
parent | Fixing bug #121153 (diff) | |
download | gentoo-2-6ff9e4fa3344f8ef3972fb30fef5815008c72d54.tar.gz gentoo-2-6ff9e4fa3344f8ef3972fb30fef5815008c72d54.tar.bz2 gentoo-2-6ff9e4fa3344f8ef3972fb30fef5815008c72d54.zip |
Version bump
(Portage version: 2.0.53)
Diffstat (limited to 'net-misc/zaptel')
-rw-r--r-- | net-misc/zaptel/ChangeLog | 8 | ||||
-rw-r--r-- | net-misc/zaptel/Manifest | 5 | ||||
-rw-r--r-- | net-misc/zaptel/files/digest-zaptel-1.2.3 | 3 | ||||
-rw-r--r-- | net-misc/zaptel/files/zaptel-1.2.2-gentoo.diff | 166 | ||||
-rw-r--r-- | net-misc/zaptel/zaptel-1.2.3.ebuild | 375 |
5 files changed, 555 insertions, 2 deletions
diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog index df9730261d94..a9564dd0fe83 100644 --- a/net-misc/zaptel/ChangeLog +++ b/net-misc/zaptel/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/zaptel # Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.69 2006/01/23 15:14:57 stkn Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.70 2006/02/02 01:14:58 stkn Exp $ + +*zaptel-1.2.3 (02 Feb 2006) + + 02 Feb 2006; Stefan Knoblich <stkn@gentoo.org> + +files/zaptel-1.2.2-gentoo.diff, +zaptel-1.2.3.ebuild: + Version bump. 23 Jan 2006; Stefan Knoblich <stkn@gentoo.org> zaptel-1.2.0.ebuild, zaptel-1.2.1.ebuild: diff --git a/net-misc/zaptel/Manifest b/net-misc/zaptel/Manifest index a76f7f627606..02893e6c723d 100644 --- a/net-misc/zaptel/Manifest +++ b/net-misc/zaptel/Manifest @@ -1,4 +1,4 @@ -MD5 5b6dae9148e7b640751f1a2862159185 ChangeLog 13053 +MD5 6c8c902a2e9755b7460789343bfad2fc ChangeLog 13205 MD5 5d92c84f7e556e1552efc5531483a727 files/digest-zaptel-1.0.10 136 MD5 051e2ff3f1222e2b551a70e9cd1b31f0 files/digest-zaptel-1.0.4-r1 64 MD5 0c81001d4c9efeeffeb1332580fb4cdc files/digest-zaptel-1.0.6-r1 212 @@ -8,6 +8,7 @@ MD5 3a4f554056143ac54f033cc3356821b5 files/digest-zaptel-1.0.9_p1-r1 214 MD5 69d0c3831715ccac6422b13a99fc6557 files/digest-zaptel-1.0.9_p2 214 MD5 f574df759efe80013bc3e7fa04d95232 files/digest-zaptel-1.2.0 136 MD5 a43d347e67130e0ab4f15e17b34c8ba0 files/digest-zaptel-1.2.1 216 +MD5 cd2c0020b56060f6ba55d0b9a2d04a00 files/digest-zaptel-1.2.3 217 MD5 24ffa9ff867ef807083a53f61465fe02 files/zaptel-1.0.10-devfs26.diff 6026 MD5 64804093a66dad967c34de55d3f0633a files/zaptel-1.0.10-gentoo.diff 5489 MD5 699723eb0b0ad059702af4fc4de7bf95 files/zaptel-1.0.10-ukcid.patch 3787 @@ -23,6 +24,7 @@ MD5 c0f95d699055c3b46e5d3078bfaa2afb files/zaptel-1.2.0-devfs26.diff 6046 MD5 e6c7407f2478a1836a087eec78ecd69d files/zaptel-1.2.0-gentoo.diff 4626 MD5 699723eb0b0ad059702af4fc4de7bf95 files/zaptel-1.2.0-ukcid.patch 3787 MD5 bc9d66166d440e69b69286ef26b4c52d files/zaptel-1.2.1-gentoo.diff 4756 +MD5 51c21f33dde21f00000ccf671ac0ebff files/zaptel-1.2.2-gentoo.diff 7740 MD5 74863c2b19f217f2f23daa1cd617c4f9 files/zaptel-bristuff-0.2.0-RC7k.patch 6065 MD5 cce31b4380f9c62e91293dff1523d5e0 files/zaptel-bristuff-0.2.0-RC8g.patch 5551 MD5 d893c36bffff825ab0e6d48e1ad0acea files/zaptel-bristuff-0.2.0-RC8h.patch 6064 @@ -43,3 +45,4 @@ MD5 a9b97edfc9559f48e71f9f232590143f zaptel-1.0.9_p1-r1.ebuild 6641 MD5 f0c8a8a514efa543a36618d72d4ade3d zaptel-1.0.9_p2.ebuild 6641 MD5 a170d2a6dba63bc4de86eb9766c8d8f3 zaptel-1.2.0.ebuild 9102 MD5 5f7d588d0581d344b87cc078bf54af1f zaptel-1.2.1.ebuild 9125 +MD5 f1c2b20f20b0c0d87bafb368ac9603ac zaptel-1.2.3.ebuild 9247 diff --git a/net-misc/zaptel/files/digest-zaptel-1.2.3 b/net-misc/zaptel/files/digest-zaptel-1.2.3 new file mode 100644 index 000000000000..e88f6c542c35 --- /dev/null +++ b/net-misc/zaptel/files/digest-zaptel-1.2.3 @@ -0,0 +1,3 @@ +MD5 99f82076904be0325029f6f71357eeba bristuff-0.3.0-PRE-1h.tar.gz 207158 +MD5 88160b95c990e8bc92e7d0a755df6792 zaphfc_0.3.0-PRE-1f_florz-11.diff.gz 10563 +MD5 9bcb705458f9b20a9644310298a9cd4d zaptel-1.2.3.tar.gz 619706 diff --git a/net-misc/zaptel/files/zaptel-1.2.2-gentoo.diff b/net-misc/zaptel/files/zaptel-1.2.2-gentoo.diff new file mode 100644 index 000000000000..960e98bcc328 --- /dev/null +++ b/net-misc/zaptel/files/zaptel-1.2.2-gentoo.diff @@ -0,0 +1,166 @@ +--- zaptel-1.2.2/Makefile.orig 2006-01-19 00:04:48.000000000 +0100 ++++ zaptel-1.2.2/Makefile 2006-01-19 00:09:24.000000000 +0100 +@@ -21,7 +21,7 @@ + endif + KINCLUDES:=$(KSRC)/include + +-CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER ++CFLAGS+=-I. -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER + CFLAGS_PPC:=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) + CFLAGS_X86-64:=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi) + CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_X86-64) +@@ -55,31 +55,7 @@ + BUILDVER:=linux24 + endif + +-ifeq ($(BUILDVER),linux26) +- ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modprobe.d)) +- MODCONF:=$(ROOT_PREFIX)/etc/modprobe.d/zaptel +- else +- ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.d)) +- MODCONF:=$(ROOT_PREFIX)/etc/modules.d/zaptel +- else +- ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modprobe.conf)) +- MODCONF:=$(ROOT_PREFIX)/etc/modprobe.conf +- else +- ifneq (,$(wildcard $(ROOT_PREFIX)/etc/conf.modules)) +- MODCONF:=$(ROOT_PREFIX)/etc/conf.modules +- endif +- endif +- endif +- endif +-else # BUILDVER == linux24 +- ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modutils)) +- MODCONF:=$(ROOT_PREFIX)/etc/modutils/zaptel +- else +- ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.conf)) +- MODCONF:=$(ROOT_PREFIX)/etc/modules.conf +- endif +- endif +-endif ++MODCONF:=$(INSTALL_PREFIX)/etc/modules.d/zaptel + + ifeq (${BUILDVER},linux24) + #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4 +@@ -87,8 +63,8 @@ + endif + + ifeq (${BUILDVER},linux26) ++ DYNFS:=$(shell ps ax | grep -v grep | grep -q "devfsd\|udevd" && echo "yes") + ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d)) +- DYNFS=yes + UDEVRULES=yes + ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/permissions.d)) + UDEVPERMISSIONS=yes +@@ -328,17 +304,17 @@ + else # DYNFS + ifdef UDEVRULES + ifdef UDEVPERMISSIONS +- install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d +- install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d ++ install -D -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules ++ install -D -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d/10-zaptel.permissions + else # !UDEVPERMISSIONS (newer, combined syntax) +- install -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules ++ install -D -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules + endif + else # !UDEVRULES + @echo "**** Dynamic filesystem detected -- not creating device nodes" + endif + endif + +-install: all devices ++install: devices + install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg + if [ -f sethdlc-new ]; then \ + install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \ +@@ -365,42 +341,25 @@ + rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o; \ + fi + install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) +- [ `id -u` = 0 ] && /sbin/ldconfig || : ++ [ `id -u` = 0 ] && /sbin/ldconfig -n $(INSTALL_PREFIX)/usr/lib || : + rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) + ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ + $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER) + ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \ + $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO) +- if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi + install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h + install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h + install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h +- install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8 +- install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8 ++ install -D -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8/ztcfg.8 ++ install -D -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8/zttool.8 ++ if [ ! -d `dirname $(MODCONF)` ]; then install -d -m 755 `dirname $(MODCONF)` ; fi + if [ -n "$(MODCONF)" ]; then \ +- if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi; \ +- cat $(MODCONF).bak | grep -v "alias char-major-250" | \ +- grep -v "post-install torisa /sbin/ztcfg" | \ +- grep -v "post-install wcfxsusb /sbin/ztcfg" | \ +- grep -v "alias wctdm" | \ +- grep -v "post-install wctdm /sbin/ztcfg" > $(MODCONF); \ + if ! grep "options torisa" $(MODCONF); then \ + echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \ + fi; \ + if ! grep "alias char-major-196" $(MODCONF); then \ + echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \ + fi; \ +- for x in $(MODULES); do \ +- if ! grep -q "post-install $$x" $(MODCONF); then \ +- if ! grep -q "install $$x " $(MODCONF); then \ +- if [ "$$x" != "zaptel" ] ; then \ +- if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /sbin/ztcfg" >> $(MODCONF); \ +- else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \ +- fi; \ +- fi; \ +- fi; \ +- fi; \ +- done; \ + if ! grep "ias wcfxs" $(MODCONF); then \ + echo "alias wcfxs wctdm" >> $(MODCONF); \ + fi; \ +@@ -408,19 +367,15 @@ + echo "alias wct2xxp wct4xxp" >> $(MODCONF); \ + fi; \ + fi +- if [ -d /etc/modutils ]; then \ +- /sbin/update-modules ; \ +- fi +- [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : + [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE) + + install-udev: + ifdef UDEVRULES + ifdef UDEVPERMISSIONS +- install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d +- install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d ++ install -D -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules ++ install -D -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d/10-zaptel.permissions + else # !UDEVPERMISSIONS (newer, combined syntax) +- install -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules ++ install -D -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/10-zaptel.rules + endif + endif + +--- zaptel-1.2.2/udev/zaptel.permissions.orig 2006-01-19 00:11:04.000000000 +0100 ++++ zaptel-1.2.2/udev/zaptel.permissions 2006-01-19 00:11:17.000000000 +0100 +@@ -1,2 +1,2 @@ + # zaptel devices -- for running asterisk as non-root +-zap/*:asterisk:asterisk:660 ++zap/*:root:dialout:660 +--- zaptel-1.2.2/udev/zaptel.rules-combined.orig 2006-01-19 00:11:25.000000000 +0100 ++++ zaptel-1.2.2/udev/zaptel.rules-combined 2006-01-19 00:12:12.000000000 +0100 +@@ -1,6 +1,6 @@ + # zaptel devices with ownership/permissions for running as non-root +-KERNEL="zapctl", NAME="zap/ctl", OWNER="asterisk", GROUP="asterisk", MODE="0660" +-KERNEL="zaptimer", NAME="zap/timer", OWNER="asterisk", GROUP="asterisk", MODE="0660" +-KERNEL="zapchannel", NAME="zap/channel", OWNER="asterisk", GROUP="asterisk", MODE="0660" +-KERNEL="zappseudo", NAME="zap/pseudo", OWNER="asterisk", GROUP="asterisk", MODE="0660" +-KERNEL="zap[0-9]*", NAME="zap/%n", OWNER="asterisk", GROUP="asterisk", MODE="0660" ++KERNEL="zapctl", NAME="zap/ctl", OWNER="root", GROUP="dialout", MODE="0660" ++KERNEL="zaptimer", NAME="zap/timer", OWNER="root", GROUP="dialout", MODE="0660" ++KERNEL="zapchannel", NAME="zap/channel", OWNER="root", GROUP="dialout", MODE="0660" ++KERNEL="zappseudo", NAME="zap/pseudo", OWNER="root", GROUP="dialout", MODE="0660" ++KERNEL="zap[0-9]*", NAME="zap/%n", OWNER="root", GROUP="dialout", MODE="0660" diff --git a/net-misc/zaptel/zaptel-1.2.3.ebuild b/net-misc/zaptel/zaptel-1.2.3.ebuild new file mode 100644 index 000000000000..1b61e5111338 --- /dev/null +++ b/net-misc/zaptel/zaptel-1.2.3.ebuild @@ -0,0 +1,375 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.2.3.ebuild,v 1.1 2006/02/02 01:14:58 stkn Exp $ + +inherit toolchain-funcs eutils linux-mod + +## TODO: +# +# - cleanup (work-in-progress) +# - testing of new features (zapras / -net) +# + +BRI_VERSION="0.3.0-PRE-1h" +FLORZ_VERSION="0.3.0-PRE-1f_florz-11" + +IUSE="bri devfs26 ecmark ecmark2 ecmark3 ecaggressive eckb1 ecmg2 ecsteve ecsteve2 florz rtc ukcid watchdog zapras zapnet" + +MY_P="${P/_/-}" + +DESCRIPTION="Drivers for Digium and ZapataTelephony cards" +HOMEPAGE="http://www.asterisk.org" +SRC_URI="http://ftp.digium.com/pub/zaptel/${MY_P}.tar.gz + bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz ) + florz? ( http://zaphfc.florz.dyndns.org/zaphfc_${FLORZ_VERSION}.diff.gz )" + +S="${WORKDIR}/${MY_P}" +S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~amd64 ~ppc ~x86" + +DEPEND="virtual/libc + virtual/linux-sources + >=dev-libs/newt-0.50.0" + +# list of echo canceller use flags, +# first active in this list is selected (=order does matter) +ZAP_EC_FLAGS="ecmark ecmark2 ecmark3 ecsteve ecsteve2 eckb1 ecmg2" + +### Begin: Helper functions + +select_echo_cancel() { + local myEC="" + + for x in ${ZAP_EC_FLAGS}; do + if use $x; then + myEC=$(echo "$x" | sed -e "s:^ec::" | tr '[:lower:]' '[:upper:]') + break; + fi + done + + echo ${myEC} +} + +zconfig_disable() { + if grep -q "${1}" ${S}/zconfig.h; then + # match a little more than ${1} so we can use zconfig_disable + # to disable all echo cancellers in zconfig.h w/o calling it several times + sed -i -e "s:^[ \t]*#define[ \t]\+\(${1}[a-zA-Z0-9_-]*\).*:#undef \1:" \ + ${S}/zconfig.h + fi + + return $? +} + +zconfig_enable() { + if grep -q "${1}" ${S}/zconfig.h; then + sed -i -e "s:^/\*[ \t]*#define[ \t]\+\(${1}\).*:#define \1:" \ + -e "s:^[ \t]*#undef[ \t]\+\(${1}\).*:#define \1:" \ + ${S}/zconfig.h + fi + + return $? +} + +### End: Helper functions + +pkg_setup() { + local result=0 numec=0 + + linux-mod_pkg_setup + + einfo "Running pre-flight checks..." + + # basic zaptel checks + if ! linux_chkconfig_present CRC_CCITT; then + echo + eerror "Your kernel lacks CRC_CCIT support!" + eerror "Enable CONFIG_CRC_CCIT!" + result=$((result+1)) + fi + + # check if multiple echo cancellers have been selected + for x in ${ZAP_EC_FLAGS}; do + use $x && numec=$((numec+1)) + done + if [[ $numec -gt 1 ]]; then + # multiple flags are active, only the first in the ZAP_EC_FLAGS list + # will be used, make sure the user knows about this + echo + ewarn "Multiple echo canceller flags are active but only one will be used!" + ewarn "Selected: $(select_echo_cancel)" + fi + + # we need at least HDLC generic support + if use zapnet && ! linux_chkconfig_present HDLC; then + echo + eerror "zapnet: Your kernel lacks HDLC support!" + eerror "zapnet: Enable CONFIG_HDLC* to use zaptel network support!" + result=$((result+1)) + fi + + # zapras needs PPP support + if use zapras && ! linux_chkconfig_present PPP; then + echo + eerror "zapras: Your kernel lacks PPP support!" + eerror "zapras: Enable CONFIG_PPP* to use zaptel ras support!" + result=$((result+1)) + fi + + # rtc needs linux-2.6 and CONFIG_RTC + if use rtc; then + if ! kernel_is 2 6; then + echo + eerror "rtc: >=Linux-2.6.0 is needed for rtc support!" + result=$((result+1)) + fi + + if ! linux_chkconfig_present RTC; then + eerror "rtc: Your kernel lacks RealTime-Clock support!" + result=$((result+1)) + fi + fi + + if [[ $result -gt 0 ]]; then + echo + ewarn "One or more of the neccessary precondition(s) is/are not met!" + ewarn "Look at the messages above, resolve the problem (or disable the use-flag) and try again" + echo + + if [[ $result -lt 3 ]]; then + eerror "[$result Error(s)] Zaptel is not happy :(" + else + eerror "[$result Error(s)] You're making zaptel cry :'(" + fi + die "[$result] Precondition(s) not met" + fi + + echo + einfo "Zaptel is happy and continues... :)" +} + +src_unpack() { + unpack ${A} + + cd ${S} + epatch ${FILESDIR}/${PN}-1.2.2-gentoo.diff + + if kernel_is 2 6 && use devfs26; then + if [[ ${KV_PATCH} -ge 14 ]]; then + eerror "Devfs has been removed in linux-2.6.14, skipping devfs26!" + else + epatch ${FILESDIR}/${PN}-1.2.0-devfs26.diff + + # fix Makefile to not create device nodes for + # devfs enabled 2.6 kernels + sed -i -e 's:grep -q udevd:grep -q \"udevd\\|devfsd\":' \ + Makefile + + # disable udev support on devfs26 systems + zconfig_disable CONFIG_ZAP_UDEV + fi + fi + + use ukcid && \ + epatch ${FILESDIR}/${PN}-1.2.0-ukcid.patch + + # try to apply bristuff patch + if use bri; then + # fix for userpriv + chmod -R a=rwX ${S_BRI} + + einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})" + epatch ${S_BRI}/patches/zaptel.patch + + cd ${S_BRI} + + if use florz; then + einfo "Using florz patches (${FLORZ_VERSION}) for zaphfc" + + # remove as soon as there's a new florz patch available + sed -i -e "s:zaptel-1\.2\.1:zaptel-1.2.2:g" \ + ${WORKDIR}/zaphfc_${FLORZ_VERSION}.diff + + epatch ${WORKDIR}/zaphfc_${FLORZ_VERSION}.diff + fi + + # patch includes + sed -i -e "s:^#include.*zaptel\.h.*:#include <zaptel.h>:" \ + qozap/qozap.c \ + zaphfc/zaphfc.c \ + cwain/cwain.c + + # patch makefiles + sed -i -e "s:^ZAP[\t ]*=.*:ZAP=-I${S}:" \ + -e "s:^MODCONF=.*:MODCONF=/etc/modules.d/zaptel:" \ + -e "s:linux-2.6:linux:g" \ + qozap/Makefile \ + zaphfc/Makefile \ + cwain/Makefile + + sed -i -e "s:^\(CFLAGS+=-I. \).*:\1 \$(ZAP):" \ + zaphfc/Makefile + + cd ${S} + fi + +### Configuration changes + local myEC + + # prepare zconfig.h + myEC=$(select_echo_cancel) + if [[ -n "${myEC}" ]]; then + einfo "Selected echo canceller: ${myEC}" + # disable default first, set new selected ec afterwards + zconfig_disable ECHO_CAN + zconfig_enable ECHO_CAN_${myEC} + fi + + # enable rtc support on 2.6 + if use rtc && linux_chkconfig_present RTC && kernel_is 2 6; then + einfo "Enabling ztdummy RTC support" + zconfig_enable USE_RTC + fi + + # enable agressive echo surpression + use ecaggressive && \ + zconfig_enable AGGRESSIVE_SUPPRESSOR + + # ppp ras support + use zapras && \ + zconfig_enable CONFIG_ZAPATA_PPP + + # frame relay, syncppp... + use zapnet && \ + zconfig_enable CONFIG_ZAPATA_NET + + # zaptel watchdog + use watchdog && \ + zconfig_enable CONFIG_ZAPTEL_WATCHDOG +} + +src_compile() { + # build + make KVERS=${KV_FULL} \ + KSRC=/usr/src/linux ARCH=$(tc-arch-kernel) || die + + if use bri; then + cd ${S_BRI} + for x in cwain qozap zaphfc; do + einfo "Building ${x}..." + make KVERS=${KV_FULL} \ + KSRC=/usr/src/linux \ + ARCH=$(tc-arch-kernel) \ + -C ${x} || die "make ${x} failed" + done + fi +} + +src_install() { + make INSTALL_PREFIX=${D} ARCH=$(tc-arch-kernel) \ + KVERS=${KV_FULL} KSRC=/usr/src/linux install || die + + dodoc ChangeLog README README.udev README.Linux26 README.fxsusb zaptel.init + dodoc zaptel.conf.sample LICENSE zaptel.sysconfig + + # additional tools + dobin ztmonitor ztspeed zttest + + # install all header files, several packages need the complete set + # (e.g. sangoma wanpipe) + insinto /usr/include/zaptel + doins *.h + + if use bri; then + einfo "Installing bri" + cd ${S_BRI} + + insinto /lib/modules/${KV_FULL}/misc + doins qozap/qozap.${KV_OBJ} + doins zaphfc/zaphfc.${KV_OBJ} + doins cwain/cwain.${KV_OBJ} + + # install example configs for octoBRI and quadBRI + insinto /etc + doins qozap/zaptel.conf.octoBRI + newins qozap/zaptel.conf zaptel.conf.quadBRI + newins zaphfc/zaptel.conf zaptel.conf.zaphfc + + insinto /etc/asterisk + doins qozap/zapata.conf.octoBRI + newins qozap/zapata.conf zapata.conf.quadBRI + newins zaphfc/zapata.conf zapata.conf.zaphfc + + docinto bristuff + dodoc CHANGES INSTALL + + docinto bristuff/qozap + dodoc qozap/LICENSE qozap/TODO qozap/*.conf* + + docinto bristuff/zaphfc + dodoc zaphfc/LICENSE zaphfc/*.conf + + docinto bristuff/cwain + dodoc cwain/TODO cwain/LICENSE + + cd ${S} + fi + + # install init script + newinitd ${FILESDIR}/zaptel.rc6 zaptel + newconfd ${FILESDIR}/zaptel.confd zaptel + + # install devfsd rule file + insinto /etc/devfs.d + newins ${FILESDIR}/zaptel.devfsd zaptel + + # install udev rule file + insinto /etc/udev/rules.d + newins ${FILESDIR}/zaptel.udevd 10-zaptel.rules + + # fix permissions if there's no udev / devfs around + if [[ -d ${D}/dev/zap ]]; then + chown -R root:dialout ${D}/dev/zap + chmod -R u=rwX,g=rwX,o= ${D}/dev/zap + fi +} + +pkg_postinst() { + linux-mod_pkg_postinst + + if kernel_is 2 6 && [[ ${KV_PATCH} -lt 14 ]] && use devfs26; then + ewarn "*** Warning! ***" + ewarn "Devfs support for linux-2.6 is experimental and not" + ewarn "supported by digium or the asterisk project!" + echo + ewarn "Send bug-reports to: stkn@gentoo.org" + fi + + echo + einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!" + echo + + if use bri; then + einfo "Bristuff configs have been merged as:" + einfo "" + einfo "${ROOT}etc/" + einfo " zaptel.conf.zaphfc" + einfo " zaptel.conf.quadBRI" + einfo " zaptel.conf.octoBRI" + einfo "" + einfo "${ROOT}etc/asterisk/" + einfo " zapata.conf.zaphfc" + einfo " zapata.conf.quadBRI" + einfo " zapata.conf.octoBRI" + echo + fi + + # fix permissions if there's no udev / devfs around + if [[ -d ${ROOT}dev/zap ]]; then + chown -R root:dialout ${ROOT}dev/zap + chmod -R u=rwX,g=rwX,o= ${ROOT}dev/zap + fi +} |