diff options
author | 2005-09-03 20:25:17 +0000 | |
---|---|---|
committer | 2005-09-03 20:25:17 +0000 | |
commit | b1b5387e2442d8d2976d3eac42f3111f8035320b (patch) | |
tree | 0c36e330319ba6bf956e0e13af2323253b78f6ce /net-dialup/capi4k-utils | |
parent | adding new capi4k-utils USE flags (diff) | |
download | historical-b1b5387e2442d8d2976d3eac42f3111f8035320b.tar.gz historical-b1b5387e2442d8d2976d3eac42f3111f8035320b.tar.bz2 historical-b1b5387e2442d8d2976d3eac42f3111f8035320b.zip |
adding lots of USE flags, checking kernel options, reworked init- and hotplug-scripts, added pcmcia support for kernels < 2.6.13 (new pcmcia support will follow soon).
Package-Manager: portage-2.0.51.22-r2
Diffstat (limited to 'net-dialup/capi4k-utils')
-rw-r--r-- | net-dialup/capi4k-utils/ChangeLog | 12 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/Manifest | 20 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/capi4k-utils-20050718-r1.ebuild | 151 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.blacklist | 4 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.conf | 4 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.confd | 31 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.hotplug | 28 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.initd | 149 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.pcmcia | 31 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.pcmcia.conf | 36 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/capi.usermap | 4 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1 | 1 | ||||
-rw-r--r-- | net-dialup/capi4k-utils/metadata.xml | 13 |
13 files changed, 404 insertions, 80 deletions
diff --git a/net-dialup/capi4k-utils/ChangeLog b/net-dialup/capi4k-utils/ChangeLog index 75b15ebf7786..55e024f6a1bd 100644 --- a/net-dialup/capi4k-utils/ChangeLog +++ b/net-dialup/capi4k-utils/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-dialup/capi4k-utils # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/ChangeLog,v 1.38 2005/07/20 18:47:52 sbriesen Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/ChangeLog,v 1.39 2005/09/03 20:25:17 sbriesen Exp $ + +*capi4k-utils-20050718-r1 (03 Sep 2005) + + 03 Sep 2005; Stefan Briesenick <sbriesen@gentoo.org> files/capi.blacklist, + files/capi.conf, files/capi.confd, files/capi.hotplug, files/capi.initd, + +files/capi.pcmcia, +files/capi.pcmcia.conf, files/capi.usermap, + metadata.xml, +capi4k-utils-20050718-r1.ebuild: + adding lots of USE flags, checking kernel options, reworked init- and + hotplug-scripts, added pcmcia support for kernels < 2.6.13 (new pcmcia + support will follow soon). 20 Jul 2005; Stefan Briesenick <sbriesen@gentoo.org> files/capi.hotplug: now hotplug-script looks in different locations for firmware files also diff --git a/net-dialup/capi4k-utils/Manifest b/net-dialup/capi4k-utils/Manifest index 10fe501123ab..d94430a305b6 100644 --- a/net-dialup/capi4k-utils/Manifest +++ b/net-dialup/capi4k-utils/Manifest @@ -1,23 +1,27 @@ MD5 5dc6f506ad44aae8328d0690e94eb688 capi4k-utils-20041006-r5.ebuild 3736 MD5 03243c209893699ce44a97f2090546fe capi4k-utils-20050322-r1.ebuild 4014 MD5 2c1a45b850f5072a7e30fb95cada2fa0 capi4k-utils-20050718.ebuild 3978 -MD5 f0a3e90be72747b99cc7b0e310deefd2 ChangeLog 7432 -MD5 ec2f84816306825d125d0c01bd86758d metadata.xml 163 +MD5 a4e740381fc9f9b45c6cf646a7f4d09a capi4k-utils-20050718-r1.ebuild 5079 +MD5 f6b3f7ddfbbd6b02a31b08036c9eba0b ChangeLog 7917 +MD5 57ebf0922074a9d61182c51349de5d53 metadata.xml 618 MD5 aa0258d1e27f2b71ec2a6a950127831f capi4k-utils-20050509.ebuild 3977 MD5 c1f67e98c19fe5ece86b9242a00e6a38 files/README.gentoo 2800 MD5 bc75ed1e49b13568f93fb63a37c5dc70 files/capi-isdn 287 -MD5 67da90715c52ee18b93fc4effe263f5f files/capi.conf 2266 -MD5 6d7bb17701078373179e9e8dae7b6a55 files/capi.confd 651 -MD5 e893400f587fe8773df3d7903a062609 files/capi.initd 3062 +MD5 3429266c493e7d16f2db8d27bd6ce690 files/capi.conf 2087 +MD5 6bad9f4e459a6f4842a38c0f1c53123a files/capi.confd 837 +MD5 3bd6c2c1d96346aaa4371bcc4dd7df24 files/capi.initd 4756 MD5 5567e0f076f3d1faafcd0d4fa39a1c4e files/digest-capi4k-utils-20041006-r5 156 MD5 edc50538053b658093927f9fb28c3aff files/config 195 -MD5 c6d2f5f9e53e0fbf5a88feb8bde1b709 files/capi.usermap 1856 +MD5 09d93d6fd9f60f763d38f4257f31abcd files/capi.usermap 1663 MD5 2fe94d2623c5b129780b72bacaf4a7bc files/rcapid.xinetd 236 MD5 239b613eb69255eead19892de760db8d files/digest-capi4k-utils-20050509 75 MD5 2ab6ed3bc0de68c33e2ade1979dd4c0a files/digest-capi4k-utils-20050718 75 -MD5 97a56dd67a012daab67041ed96a6d44d files/capi.blacklist 530 -MD5 c573d252a8c70f78956fbdd3985e1d92 files/capi.hotplug 5045 +MD5 95524e27e1ed6d91b3de60e375f3f7f7 files/capi.pcmcia 762 +MD5 266a6a842420d7bee03b4f8e44d7062b files/capi.blacklist 335 +MD5 87e252d1e2e88ccf3d5177f6a60e2793 files/capi.hotplug 5089 +MD5 6418461a6c702da694ff8f7ef944af00 files/capi.pcmcia.conf 1218 MD5 709e4079ecd09537691845755cb9136d files/digest-capi4k-utils-20050322-r1 75 +MD5 2ab6ed3bc0de68c33e2ade1979dd4c0a files/digest-capi4k-utils-20050718-r1 75 MD5 e74f9b822b6f485ca6ff834c2699151a files/20041006/README.gentoo 1492 MD5 fb9f9b4003d8d1647e23cf7b329386f6 files/20041006/capi.confd 424 MD5 1954a92bd07c3e2dfcfe1d68d8a290d8 files/20041006/capi.initd 1297 diff --git a/net-dialup/capi4k-utils/capi4k-utils-20050718-r1.ebuild b/net-dialup/capi4k-utils/capi4k-utils-20050718-r1.ebuild new file mode 100644 index 000000000000..fe6625aae074 --- /dev/null +++ b/net-dialup/capi4k-utils/capi4k-utils-20050718-r1.ebuild @@ -0,0 +1,151 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/capi4k-utils-20050718-r1.ebuild,v 1.1 2005/09/03 20:25:17 sbriesen Exp $ + +inherit eutils multilib gnuconfig linux-info + +YEAR_PV="${PV:0:4}" +MON_PV="${PV:4:2}" +DAY_PV="${PV:6:2}" +MY_P="${PN}-${YEAR_PV}-${MON_PV}-${DAY_PV}" +PPPVERSIONS="2.4.2 2.4.3" # versions in portage + +DESCRIPTION="CAPI4Linux Utils" +HOMEPAGE="ftp://ftp.in-berlin.de/pub/capi4linux/" +SRC_URI="ftp://ftp.in-berlin.de/pub/capi4linux/${MY_P}.tar.gz + ftp://ftp.in-berlin.de/pub/capi4linux/OLD/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64 ~ppc" +IUSE="fax pppd tcpd usb pcmcia" + +DEPEND="virtual/linux-sources + virtual/os-headers + >=sys-apps/sed-4" + +RDEPEND="usb? ( sys-apps/hotplug ) + pcmcia? ( virtual/pcmcia ) + dev-lang/perl" + +S="${WORKDIR}/${PN}" + +pkg_setup() { + # check kernel config + CONFIG_CHECK="ISDN ISDN_CAPI ISDN_CAPI_CAPI20" + use pppd && CONFIG_CHECK="${CONFIG_CHECK} ISDN_CAPI_MIDDLEWARE ISDN_CAPI_CAPIFS_BOOL" + linux-info_pkg_setup +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # set our config + cp -f "${FILESDIR}/config" .config + # copy init-script config + cp -f "${FILESDIR}/capi.confd" capi.confd + # patch includes of all *.c files + sed -i -e "s:linux/capi.h>$:linux/compiler.h>\n#include <linux/capi.h>:g" */*.c || die "sed failed" + # patch all Makefile.* and Rules.make to use our CFLAGS + sed -i -e "s:^\(CFLAGS.*\)-O2:\1${CFLAGS}:g" */Makefile.* */Rules.make || die "sed failed" + # patch capi20/Makefile.* to use -fPIC for shared library + sed -i -e "s:^\(CFLAGS.*\):\1 -fPIC:g" capi20/Makefile.* || die "sed failed" + # patch pppdcapiplugin/Makefile to use only the ppp versions we want + sed -i -e "s:^\(PPPVERSIONS = \).*$:\1${PPPVERSIONS}:g" pppdcapiplugin/Makefile || die "sed failed" + # patch capiinit/capiinit.c to look also in /lib/firmware + sed -i -e "s:\(\"/lib/firmware/isdn\",\):\1 \"/lib/firmware\",:g" capiinit/capiinit.c || die "sed failed" + # no, we don't need any devices nodes + sed -i -e "s:\(sh scripts/makedev.sh\):echo \1:g" Makefile || die "sed failed" + # add --libdir to configure call in Makefile + sed -i -e "s:\(\./configure \):\1--libdir=/usr/$(get_libdir) :g" Makefile || die "sed failed" + # patch /usr/lib/pppd in pppdcapiplugin tree + sed -i -e "s:/usr/lib/pppd:/usr/$(get_libdir)/pppd:g" \ + pppdcapiplugin/ppp-*/Makefile pppdcapiplugin/{README,*.8} || die "sed failed" + + # USB hotplug + use usb || sed -i -e "s:^\(CAPI_HOTPLUG_.*\)$:### \1:g" capi.confd + # build rcapid + use tcpd || sed -i -e "s:^\(CONFIG_RCAPID=.*\)$:# \1:g" .config + # build capifax + use fax || sed -i -e "s:^\(CONFIG_CAPIFAX=.*\)$:# \1:g" .config + # build pppdcapiplugin + use pppd || sed -i -e "s:^\(CONFIG_PPPDCAPIPLUGIN=.*\)$:# \1:g" .config +} + +src_compile() { + gnuconfig_update + emake subconfig || die "make subconfig failed" + emake || die "make failed" +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + + # install base + dobin scripts/isdncause + newinitd "${FILESDIR}/capi.initd" capi + newconfd capi.confd capi + insinto /etc + doins "${FILESDIR}/capi.conf" + dodoc "${FILESDIR}/README.gentoo" scripts/makedev.sh + + # install USB hotplug stuff + if use usb; then + insinto /etc/hotplug/blacklist.d + newins "${FILESDIR}/capi.blacklist" capi + insinto /etc/hotplug/usb + newins "${FILESDIR}/capi.usermap" capi.usermap + exeinto /etc/hotplug/usb + newexe "${FILESDIR}/capi.hotplug" capi + fi + + # install PCMCIA stuff + if use pcmcia; then + insinto /etc/pcmcia + newins "${FILESDIR}/capi.pcmcia.conf" capi.conf + exeinto /etc/pcmcia + newexe "${FILESDIR}/capi.pcmcia" capi + fi + + # install rcapid stuff + if use tcpd; then + insinto /etc/xinetd.d + newins "${FILESDIR}/rcapid.xinetd" rcapid + newdoc rcapid/README README.rcapid + fi + + # install pppdcapiplugin stuff + if use pppd; then + insinto /etc/ppp/peers + doins pppdcapiplugin/peers/t-dsl + docinto pppdcapiplugin + dodoc pppdcapiplugin/README pppdcapiplugin/examples/* + fi +} + +pkg_postinst() { + einfo + einfo "Please read the instructions in:" + einfo "/usr/share/doc/${PF}/README.gentoo.gz" + einfo + einfo "Annotation for active AVM ISDN boards (B1 ISA/PCI, ...):" + einfo "If you run" + einfo " emerge isdn-firmware" + einfo "you will probably find your board's firmware in /lib/firmware." + einfo + einfo "If you have another active ISDN board, you should create" + einfo "/lib/firmware and copy there your board's firmware." + einfo + einfo "There're several other packages available, which might have" + einfo "the CAPI driver you need for your card(s):" + einfo " net-dialup/fritzcapi - AVM passive ISDN controllers" + einfo " net-dialup/fcdsl - AVM ISDN/DSL controllers PCI/USB" + einfo " net-dialup/misdn - some passive cards with HiSax chipset" + einfo + ewarn "If you're upgrading from an older capi4k-utils, you must recompile" + ewarn "the other packages on your system that link with libcapi after the" + ewarn "upgrade completes. To perform this action, please run revdep-rebuild" + ewarn "in package app-portage/gentoolkit." + ewarn +} diff --git a/net-dialup/capi4k-utils/files/capi.blacklist b/net-dialup/capi4k-utils/files/capi.blacklist index de70fcbcf39c..88e52a730062 100644 --- a/net-dialup/capi4k-utils/files/capi.blacklist +++ b/net-dialup/capi4k-utils/files/capi.blacklist @@ -1,6 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.blacklist,v 1.3 2005/04/24 13:31:48 genstef Exp $ +# /etc/hotplug/blacklist.d/capi # CAPI USB is handled via /etc/hotplug/usb/capi.usermap fcusb diff --git a/net-dialup/capi4k-utils/files/capi.conf b/net-dialup/capi4k-utils/files/capi.conf index bb1b3e916d84..c2e3864e1691 100644 --- a/net-dialup/capi4k-utils/files/capi.conf +++ b/net-dialup/capi4k-utils/files/capi.conf @@ -1,6 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.conf,v 1.4 2005/05/16 08:49:33 genstef Exp $ +# /etc/capi.conf - CAPI configuration file # card file proto io irq mem cardnr options # diff --git a/net-dialup/capi4k-utils/files/capi.confd b/net-dialup/capi4k-utils/files/capi.confd index edc9d953b9ea..d7e7af590cb1 100644 --- a/net-dialup/capi4k-utils/files/capi.confd +++ b/net-dialup/capi4k-utils/files/capi.confd @@ -1,6 +1,18 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.confd,v 1.4 2005/05/16 08:49:33 genstef Exp $ +# configuraton file for /etc/init.d/capi + +### +### Common settings +### + +# should 'capidrv' be loaded? +CAPI_LOAD_CAPIDRV="no" + +# deactivate cards on stop (USB-Cards have to be re-plugged then)? +CAPI_UNLOAD_CARDS="yes" + +### +### USB Hotplug +### # do you want to use USB hotplug? # if disabled, you have to configure your device in /etc/capi.conf @@ -12,8 +24,13 @@ CAPI_HOTPLUG_BEEP="yes" # should capi-usb handle hotplug-events for mISDN cards? CAPI_HOTPLUG_MISDN="yes" -# should CAPIDRV be loaded? -CAPI_LOAD_CAPIDRV="yes" +### +### Bluetooth CIP +### + +# blank-seperated list of CIP devices to connect. You need +# started Bluez stack and already peered devices to make +# this work. Bluetooth devices will be connected after +# ISA/PCI/(USB) devices. Leave empty to disable feature. +#CAPI_CIP_DEVICES="00:11:22:33:44:55 DE:AD:BE:EF:47:11" -# deactivate cards on stop (USB-Cards have to be re-plugged then)? -CAPI_UNLOAD_CARDS="yes" diff --git a/net-dialup/capi4k-utils/files/capi.hotplug b/net-dialup/capi4k-utils/files/capi.hotplug index 467abee14fd3..d0d2aec129ab 100644 --- a/net-dialup/capi4k-utils/files/capi.hotplug +++ b/net-dialup/capi4k-utils/files/capi.hotplug @@ -1,28 +1,30 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.9 2005/07/20 18:47:52 sbriesen Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.10 2005/09/03 20:25:17 sbriesen Exp $ . /etc/conf.d/capi -[ "$CAPI_HOTPLUG_USB" = "yes" ] || exit 0 +[ "${CAPI_HOTPLUG_USB}" = "yes" ] || exit 0 # possible firmware locations (list and order taken from 'capiinit') FWDIRS=(/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn) # Syslog output syslog() { # <msg> - /usr/bin/logger -t "capi-usb" "$1" + /usr/bin/logger -t "capi-usb" "$@" } # OK beep beep_ok() { - [ "$CAPI_HOTPLUG_BEEP" = "yes" ] && echo -en "\033[10;1200]\a\033[10;262]" > /dev/console + [ "${CAPI_HOTPLUG_BEEP}" = "yes" ] && \ + echo -en "\033[10;1200]\a\033[10;262]" > /dev/console } # Error beep beep_error() { - [ "$CAPI_HOTPLUG_BEEP" = "yes" ] && echo -en "\033[10;300]\a\033[10;262]" > /dev/console + [ "${CAPI_HOTPLUG_BEEP}" = "yes" ] && \ + echo -en "\033[10;300]\a\033[10;262]" > /dev/console } # Driver lookup @@ -134,12 +136,12 @@ case "${VENDID}" in exit 1;; esac -if [ "$DRIVER" = "hfcsusb" -a "$CAPI_HOTPLUG_MISDN" != "yes" ]; then +if [ "${DRIVER}" = "hfcsusb" -a "${CAPI_HOTPLUG_MISDN}" != "yes" ]; then syslog "ignore mISDN card: ${DRIVER} (${VENDID})" exit 0 fi -case "$ACTION" in +case "${ACTION}" in add) # loading capi if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then @@ -155,24 +157,24 @@ case "$ACTION" in # loading firmware if [ -n "${LOADER}" -a -n "${FIRMWARE}" ]; then - CNT=0 # wait for udev - while [ ! -e /dev/capi20 -a $CNT -lt 20 ]; do - sleep 0.5; : $((CNT++)) + CNT=0 # wait for udev (max 10s) + while [ ! -c /dev/capi20 -a ${CNT} -lt 40 ]; do + sleep 0.25; : $((CNT++)) done FW=$(findfw "${FIRMWARE}") if [ -n "${FW}" ]; then - if ! $LOADER $DRIVER $USBDEV $FW; then + if ! ${LOADER} ${DRIVER} ${USBDEV} ${FW}; then syslog "could not load firmware!" beep_error; exit 1 fi else - syslog "firmware ${FIRMWARE} not found in ${FWDIRS[0]}" + syslog "firmware '${FIRMWARE}' not found in ${FWDIRS[0]}" beep_error; exit 1 fi fi # loading capidrv (should be loaded *after* card driver) - if ! ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" != "yes" ] \ + if ! ( [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] \ || /sbin/modprobe -sq capidrv ); then syslog "could not load CAPIDRV!" fi diff --git a/net-dialup/capi4k-utils/files/capi.initd b/net-dialup/capi4k-utils/files/capi.initd index de5364f47baa..007fb8b58bf6 100644 --- a/net-dialup/capi4k-utils/files/capi.initd +++ b/net-dialup/capi4k-utils/files/capi.initd @@ -1,38 +1,69 @@ #!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.6 2005/04/24 13:31:48 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.7 2005/09/03 20:25:17 sbriesen Exp $ opts="info showconfig" depend() { - after hotplug isapnp pcmcia bluetooth + after isapnp pcmcia bluetooth hotplug } -drivers() { # detecting loaded drivers +# possible firmware locations (list and order taken from 'capiinit') +FWDIRS=(/lib/firmware/isdn /lib/firmware /usr/share/isdn /usr/lib/isdn /lib/isdn) + +# Firmware search +findfw() { # <fw_name> + local DIR + for DIR in ${FWDIRS[*]}; do + if [ -f "${DIR}/${1}" ]; then + echo "${DIR}/${1}"; return 0 + fi + done + return 1 +} + +# looking for 'detected' cards (currently only 'sedlfax') +detected() { # <driver> + # /proc/capi/controller: <controller> <drivername> <state> <cardname> <controllerinfo> + /bin/sed -n "s:^\([1-9][0-9]*\) \+${1} \+detected \+.*:\1:p" \ + /proc/capi/controller 2>/dev/null +} + +# detecting loaded mISDN modules +misdn_modules() { + /bin/sed -n "s:^mISDN_core \+[0-9]\+ \+[0-9]\+ \+\([^ ]\+\).*\$:\1:p" \ + /proc/modules 2>/dev/null | /bin/tr "," " " +} + +# detecting loaded CAPI drivers +capi_drivers() { local DRV MISDN=0 while read DRV; do - case "$DRV" in + case "${DRV}" in mISDN) MISDN=1;; - ?*) echo "$DRV";; + ?*) echo "${DRV}";; esac done < <(/bin/sed 2>/dev/null -n "s:^[0-9]\+ \+\([^ ]\+\).*\$:\1:p" /proc/capi/controller) - if [ $MISDN -gt 0 ]; then # dirty hack to find loaded mISDN modules - local IFS="," - for DRV in $(/bin/sed 2>/dev/null -n "s:^mISDN_core \+[0-9]\+ \+[0-9]\+ \+\([^ ]\+\).*\$:\1:p" /proc/modules); do - case "$DRV" in + if [ ${MISDN} -gt 0 ]; then # dirty hack to find loaded mISDN modules + for DRV in $(misdn_modules); do + case "${DRV}" in mISDN_*|l3udss1|faxl3) continue;; - ?*) echo "$DRV";; + ?*) echo "${DRV}";; esac done fi } -bluez_cip() { # detecting bluetooth CIP connections - [ -x /usr/bin/ciptool ] && # net-wireless/bluez-utils \ - /bin/sed 2>/dev/null -n "s:[0-9]\+ \+cmtp \+[^ ]\+ \+\([0-9A-F:]\+\) \+.*\$:\1:p" /proc/capi/controller +# detecting bluetooth CIP connections +bluez_cip() { + [ -x /usr/bin/ciptool ] && \ + /bin/sed -n "s:[0-9]\+ \+cmtp \+[^ ]\+ \+\([0-9A-F:]\+\) \+.*\$:\1:p" \ + /proc/capi/controller 2>/dev/null } + + start() { if [ ! -e /etc/capi.conf ] ; then eerror "You're missing /etc/capi.conf (comes with a capi-driver)." @@ -44,55 +75,91 @@ start() { [ -f /proc/capi/capi20 ] || /sbin/modprobe -s capi eend $? || return 1 - local CNT=0 # wait for udev - while [ ! -e /dev/capi20 -a $CNT -lt 20 ]; do - sleep 0.5; : $((CNT++)) + local CNT=0 # wait for udev (max 10s) + while [ ! -c /dev/capi20 -a ${CNT} -lt 40 ]; do + sleep 0.25; : $((CNT++)) done ebegin "Starting CAPI" - if /usr/sbin/capiinit 2>/dev/null activate ; then - [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" != "yes" ] || /sbin/modprobe -s capidrv - # eindent -> waiting for new baselayout :-/ - local INFO - while read INFO; do einfo " ${INFO}"; done < /proc/capi/controller - # eoutdent + /usr/sbin/capiinit 2>/dev/null activate + if eend $?; then + local CIP MSG INFO FW CARD MISDN + + # HACK: loading ISAR.BIN onto 'sedlfax' cards + # shouldn't be necessary, but mISDN is crappy + MISDN=$(detected "mISDN") + if [ -n "${MISDN}" ]; then + FW=$(findfw "ISAR.BIN") + if [ -n "${FW}" ]; then + for CARD in ${MISDN}; do + ebegin "Loading firmware '${FW##*/}' onto controller ${CARD}" + /usr/sbin/avmcapictrl &>/dev/null load "${FW}" "${CARD}" + eend $? + done + else + eerror "Firmware 'ISAR.BIN' not found in ${FWDIRS[0]}" + fi + fi + + # connect to CIP devices + if [ -n "${CAPI_CIP_DEVICES}" -a -x /usr/bin/ciptool ]; then + for CIP in ${CAPI_CIP_DEVICES}; do + ebegin "CIP connect to ${CIP}" + INFO=$(/usr/bin/ciptool 2>&1 connect "${CIP}") + if ! eend $?; then + [ -n "${INFO}" ] && \ + while read line MSG; do eerror " ${MSG}"; done < <(echo "${INFO}") + fi + done + sleep 0.3 # give subsystems time to initialize + fi + + # load 'capidrv' + [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] || /sbin/modprobe -s capidrv + + # show controllers + INFO=$(</proc/capi/controller) + if [ -n "${INFO}" ]; then + einfo "Available CAPI controllers:" + while read MSG; do einfo " ${MSG}"; done < <(echo "${INFO}") + fi fi - eend $? + return 0 # never fail } stop() { - local DRV CIP RET FCNT=0 DRIVERS=$(/bin/sort -u <(drivers)) + local DRV CIP RET FCNT=0 DRIVERS=$(/bin/sort -u <(capi_drivers)) # if some CAPI applications are still running, kill 'em if /bin/fuser 2>/dev/null -s /dev/capi20; then ebegin "Stopping CAPI applications" /bin/fuser -ks /dev/capi20; RET=$? - while [ $RET -eq 0 -a $FCNT -lt 10 ]; do - echo -n "."; sleep 0.5; FCNT=$(($FCNT + 1)) - /bin/fuser -s /dev/capi20; RET=$? + while [ ${RET} -eq 0 -a ${FCNT} -lt 10 ]; do + : $((FCNT++)); sleep 0.5; /bin/fuser -s /dev/capi20; RET=$? done - [ $RET -eq 0 ] && eend 1 || eend 0 + [ $RET -ne 0 ] + eend $? fi - # relase bluetooth CIP connections + # release bluetooth CIP connections for CIP in $(bluez_cip); do ebegin "Release CIP connection to ${CIP}" - /usr/bin/ciptool release "$CIP" + /usr/bin/ciptool release "${CIP}" eend done ebegin "Stopping CAPI" - [ "$CAPI_LOAD_CAPIDRV" = "yes" ] && /sbin/modprobe -sqr capidrv - [ "$CAPI_UNLOAD_CARDS" = "yes" ] && /usr/sbin/capiinit &>/dev/null stop - for DRV in $DRIVERS; do /sbin/modprobe -sqr $DRV; done + [ "${CAPI_LOAD_CAPIDRV}" = "yes" ] && /sbin/modprobe -sqr capidrv + [ "${CAPI_UNLOAD_CARDS}" = "yes" ] && /usr/sbin/capiinit &>/dev/null stop + for DRV in ${DRIVERS}; do /sbin/modprobe -sqr "${DRV}"; done /sbin/modprobe -sqr capi - eend 0 + eend 0 # ignore errors } info() { - if [ -e /proc/capi/controller ]; then - local INFO - while read INFO; do einfo "${INFO}"; done < /proc/capi/controller + if [ -f /proc/capi/controller ]; then + local MSG + while read MSG; do einfo "${MSG}"; done < /proc/capi/controller else eerror "ERROR: CAPI not loaded" return 1 @@ -100,11 +167,11 @@ info() { } showconfig() { - local TEXT INFO - if TEXT=$(/usr/sbin/capiinit 2>&1 show); then - echo "$TEXT" | while read INFO; do einfo "${INFO}"; done + local MSG INFO + if INFO=$(/usr/sbin/capiinit 2>&1 show); then + while read MSG; do einfo "${MSG}"; done < <(echo "${INFO}") return 0 fi - echo "$TEXT" | while read INFO; do eerror "${INFO}"; done + while read MSG; do eerror "${MSG}"; done < <(echo "${INFO}") return 1 } diff --git a/net-dialup/capi4k-utils/files/capi.pcmcia b/net-dialup/capi4k-utils/files/capi.pcmcia new file mode 100644 index 000000000000..941cee247cf6 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.pcmcia @@ -0,0 +1,31 @@ +#!/bin/bash +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.pcmcia,v 1.1 2005/09/03 20:25:17 sbriesen Exp $ + +. /etc/pcmcia/shared +. /etc/conf.d/capi + +# Syslog output +syslog() { # <msg> + /usr/bin/logger -t "capi-pcmcia" "$@" +} + +case "${ACTION}" in + start) + # loading capi + if ! ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ); then + syslog "could not load CAPI!" + exit 1 + fi + + # loading capidrv (should be loaded *after* card driver) + if ! ( [ -f /proc/capi/capidrv -o "${CAPI_LOAD_CAPIDRV}" != "yes" ] \ + || /sbin/modprobe -sq capidrv ); then + syslog "could not load CAPIDRV!" + fi + ;; + stop) + ;; +esac +exit 0 diff --git a/net-dialup/capi4k-utils/files/capi.pcmcia.conf b/net-dialup/capi4k-utils/files/capi.pcmcia.conf new file mode 100644 index 000000000000..8a6072b2f729 --- /dev/null +++ b/net-dialup/capi4k-utils/files/capi.pcmcia.conf @@ -0,0 +1,36 @@ +############################################################################### +# Device driver definitions for AVM cards (CAPI) # +# Please read "man 5 pcmcia" for detailed informations. # +############################################################################### + +# needs net-dialup/fritzcapi +device "fcpcmcia_cs" + class "capi" module "fcpcmcia_cs" + +# active controller, driver included in kernel +device "avm_cs" + class "capi" module "avm_cs" +# class "capi" module "b1pcmcia" module "avm_cs" +# class "capi" module "avm_cs" opts "irq_list=15,12,11,10,9,7" + + +############################################################################### +# Card definitions # +############################################################################### + +card "AVM ISDN-Controller A1" + version "AVM", "ISDN A" + bind "fcpcmcia_cs" + +card "AVM ISDN-Controller B1" + version "AVM", "ISDN-Controller B1" + bind "avm_cs" + +card "AVM Mobile ISDN-Controller M1" + version "AVM", "Mobile ISDN-Controller M1" + bind "avm_cs" + +card "AVM Mobile ISDN-Controller M2" + version "AVM", "Mobile ISDN-Controller M2" + bind "avm_cs" + diff --git a/net-dialup/capi4k-utils/files/capi.usermap b/net-dialup/capi4k-utils/files/capi.usermap index 7f362041d600..32adec7c791b 100644 --- a/net-dialup/capi4k-utils/files/capi.usermap +++ b/net-dialup/capi4k-utils/files/capi.usermap @@ -1,6 +1,4 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.usermap,v 1.2 2005/05/16 08:49:33 genstef Exp $ +# /etc/hotplug/usb/capi.usermap # AVM USB cards (ISDN/DSL) capi 0x0003 0x057c 0x0c00 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 diff --git a/net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1 b/net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1 new file mode 100644 index 000000000000..5fa2e15e6748 --- /dev/null +++ b/net-dialup/capi4k-utils/files/digest-capi4k-utils-20050718-r1 @@ -0,0 +1 @@ +MD5 c745759b6b3d64e19763727176648cdf capi4k-utils-2005-07-18.tar.gz 862826 diff --git a/net-dialup/capi4k-utils/metadata.xml b/net-dialup/capi4k-utils/metadata.xml index 1e11e7bbd01b..f5e0dc48713d 100644 --- a/net-dialup/capi4k-utils/metadata.xml +++ b/net-dialup/capi4k-utils/metadata.xml @@ -1,5 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> -<herd>net-dialup</herd> + <herd>net-dialup</herd> + <maintainer> + <email>sbriesen@gentoo.org</email> + <name>Stefan Briesenick</name> + </maintainer> + <longdescription lang="en"> + This package contains the CAPI 2.0 library, which is needed for all + CAPI applications. It also contains programs to show information about + installed CAPI controllers and for the receiving and sending of FAX + messages. CAPI 2.0 drivers for Linux are available for a growing + number of ISDN devices. + </longdescription> </pkgmetadata> |