summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Knoblich <stkn@gentoo.org>2004-05-10 01:18:13 +0000
committerStefan Knoblich <stkn@gentoo.org>2004-05-10 01:18:13 +0000
commit00d5043e3b3d6fc616d536069e6e355494e14a15 (patch)
tree4a7717e4641d747833e22ca89ede57e1406b7595 /net-misc
parentStable on sparc wrt bug #49387. (Manifest recommit) (diff)
downloadgentoo-2-00d5043e3b3d6fc616d536069e6e355494e14a15.tar.gz
gentoo-2-00d5043e3b3d6fc616d536069e6e355494e14a15.tar.bz2
gentoo-2-00d5043e3b3d6fc616d536069e6e355494e14a15.zip
new version
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/zaptel/ChangeLog9
-rw-r--r--net-misc/zaptel/files/digest-zaptel-0.9.11
-rw-r--r--net-misc/zaptel/files/zaptel-0.9.1-experimental-devfs26.diff221
-rw-r--r--net-misc/zaptel/files/zaptel-0.9.1-modulesd.diff43
-rw-r--r--net-misc/zaptel/files/zaptel.confd13
-rw-r--r--net-misc/zaptel/files/zaptel.rc651
-rw-r--r--net-misc/zaptel/zaptel-0.9.1.ebuild125
7 files changed, 462 insertions, 1 deletions
diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog
index 971d37eb03db..8ce2ec496c78 100644
--- a/net-misc/zaptel/ChangeLog
+++ b/net-misc/zaptel/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/zaptel
# Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.6 2004/04/27 21:56:21 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.7 2004/05/10 01:18:13 stkn Exp $
+
+*zaptel-0.9.1 (10 May 2004)
+
+ 10 May 2004; Stefan Knoblich <stkn@gentoo.org> zaptel-0.9.1.ebuild,
+ files/zaptel-0.9.1-experimental-devfs26.diff,
+ files/zaptel-0.9.1-modulesd.diff:
+ version bump.
27 Apr 2004; Aron Griffis <agriffis@gentoo.org> zaptel-0.7.0.ebuild,
zaptel-0.8.1.ebuild:
diff --git a/net-misc/zaptel/files/digest-zaptel-0.9.1 b/net-misc/zaptel/files/digest-zaptel-0.9.1
new file mode 100644
index 000000000000..cb250fd5c37d
--- /dev/null
+++ b/net-misc/zaptel/files/digest-zaptel-0.9.1
@@ -0,0 +1 @@
+MD5 8833bdaf0670b4b5f48e4823887be8d5 zaptel-0.9.1.tar.gz 291865
diff --git a/net-misc/zaptel/files/zaptel-0.9.1-experimental-devfs26.diff b/net-misc/zaptel/files/zaptel-0.9.1-experimental-devfs26.diff
new file mode 100644
index 000000000000..62db79720ad8
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel-0.9.1-experimental-devfs26.diff
@@ -0,0 +1,221 @@
+diff -Naurp -x .svn zaptel-0.9.1/zaptel.c zaptel-0.9.1-devfs26/zaptel.c
+--- zaptel-0.9.1/zaptel.c 2004-04-09 19:55:31.000000000 +0200
++++ zaptel-0.9.1-devfs26/zaptel.c 2004-05-04 23:17:44.243915848 +0200
+@@ -137,12 +137,14 @@ static struct proc_dir_entry *proc_entri
+
+ /* Here are a couple important little additions for devfs */
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ static devfs_handle_t zaptel_devfs_dir;
+ static devfs_handle_t channel;
+ static devfs_handle_t pseudo;
+ static devfs_handle_t ctl;
+ static devfs_handle_t timer;
+ #endif
++#endif
+ /* There is a table like this in the PPP driver, too */
+
+ static int deftaps = 64;
+@@ -1062,6 +1064,7 @@ static void zt_set_law(struct zt_chan *c
+ }
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ static devfs_handle_t register_devfs_channel(struct zt_chan *chan, devfs_handle_t dir)
+ {
+ char path[100];
+@@ -1104,6 +1107,28 @@ static devfs_handle_t register_devfs_cha
+
+ return chan_dev;
+ }
++#else
++static dev_t register_devfs_channel(struct zt_chan *chan, dev_t dir)
++{
++ char path[100];
++ char link[100];
++ dev_t chan_dev;
++ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
++
++ /* create /dev/zap/span%d/%d channel device node */
++ if ((chan_dev = devfs_mk_cdev(MKDEV(ZT_MAJOR, chan->channo), mode, "zap/span%d/%d", dir, chan->chanpos)) < 0) {
++ printk("zaptel: Something really bad happened. Unable to register devfs entry\n");
++ return 0;
++ }
++
++ /* link /dev/zap/span%d/%d -> /dev/zap/%d ?!? */
++ sprintf(path, "zap/span%d/%d", dir, chan->chanpos);
++ sprintf(link, "zap/%d", chan->chanpos);
++ devfs_mk_symlink(link, path);
++
++ return chan_dev;
++}
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+
+ static int zt_chan_reg(struct zt_chan *chan)
+@@ -4111,6 +4136,7 @@ int zt_register(struct zt_span *span, in
+ #endif
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ {
+ char span_name[50];
+ sprintf(span_name, "span%d", span->spanno);
+@@ -4120,6 +4146,15 @@ int zt_register(struct zt_span *span, in
+ chan->fhandle = register_devfs_channel(chan, chan->span->dhandle); /* Register our stuff with devfs */
+ }
+ }
++#else
++ {
++ devfs_mk_dir("zap/span%d", span->spanno);
++ for (x = 0; x < span->channels; x++) {
++ struct zt_chan *chan = &span->chans[x];
++ register_devfs_channel(chan, span->spanno); /* Register our stuff with devfs */
++ }
++ }
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+
+ if (debug)
+@@ -4159,11 +4194,22 @@ int zt_unregister(struct zt_span *span)
+ remove_proc_entry(tempfile, NULL);
+ #endif /* CONFIG_PROC_FS */
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ for (x = 0; x < span->channels; x++) {
+ devfs_unregister(span->chans[x].fhandle);
+ devfs_unregister(span->chans[x].fhandle_symlink);
+ }
+ devfs_unregister(span->dhandle);
++#else
++ for (x = 0; x < span->channels; x++) {
++ /* remove symlink first */
++ devfs_remove("zap/span%d/%d", span->spanno, span->chans[x].chanpos);
++ /* remove channel device */
++ devfs_remove("zap/%d", span->chans[x].chanpos);
++ }
++ /* remove span dir */
++ devfs_remove("zap/span%d", span->spanno);
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+ spans[span->spanno] = NULL;
+ span->spanno = 0;
+@@ -6016,6 +6062,7 @@ static int __init zt_init(void) {
+ proc_entries[0] = proc_mkdir("zaptel", NULL);
+ #endif
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ {
+ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
+ devfs_register_chrdev(ZT_MAJOR, "zaptel", &zt_fops);
+@@ -6027,6 +6074,22 @@ static int __init zt_init(void) {
+ ctl = devfs_register(zaptel_devfs_dir, "ctl", DEVFS_FL_DEFAULT, ZT_MAJOR, 0, mode, &zt_fops, NULL);
+ }
+ #else
++ {
++ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
++ if ((res = register_chrdev(ZT_MAJOR, "zaptel", &zt_fops)) < 0) {
++ printk(KERN_ERR "Unable to register for device on %d, error: %d\n", ZT_MAJOR, res);
++ return res;
++ }
++
++ devfs_mk_dir("zap");
++
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 253), mode, "zap/timer");
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 254), mode, "zap/channel");
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 255), mode, "zap/pseudo");
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 0), mode, "zap/ctl");
++ }
++#endif
++#else
+ if ((res = register_chrdev(ZT_MAJOR, "zaptel", &zt_fops))) {
+ printk(KERN_ERR "Unable to register tor device on %d\n", ZT_MAJOR);
+ return res;
+@@ -6057,6 +6120,7 @@ static void __exit zt_cleanup(void) {
+ if (tone_zones[x])
+ kfree(tone_zones[x]);
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ devfs_unregister(timer);
+ devfs_unregister(channel);
+ devfs_unregister(pseudo);
+@@ -6065,6 +6129,16 @@ static void __exit zt_cleanup(void) {
+ devfs_unregister_chrdev(ZT_MAJOR, "zaptel");
+ #else
+ unregister_chrdev(ZT_MAJOR, "zaptel");
++
++ devfs_remove("zap/timer");
++ devfs_remove("zap/ctl");
++ devfs_remove("zap/pseudo");
++ devfs_remove("zap/channel");
++
++ devfs_remove("zap");
++#endif
++#else
++ unregister_chrdev(ZT_MAJOR, "zaptel");
+ #endif
+ #ifdef CONFIG_ZAPTEL_WATCHDOG
+ watchdog_cleanup();
+diff -Naurp -x .svn zaptel-0.9.1/zaptel.h zaptel-0.9.1-devfs26/zaptel.h
+--- zaptel-0.9.1/zaptel.h 2004-03-26 08:44:19.000000000 +0100
++++ zaptel-0.9.1-devfs26/zaptel.h 2004-05-04 23:16:07.000000000 +0200
+@@ -46,14 +46,13 @@
+
+ #include "ecdis.h"
+ #include "fasthdlc.h"
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++#define LINUX26
+ #endif
++#endif /* __KERNEL__ */
+ #ifdef CONFIG_DEVFS_FS
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ #include <linux/devfs_fs_kernel.h>
+-#else
+-#undef CONFIG_DEVFS_FS
+-#warning "Zaptel doesn't support DEVFS in post 2.4 kernels. Disabling DEVFS in zaptel"
+-#endif
+ #endif /* CONFIG_DEVFS_FS */
+ #include <linux/ioctl.h>
+
+@@ -61,6 +60,8 @@
+ #define ELAST 500
+ #endif
+
++
++
+ /* Per-span configuration values */
+ #define ZT_CONFIG_TXLEVEL 7 /* bits 0-2 are tx level */
+
+@@ -1089,8 +1090,10 @@ struct zt_chan {
+ #endif
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ devfs_handle_t fhandle; /* File handle in devfs for the channel */
+ devfs_handle_t fhandle_symlink;
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+ };
+
+@@ -1219,7 +1222,9 @@ struct zt_span {
+ int lastalarms; /* Previous alarms */
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ devfs_handle_t dhandle; /* Directory name */
++#endif
+ #endif
+ /* If the watchdog detects no received data, it will call the
+ watchdog routine */
+@@ -1404,10 +1409,6 @@ static inline short zt_txtone_nextsample
+
+ #endif /* CONFIG_CALC_XLAW */
+
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+-#define LINUX26
+-#endif
+-
+ #endif /* __KERNEL__ */
+
+ #endif /* _LINUX_ZAPTEL_H */
diff --git a/net-misc/zaptel/files/zaptel-0.9.1-modulesd.diff b/net-misc/zaptel/files/zaptel-0.9.1-modulesd.diff
new file mode 100644
index 000000000000..3c9d2f8de4d1
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel-0.9.1-modulesd.diff
@@ -0,0 +1,43 @@
+--- Makefile.orig 2004-05-03 01:10:37.392241008 +0200
++++ Makefile 2004-05-03 01:11:30.235207656 +0200
+@@ -33,7 +33,8 @@
+ INSTALL_PREFIX=
+
+ BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
+-MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modprobe.d ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(INSTALL_PREFIX)/etc/modutils ]; then echo "$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f $(INSTALL_PREFIX)/etc/modprobe.conf ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.conf"; elif [ -f $(INSTALL_PREFIX)/etc/modules.conf ]; then echo "$(INSTALL_PREFIX)/etc/modules.conf"; else echo $(INSTALL_PREFIX)/etc/conf.modules ; fi)
++# Patch for Gentoo, uses modules.d
++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
+@@ -272,6 +273,7 @@
+ install -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include
+ ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
+ /sbin/ldconfig
++ mkdir -p $(INSTALL_PREFIX)/etc/modules.d
+ 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" | \
+@@ -296,10 +298,6 @@
+ fi; \
+ done
+
+- if [ -d /etc/modutils ]; then \
+- /sbin/update-modules ; \
+- fi
+- -/sbin/depmod -a
+ [ -f $(INSTALL_PREFIX)/etc/zaptel.conf ] || install -m 644 zaptel.conf.sample $(INSTALL_PREFIX)/etc/zaptel.conf
+
+ config:
+--- Makefile.orig 2004-05-03 01:16:52.352238424 +0200
++++ Makefile 2004-05-03 01:17:09.821582680 +0200
+@@ -64,8 +64,7 @@
+
+ linux26:
+ linux26: prereq $(BINS)
+- @if ! [ -d /usr/src/linux-2.6 ]; then echo "Link /usr/src/linux-2.6 to your kernel sources first!"; exit 1 ; fi
+- make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules
++ make -C /usr/src/linux SUBDIRS=$(PWD) modules
+
+ obj-m := $(MODULESO)
+
diff --git a/net-misc/zaptel/files/zaptel.confd b/net-misc/zaptel/files/zaptel.confd
new file mode 100644
index 000000000000..5a27a4c9f60c
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel.confd
@@ -0,0 +1,13 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/files/zaptel.confd,v 1.1 2004/05/10 01:18:13 stkn Exp $
+
+#
+# Some options for the zaptel init script
+#
+
+#
+# Forces the script to re-create missing /dev/zap
+# directory and device nodes
+#
+ZAP_FORCE_CREATE="no"
diff --git a/net-misc/zaptel/files/zaptel.rc6 b/net-misc/zaptel/files/zaptel.rc6
new file mode 100644
index 000000000000..085082778970
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel.rc6
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/files/zaptel.rc6,v 1.1 2004/05/10 01:18:13 stkn Exp $
+
+depend() {
+ need net
+}
+
+checkconfig() {
+ if [ ! -f /etc/zaptel.conf ]; then
+ echo "Please create /etc/zaptel.conf!"
+ return 0
+ fi
+
+ return 1
+}
+
+create_devices() {
+ mkdir -p -m 0775 /dev/zap
+ for i in `seq 1 250`; do
+ mknod /dev/zap/$i c 196 $i
+ done
+ mknod /dev/zap/ctl c 196 0
+ mknod /dev/zap/timer c 196 253
+ mknod /dev/zap/channel c 196 254
+ mknod /dev/zap/pseudo c 196 255
+}
+
+
+start() {
+ checkconfig || exit 1
+
+ if [ ! -d /dev/zap ] && [ "$ZAP_FORCE_CREATE" != "no" ]; then
+ einfo "Creating zaptel device nodes"
+ create_devices
+ fi
+
+ ebegin "Starting zaptel"
+ /sbin/ztcfg
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping zaptel"
+ /sbin/ztcfg -s
+ eend $?
+}
+
+
+# vim:ts=4
diff --git a/net-misc/zaptel/zaptel-0.9.1.ebuild b/net-misc/zaptel/zaptel-0.9.1.ebuild
new file mode 100644
index 000000000000..4a7b4a8b39b7
--- /dev/null
+++ b/net-misc/zaptel/zaptel-0.9.1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-0.9.1.ebuild,v 1.1 2004/05/10 01:18:13 stkn Exp $
+
+inherit eutils
+
+IUSE="devfs26"
+
+DESCRIPTION="Pseudo-TDM engine"
+HOMEPAGE="http://www.asterisk.org"
+SRC_URI="ftp://ftp.asterisk.org/pub/telephony/zaptel/zaptel-${PV}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86"
+
+DEPEND="virtual/glibc
+ virtual/linux-sources
+ >=dev-libs/newt-0.50.0"
+
+# hardcoded for now,
+# change if other archs are supported (unlikely)
+MY_ARCH="i386"
+
+pkg_setup() {
+ einfo "Please make sure that your kernel has the appropriate"
+ einfo "ppp support enabled or present as modules before merging"
+ einfo "e.g."
+ einfo "CONFIG_PPP=m"
+ einfo "CONFIG_PPP_ASYNC=m"
+ einfo "CONFIG_PPP_DEFLATE=m"
+ einfo "CONFIG_PPPOE=m"
+ einfo "Otherwise quit this ebuild, rebuild your kernel and reboot"
+
+ # show an nice warning message about zaptel not supporting devfs on 2.6
+ if [ $(echo $KV | cut -d. -f1) -eq 2 ] && [ $(echo $KV|cut -d. -f2) -eq 6 ]; then
+ echo
+ einfo "You're using zaptel with linux-2.6:"
+ ewarn " Zaptel doesn't support devfs with 2.6, you'll need to use udev or disable devfs"
+ ewarn " or use devfs and write a script which re-creates the device nodes for you"
+ echo
+ ewarn "There's an experimental patch which adds devfs support when using linux-2.6, but:"
+ ewarn " 1. It's an ugly hack atm and needs a cleanup..."
+ ewarn " 2. I was only abled to test loding / unloading with the ztd-eth driver..."
+ ewarn " 3. I _really_ don't know if it works with real hardware..."
+ echo
+ eerror " 4. And more important: This is not officially supported by Digium / the Asterisk project!!!"
+ echo
+ ewarn "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"
+ echo
+ ewarn "You have been warned!"
+
+ echo
+ einfo "Sleeping 30 Seconds..."
+ sleep 30
+ else
+ echo
+ einfo "Sleeping 10 Seconds..."
+ sleep 10
+ fi
+
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ epatch ${FILESDIR}/${PN}-mkdir-usrincludelinux.patch
+
+ # >= 0.9.1 requires new patch
+ epatch ${FILESDIR}/${P}-modulesd.diff
+
+ # remove all from install target
+ sed -i -e "s#^\(install:\)[ \t]\+all[ \t]\+\(.*\)#\1 \2#" Makefile
+
+ # enable ztdummy...
+ sed -i -e "s:#\( ztdummy.*\):\1:" Makefile
+
+ # devfs support
+ if [ -n "`use devfs26`" ]; then
+ einfo "Enabling experimental devfs support for linux-2.6..."
+ epatch ${FILESDIR}/${P}-experimental-devfs26.diff
+ fi
+}
+
+src_compile() {
+ # workaround for 2.6 build system
+ if [ $(echo $KV | cut -d. -f1) -eq 2 ] && [ $(echo $KV|cut -d. -f2) -eq 6 ]; then
+ einfo "Enabled 2.6 module building workaround..."
+ addwrite /usr/src/linux
+ fi
+
+ make ARCH=${MY_ARCH} || die
+}
+
+src_install() {
+ make INSTALL_PREFIX=${D} install || die
+
+ dodoc ChangeLog README README.Linux26 README.fxsusb zaptel.init zaptel.sysconfig
+ dodoc zaptel.conf.sample
+
+ dobin ztmonitor ztspeed
+
+ # install init script
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/zaptel.rc6 zaptel
+ insinto /etc/conf.d
+ newins ${FILESDIR}/zaptel.confd zaptel
+
+ # remove device files if devfs is running
+ if [ -f /dev/.devfsd ]; then
+ rm -rf ${D}/dev
+ fi
+}
+
+pkg_postinst() {
+ if [ -n "`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
+}