diff options
author | Stefan Knoblich <stkn@gentoo.org> | 2004-09-24 00:01:57 +0000 |
---|---|---|
committer | Stefan Knoblich <stkn@gentoo.org> | 2004-09-24 00:01:57 +0000 |
commit | 896cee566f4a87adf159011dcb1b3e4715ad56bb (patch) | |
tree | acae59fb865c2682c7ee2e44e52a57f4b3171d09 /net-misc/zaptel | |
parent | Version bump. Fixes bug #52001. bug #51054and bug Bug #43592 (Manifest recom... (diff) | |
download | gentoo-2-896cee566f4a87adf159011dcb1b3e4715ad56bb.tar.gz gentoo-2-896cee566f4a87adf159011dcb1b3e4715ad56bb.tar.bz2 gentoo-2-896cee566f4a87adf159011dcb1b3e4715ad56bb.zip |
version bump
Diffstat (limited to 'net-misc/zaptel')
-rw-r--r-- | net-misc/zaptel/ChangeLog | 9 | ||||
-rw-r--r-- | net-misc/zaptel/files/digest-zaptel-1.0.0 | 1 | ||||
-rw-r--r-- | net-misc/zaptel/files/zaptel-1.0.0-experimental-devfs26.diff | 202 | ||||
-rw-r--r-- | net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff | 43 | ||||
-rw-r--r-- | net-misc/zaptel/zaptel-1.0.0.ebuild | 119 |
5 files changed, 373 insertions, 1 deletions
diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog index fbc2a05cfd52..ccd24f0a5758 100644 --- a/net-misc/zaptel/ChangeLog +++ b/net-misc/zaptel/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-misc/zaptel # Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.14 2004/09/06 00:50:54 ciaranm Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.15 2004/09/23 23:57:02 stkn Exp $ + +*zaptel-1.0.0 (24 Sep 2004) + + 24 Sep 2004; <stkn@gentoo.org> + +files/zaptel-1.0.0-experimental-devfs26.diff, + +files/zaptel-1.0.0-modulesd.diff, +zaptel-1.0.0.ebuild: + version bump 06 Sep 2004; Ciaran McCreesh <ciaranm@gentoo.org> zaptel-0.7.0.ebuild, zaptel-0.8.1.ebuild, zaptel-0.9.1.ebuild: diff --git a/net-misc/zaptel/files/digest-zaptel-1.0.0 b/net-misc/zaptel/files/digest-zaptel-1.0.0 new file mode 100644 index 000000000000..1ae4460f487f --- /dev/null +++ b/net-misc/zaptel/files/digest-zaptel-1.0.0 @@ -0,0 +1 @@ +MD5 9088735d344cb79bb703a8d73e4ee0d3 zaptel-1.0.0.tar.gz 296584 diff --git a/net-misc/zaptel/files/zaptel-1.0.0-experimental-devfs26.diff b/net-misc/zaptel/files/zaptel-1.0.0-experimental-devfs26.diff new file mode 100644 index 000000000000..1357661a5612 --- /dev/null +++ b/net-misc/zaptel/files/zaptel-1.0.0-experimental-devfs26.diff @@ -0,0 +1,202 @@ +--- zaptel-1.0.0/zaptel.c.orig 2004-09-11 17:48:45.000000000 +0200 ++++ zaptel-1.0.0/zaptel.c 2004-09-24 00:41:48.856014048 +0200 +@@ -143,12 +143,14 @@ + + /* 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 + + /* udev necessary data structures. Yeah! */ + #ifdef CONFIG_ZAP_UDEV +@@ -1087,6 +1089,7 @@ + } + + #ifdef CONFIG_DEVFS_FS ++#ifndef LINUX26 + static devfs_handle_t register_devfs_channel(struct zt_chan *chan, devfs_handle_t dir) + { + char path[100]; +@@ -1129,6 +1132,28 @@ + + 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) +@@ -4285,6 +4310,7 @@ + #endif + + #ifdef CONFIG_DEVFS_FS ++#ifndef LINUX26 + { + char span_name[50]; + sprintf(span_name, "span%d", span->spanno); +@@ -4294,6 +4320,15 @@ + 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 */ + + #ifdef CONFIG_ZAP_UDEV +@@ -4341,11 +4376,22 @@ + 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 */ + + #ifdef CONFIG_ZAP_UDEV +@@ -6282,6 +6328,7 @@ + #endif /* CONFIG_ZAP_UDEV */ + + #ifdef CONFIG_DEVFS_FS ++#ifndef LINUX26 + { + umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO; + devfs_register_chrdev(ZT_MAJOR, "zaptel", &zt_fops); +@@ -6293,6 +6340,22 @@ + 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; +@@ -6323,6 +6386,7 @@ + if (tone_zones[x]) + kfree(tone_zones[x]); + #ifdef CONFIG_DEVFS_FS ++#ifndef LINUX26 + devfs_unregister(timer); + devfs_unregister(channel); + devfs_unregister(pseudo); +@@ -6338,6 +6402,16 @@ + class_simple_destroy(zap_class); + #endif /* CONFIG_ZAP_UDEV */ + 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(); +--- zaptel-1.0.0/zaptel.h.orig 2004-09-11 17:48:45.000000000 +0200 ++++ zaptel-1.0.0/zaptel.h 2004-09-24 00:40:26.169584296 +0200 +@@ -52,12 +52,7 @@ + #include "fasthdlc.h" + #endif + #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> + +@@ -65,6 +60,8 @@ + #define ELAST 500 + #endif + ++ ++ + /* Per-span configuration values */ + #define ZT_CONFIG_TXLEVEL 7 /* bits 0-2 are tx level */ + +@@ -1122,8 +1119,10 @@ + #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 */ + }; + +@@ -1253,7 +1252,9 @@ + 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 */ diff --git a/net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff b/net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff new file mode 100644 index 000000000000..3c9d2f8de4d1 --- /dev/null +++ b/net-misc/zaptel/files/zaptel-1.0.0-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/zaptel-1.0.0.ebuild b/net-misc/zaptel/zaptel-1.0.0.ebuild new file mode 100644 index 000000000000..143f237cc0fc --- /dev/null +++ b/net-misc/zaptel/zaptel-1.0.0.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.0.0.ebuild,v 1.1 2004/09/23 23:57:02 stkn Exp $ + +IUSE="devfs26" + +inherit eutils + +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 ~ppc" + +DEPEND="virtual/libc + virtual/linux-sources + >=dev-libs/newt-0.50.0" + +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 20 Seconds..." + epause 20 + else + echo + einfo "Sleeping 10 Seconds..." + epause 10 + fi + +} + +src_unpack() { + unpack ${A} + + cd ${S} + # >= 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 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 + + if use x86; then + make ARCH="i386" || die + else + make || die + fi +} + +src_install() { + make INSTALL_PREFIX=${D} install || die + + dodoc ChangeLog README README.udev README.Linux26 README.fxsusb zaptel.init zaptel.sysconfig + dodoc zaptel.conf.sample + + # additional tools + dobin ztmonitor ztspeed zttest + + # install init script + exeinto /etc/init.d + newexe ${FILESDIR}/zaptel.rc6 zaptel + insinto /etc/conf.d + newins ${FILESDIR}/zaptel.confd zaptel +} + +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 +} |