summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Zacarias <gustavoz@gentoo.org>2006-11-27 14:36:00 +0000
committerGustavo Zacarias <gustavoz@gentoo.org>2006-11-27 14:36:00 +0000
commitf6ed6d849435c147d9697fd930d9e9e9e95f4942 (patch)
tree87ba40b92447aa7b90a14886d51c32d9efcbbb40 /net-misc
parentStable on sparc (diff)
downloadhistorical-f6ed6d849435c147d9697fd930d9e9e9e95f4942.tar.gz
historical-f6ed6d849435c147d9697fd930d9e9e9e95f4942.tar.bz2
historical-f6ed6d849435c147d9697fd930d9e9e9e95f4942.zip
Revbump with updated udev rules to avoid b0rkage with new stable udev
Package-Manager: portage-2.1.1-r2
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/zaptel/ChangeLog13
-rw-r--r--net-misc/zaptel/files/digest-zaptel-1.0.10-r24
-rw-r--r--net-misc/zaptel/files/digest-zaptel-1.2.11-r16
-rw-r--r--net-misc/zaptel/files/digest-zaptel-1.2.9.1-r16
-rw-r--r--net-misc/zaptel/files/zaptel.udevd10
-rw-r--r--net-misc/zaptel/zaptel-1.0.10-r2.ebuild263
-rw-r--r--net-misc/zaptel/zaptel-1.2.11-r1.ebuild369
-rw-r--r--net-misc/zaptel/zaptel-1.2.9.1-r1.ebuild352
8 files changed, 1017 insertions, 6 deletions
diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog
index f77f9e5f7cdb..6e7419460ba1 100644
--- a/net-misc/zaptel/ChangeLog
+++ b/net-misc/zaptel/ChangeLog
@@ -1,6 +1,17 @@
# 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.85 2006/11/19 16:50:09 drizzt Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.86 2006/11/27 14:36:00 gustavoz Exp $
+
+*zaptel-1.2.11-r1 (27 Nov 2006)
+*zaptel-1.2.9.1-r1 (27 Nov 2006)
+*zaptel-1.0.10-r2 (27 Nov 2006)
+
+ 27 Nov 2006; Gustavo Zacarias <gustavoz@gentoo.org>
+ -files/zaptel-1.2.10-gentoo.diff, files/zaptel.udevd,
+ -zaptel-1.0.10-r1.ebuild, +zaptel-1.0.10-r2.ebuild,
+ -zaptel-1.2.9.1.ebuild, +zaptel-1.2.9.1-r1.ebuild, -zaptel-1.2.10.ebuild,
+ -zaptel-1.2.11.ebuild, +zaptel-1.2.11-r1.ebuild:
+ Revbump with updated udev rules to avoid b0rkage with new stable udev
19 Nov 2006; Timothy Redaelli <drizzt@gentoo.org> zaptel-1.2.11.ebuild:
Applied a patch to make it compile on kernel 2.4, thanks to Nico Baggus for
diff --git a/net-misc/zaptel/files/digest-zaptel-1.0.10-r2 b/net-misc/zaptel/files/digest-zaptel-1.0.10-r2
new file mode 100644
index 000000000000..8827bef8bfa1
--- /dev/null
+++ b/net-misc/zaptel/files/digest-zaptel-1.0.10-r2
@@ -0,0 +1,4 @@
+RMD160 aaa9ca23eaeb74abc96dd7240f67e7886d4d6ad9 bristuff-0.2.0-RC8q.tar.gz 152037
+SHA256 8ba7a1e1e6ee8e9d77853d6d790d0de5deced7c11679b9b0e108cca817ed9728 bristuff-0.2.0-RC8q.tar.gz 152037
+RMD160 a797bb36f35e50c51d30705ad1d628f5728d87ed zaptel-1.0.10.tar.gz 327832
+SHA256 7978f3c56a95033bf2bc2cb8d0cb2830c5371aae21e0021503c6dbf2361795d1 zaptel-1.0.10.tar.gz 327832
diff --git a/net-misc/zaptel/files/digest-zaptel-1.2.11-r1 b/net-misc/zaptel/files/digest-zaptel-1.2.11-r1
new file mode 100644
index 000000000000..89ca9e75f152
--- /dev/null
+++ b/net-misc/zaptel/files/digest-zaptel-1.2.11-r1
@@ -0,0 +1,6 @@
+RMD160 5c5f034d29f4156351a495f40c9c4b176f65e06e bristuff-0.3.0-PRE-1v.tar.gz 267644
+SHA256 91254dd6c71b74a5990df622b523d06c2f0399c6e47630e5155392c1598fd39e bristuff-0.3.0-PRE-1v.tar.gz 267644
+RMD160 b95d2301402e1108bc480ce0e66e87e3062eccf8 zaphfc_0.3.0-PRE-1o_florz-12.diff.gz 10736
+SHA256 04a8dd22d581b5d28d46a589d695f6eb634bf2bf355347a637fe2d560a63528c zaphfc_0.3.0-PRE-1o_florz-12.diff.gz 10736
+RMD160 6ae43a2f5801dab17216912f976e67371d8e51d2 zaptel-1.2.11.tar.gz 1425625
+SHA256 3641c8ef684862b3cc9fd3c3341d25095909a9c2f901d31b7cc9394210cb50e8 zaptel-1.2.11.tar.gz 1425625
diff --git a/net-misc/zaptel/files/digest-zaptel-1.2.9.1-r1 b/net-misc/zaptel/files/digest-zaptel-1.2.9.1-r1
new file mode 100644
index 000000000000..9e151a944149
--- /dev/null
+++ b/net-misc/zaptel/files/digest-zaptel-1.2.9.1-r1
@@ -0,0 +1,6 @@
+RMD160 8d3abdbbae4c376d52225395c72f4538e1f84a94 bristuff-0.3.0-PRE-1s.tar.gz 265953
+SHA256 30adea4f070ed44d1952163e850c177f976857b96965e18844ccd492ccef968d bristuff-0.3.0-PRE-1s.tar.gz 265953
+RMD160 b95d2301402e1108bc480ce0e66e87e3062eccf8 zaphfc_0.3.0-PRE-1o_florz-12.diff.gz 10736
+SHA256 04a8dd22d581b5d28d46a589d695f6eb634bf2bf355347a637fe2d560a63528c zaphfc_0.3.0-PRE-1o_florz-12.diff.gz 10736
+RMD160 caf2ad931e2ae439500805a6ca4376dc8083de5a zaptel-1.2.9.1.tar.gz 1255412
+SHA256 7def44c259352397af2ad80f3c0eb103ff640ffbc7c95f37c3802fee75c10ede zaptel-1.2.9.1.tar.gz 1255412
diff --git a/net-misc/zaptel/files/zaptel.udevd b/net-misc/zaptel/files/zaptel.udevd
index 45ae7292ecb4..7121298256db 100644
--- a/net-misc/zaptel/files/zaptel.udevd
+++ b/net-misc/zaptel/files/zaptel.udevd
@@ -1,8 +1,8 @@
#
# udev rules for zaptel
#
-KERNEL="zapctl", NAME="zap/ctl", MODE="0660", GROUP="dialout"
-KERNEL="zaptimer", NAME="zap/timer", MODE="0660", GROUP="dialout"
-KERNEL="zapchannel", NAME="zap/channel", MODE="0660", GROUP="dialout"
-KERNEL="zappseudo", NAME="zap/pseudo", MODE="0660", GROUP="dialout"
-KERNEL="zap[0-9]*", NAME="zap/%n", MODE="0660", GROUP="dialout"
+KERNEL=="zapctl", NAME="zap/ctl", MODE="0660", GROUP="dialout"
+KERNEL=="zaptimer", NAME="zap/timer", MODE="0660", GROUP="dialout"
+KERNEL=="zapchannel", NAME="zap/channel", MODE="0660", GROUP="dialout"
+KERNEL=="zappseudo", NAME="zap/pseudo", MODE="0660", GROUP="dialout"
+KERNEL=="zap[0-9]*", NAME="zap/%n", MODE="0660", GROUP="dialout"
diff --git a/net-misc/zaptel/zaptel-1.0.10-r2.ebuild b/net-misc/zaptel/zaptel-1.0.10-r2.ebuild
new file mode 100644
index 000000000000..ea1490aa0dba
--- /dev/null
+++ b/net-misc/zaptel/zaptel-1.0.10-r2.ebuild
@@ -0,0 +1,263 @@
+# 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.0.10-r2.ebuild,v 1.1 2006/11/27 14:36:00 gustavoz Exp $
+
+IUSE="bri devfs26 rtc ukcid"
+
+inherit toolchain-funcs eutils linux-mod
+
+BRI_VERSION="0.2.0-RC8q"
+#FLORZ_VERSION="0.2.0-RC8o_florz-9"
+
+MY_PV="${PV/_p/.}"
+
+DESCRIPTION="Drivers for Digium and ZapataTelephony cards"
+HOMEPAGE="http://www.asterisk.org"
+SRC_URI="http://ftp1.digium.com/pub/telephony/zaptel/zaptel-${MY_PV}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
+# florz? ( http://zaphfc.florz.dyndns.org/zaphfc_${FLORZ_VERSION}.diff.gz )"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~ppc x86"
+
+DEPEND="virtual/libc
+ virtual/linux-sources
+ >=dev-libs/newt-0.50.0"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ # show an nice warning message about zaptel not supporting devfs on 2.6
+ if kernel_is 2 6 && linux_chkconfig_present DEVFS_FS ; then
+ echo
+ einfo "You're using a 2.6 kernel with DEVFS."
+ einfo "The Zaptel drivers won't work unless you either:"
+ einfo " * switch to udev"
+ einfo " * write a script that re-creates the necessary device nodes for you"
+ einfo " * enable the devfs26 useflag (see below)"
+ einfo ""
+ einfo "There's an experimental patch which adds devfs support when using linux-2.6, but:"
+ einfo " 1. It disables udev support to avoid conflicts"
+ ewarn " 2. It is not supported by Digium / the Asterisk project!"
+ einfo ""
+ einfo "If you're still interested, abort now (ctrl+c) and enable the devfs26 USE-flag"
+ einfo "Feedback and bug-reports should go to: stkn@gentoo.org"
+ einfo "You have been warned!"
+ echo
+ einfo "Sleeping 20 Seconds..."
+ epause 20
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ # patch makefile(s) for gentoo
+ epatch ${FILESDIR}/${PN}-1.0.10-gentoo.diff
+
+ # devfs support
+ if use devfs26; then
+ einfo "Enabling experimental devfs support for linux-2.6..."
+ epatch ${FILESDIR}/${PN}-1.0.10-devfs26.diff
+
+ # disable udev
+ sed -i -e "s:#define[\t ]\+\(CONFIG_ZAP_UDEV\):#undef \1:" \
+ zconfig.h
+ fi
+
+ # apply patch for gcc-3.4.x if that's the compiler in use...
+ # fixes (#76707)
+ if use x86 && [[ `gcc-fullversion` = "3.4.3" ]]; then
+ epatch ${FILESDIR}/${PN}-1.0.4-gcc34.patch
+ fi
+
+ # try to apply bristuff patch
+ if use bri; then
+ einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})"
+ epatch ${FILESDIR}/zaptel-bristuff-${BRI_VERSION}.patch
+
+ cd ${S_BRI}
+
+# if use florz; then
+# einfo "Using florz patches (${FLORZ_VERSION}) for zaphfc"
+# 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
+
+ # replace uname -r with $(KVERS)
+ # and add KVERS?="$(uname -r)" to all bristuff Makefiles
+ find ${S_BRI} -iname "Makefile" -exec sed -i \
+ -e "s:\`uname -r\`:\$(KVERS):g" \
+ -e "s:uname -r:echo -n \$(KVERS):g" \
+ -e "1 i KVERS?=\$(shell uname -r)" {} \;
+ fi
+
+
+ cd ${S}
+ #######################################################################
+ # apply other patches here,
+ # make sure they work with things that have been added before!
+ #
+
+ # apply x86 rtc patch for ztdummy (http://bugs.digium.com/view.php?id=4301)
+ # this won't have any effect on non-x86 systems...
+ if use rtc; then
+ if use x86 || use amd64; then
+ epatch ${FILESDIR}/${PN}-1.0.9-rtc.patch
+ else
+ ewarn "RTC is unsupported on your arch, skipping patch"
+ fi
+ fi
+
+
+ # UK callerid patch, adds support for british-telecoms callerid to x100p cards
+ # see http://www.lusyn.com/asterisk/patches.html for more information
+ use ukcid && \
+ epatch ${FILESDIR}/${PN}-1.0.10-ukcid.patch
+
+ # buy some time to get 1.2 into shape,
+ # fix 2.6.16 compile errors and CONFIG_ZAPATA_DEBUG undefined warnings
+ epatch ${FILESDIR}/zaptel-1.0.10-linux2.6.16.diff
+ epatch ${FILESDIR}/zaptel-1.0.10-fix-zapata-debug-undefined-warnings.diff
+}
+
+src_compile() {
+ make \
+ KVERS=${KV_FULL} ARCH=$(tc-arch-kernel) \
+ KERNEL_SOURCE=/usr/src/linux || die
+
+ if use bri; then
+ cd ${S_BRI}
+ for x in cwain qozap zaphfc; do
+ make \
+ KVERS=${KV_FULL} \
+ ARCH=$(tc-arch-kernel) \
+ KERNEL_SOURCE=/usr/src/linux \
+ -C ${x} || die "make ${x} failed"
+ done
+ fi
+}
+
+src_install() {
+ make INSTALL_PREFIX=${D} ARCH=$(tc-arch-kernel) \
+ KVERS=${KV_FULL} KERNEL_SOURCE=/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 for 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
+ 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 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
+}
diff --git a/net-misc/zaptel/zaptel-1.2.11-r1.ebuild b/net-misc/zaptel/zaptel-1.2.11-r1.ebuild
new file mode 100644
index 000000000000..e8d47a8ffcc9
--- /dev/null
+++ b/net-misc/zaptel/zaptel-1.2.11-r1.ebuild
@@ -0,0 +1,369 @@
+# 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.11-r1.ebuild,v 1.1 2006/11/27 14:36:00 gustavoz Exp $
+
+inherit toolchain-funcs eutils linux-mod
+
+## NOTE:
+#
+#
+
+BRI_VERSION="0.3.0-PRE-1v"
+FLORZ_VERSION="0.3.0-PRE-1o_florz-12"
+
+IUSE="bri 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/releases/${MY_P}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )
+ florz? ( http://www.netdomination.org/pub/asterisk/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 kernel_is 2 4 ; then
+ if ! linux_chkconfig_present CRC32; then
+ echo
+ eerror "Your kernel lacks CRC32 support!"
+ eerror "Enable CONFIG_CRC32!"
+ result=$((result+1))
+ fi
+ else
+ if ! linux_chkconfig_present CRC_CCITT; then
+ echo
+ eerror "Your kernel lacks CRC_CCIT support!"
+ eerror "Enable CONFIG_CRC_CCIT!"
+ result=$((result+1))
+ fi
+ 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}/${P}-gentoo.diff
+ epatch ${FILESDIR}/zaptel-1.2.9.1-gcc411_is_a_retard-kbuild.patch
+ epatch ${FILESDIR}/zaptel-1.2.9.1-ar.patch
+
+ 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\.5:zaptel-1.2.6: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=${KV_DIR} ARCH=$(tc-arch-kernel) || die
+
+ cd ${S}/xpp/utils
+ make || die "make xpp utils failed"
+
+ 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() {
+ kernel_is 2 4 && cp /etc/modules.conf ${D}/etc
+ 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 README.fxotune
+
+ # additional tools
+ dobin ztmonitor ztspeed zttest fxotune
+
+ # 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
+
+ # install xpp utils
+ cd ${S}/xpp/utils
+ make DESTDIR=${D} install || die "failed xpp utils install"
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ 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
+}
diff --git a/net-misc/zaptel/zaptel-1.2.9.1-r1.ebuild b/net-misc/zaptel/zaptel-1.2.9.1-r1.ebuild
new file mode 100644
index 000000000000..9ac55073aea5
--- /dev/null
+++ b/net-misc/zaptel/zaptel-1.2.9.1-r1.ebuild
@@ -0,0 +1,352 @@
+# 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.9.1-r1.ebuild,v 1.1 2006/11/27 14:36:00 gustavoz Exp $
+
+inherit toolchain-funcs eutils linux-mod
+
+## NOTE:
+#
+#
+
+BRI_VERSION="0.3.0-PRE-1s"
+FLORZ_VERSION="0.3.0-PRE-1o_florz-12"
+
+IUSE="bri 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/releases/${MY_P}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )
+ florz? ( http://www.netdomination.org/pub/asterisk/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}/${P}-gentoo.diff
+ epatch ${FILESDIR}/zaptel-1.2.9.1-gcc411_is_a_retard-kbuild.patch
+ epatch ${FILESDIR}/zaptel-1.2.9.1-ar.patch
+
+ 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\.5:zaptel-1.2.6: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=${KV_DIR} 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
+
+ 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
+}