summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schweizer <genstef@gentoo.org>2005-03-29 22:16:07 +0000
committerStefan Schweizer <genstef@gentoo.org>2005-03-29 22:16:07 +0000
commit340af7b5c06b6d44f2de6b633e3a84c23045969d (patch)
tree36534daaf5cdf0086ee18c7f261782cf3693a524 /net-dialup/capi4k-utils
parentStable on sparc wrt #86541 (diff)
downloadhistorical-340af7b5c06b6d44f2de6b633e3a84c23045969d.tar.gz
historical-340af7b5c06b6d44f2de6b633e3a84c23045969d.tar.bz2
historical-340af7b5c06b6d44f2de6b633e3a84c23045969d.zip
Improved ebuild and config-files thanks to Stefan Briesenick
Package-Manager: portage-1.585-cvs
Diffstat (limited to 'net-dialup/capi4k-utils')
-rw-r--r--net-dialup/capi4k-utils/ChangeLog7
-rw-r--r--net-dialup/capi4k-utils/Manifest24
-rw-r--r--net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild30
-rw-r--r--net-dialup/capi4k-utils/files/capi.blacklist4
-rw-r--r--net-dialup/capi4k-utils/files/capi.conf62
-rw-r--r--net-dialup/capi4k-utils/files/capi.confd6
-rw-r--r--net-dialup/capi4k-utils/files/capi.hotplug65
-rw-r--r--net-dialup/capi4k-utils/files/capi.initd29
8 files changed, 159 insertions, 68 deletions
diff --git a/net-dialup/capi4k-utils/ChangeLog b/net-dialup/capi4k-utils/ChangeLog
index fb99c138e4f0..03bcf23a0d3a 100644
--- a/net-dialup/capi4k-utils/ChangeLog
+++ b/net-dialup/capi4k-utils/ChangeLog
@@ -1,6 +1,11 @@
# 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.28 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/ChangeLog,v 1.29 2005/03/29 22:16:07 genstef Exp $
+
+ 29 Mar 2005; Stefan Schweizer <genstef@gentoo.org> files/capi.blacklist,
+ files/capi.conf, files/capi.confd, files/capi.hotplug, files/capi.initd,
+ capi4k-utils-20050322.ebuild:
+ Improved ebuild and config-files thanks to Stefan Briesenick
*capi4k-utils-20050322 (29 Mar 2005)
diff --git a/net-dialup/capi4k-utils/Manifest b/net-dialup/capi4k-utils/Manifest
index c7114a3e9231..ce4a30561ab0 100644
--- a/net-dialup/capi4k-utils/Manifest
+++ b/net-dialup/capi4k-utils/Manifest
@@ -1,21 +1,18 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
MD5 4a0bb8a608304da5ee282b438e6d54c2 capi4k-utils-20041006-r5.ebuild 3741
-MD5 8aec569ad3e34f527cb3d65fc1e626f3 capi4k-utils-20050322.ebuild 3539
-MD5 8b811b25f0ba4d3c019b5182fab32013 ChangeLog 5494
+MD5 96eb0b07b2a0d30015bad871e3ad42fb capi4k-utils-20050322.ebuild 3896
+MD5 1088a7df858b22862a53389053a5a08b ChangeLog 5741
MD5 ec2f84816306825d125d0c01bd86758d metadata.xml 163
MD5 e74f9b822b6f485ca6ff834c2699151a files/README.gentoo 1492
-MD5 4607b3504bc1d4aa7a97c4913b85d8f3 files/capi.conf 592
-MD5 bb88526e859b8c77b803550a4229db09 files/capi.confd 415
-MD5 27acf39b69fa79bc20aeec5c567dc7ac files/capi.initd 1369
+MD5 b5810627ea4dabf7c53540e8f75e348e files/capi.conf 1832
+MD5 a02f80ede6d0cb85cbc625bb33c43df5 files/capi.confd 464
+MD5 41a34277cd6d05a8ddffb6309bc0ac98 files/capi.initd 1431
MD5 5567e0f076f3d1faafcd0d4fa39a1c4e files/digest-capi4k-utils-20041006-r5 156
MD5 edc50538053b658093927f9fb28c3aff files/config 195
MD5 fa4cf0be46c4a16a2ef6fd178ed54c01 files/capi.usermap 1504
MD5 2fe94d2623c5b129780b72bacaf4a7bc files/rcapid.xinetd 236
MD5 709e4079ecd09537691845755cb9136d files/digest-capi4k-utils-20050322 75
-MD5 aa0dba318ea2acbf8012f7594058f39d files/capi.blacklist 446
-MD5 5d6863937dd667e626a05b7dc50fed9a files/capi.hotplug 2426
+MD5 fec82196af639d72141823a395298799 files/capi.blacklist 447
+MD5 08742e628681165afb2bedecad7427e7 files/capi.hotplug 3393
MD5 e74f9b822b6f485ca6ff834c2699151a files/20041006/README.gentoo 1492
MD5 fb9f9b4003d8d1647e23cf7b329386f6 files/20041006/capi.confd 424
MD5 1954a92bd07c3e2dfcfe1d68d8a290d8 files/20041006/capi.initd 1297
@@ -24,10 +21,3 @@ MD5 fa4cf0be46c4a16a2ef6fd178ed54c01 files/20041006/capi.usermap 1504
MD5 2fe94d2623c5b129780b72bacaf4a7bc files/20041006/rcapid.xinetd 236
MD5 650c413593fe44524150e1365965cdb3 files/20041006/capi.blacklist 455
MD5 2ddf9c04a03949cb2301888586096bfe files/20041006/capi.hotplug 2435
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
-
-iD8DBQFCSPvtjiC39V7gKu0RAkIcAKC+R2FGFiEzdLD5+Kk45qy5gYhGsQCfeckP
-mxIi9QyDkxG1FL4EqnFpR+8=
-=UqV3
------END PGP SIGNATURE-----
diff --git a/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild b/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild
index 689e03d8cc14..0e402c43e47d 100644
--- a/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild
+++ b/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild
@@ -1,6 +1,6 @@
# 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-20050322.ebuild,v 1.1 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/capi4k-utils-20050322.ebuild,v 1.2 2005/03/29 22:16:07 genstef Exp $
YEAR_PV=${PV:0:4}
MON_PV=${PV:4:2}
@@ -37,13 +37,15 @@ src_unpack() {
# 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.am and Rules.make to use our CFLAGS
- sed -i -e "s:^CFLAGS\(.*\)-O2:CFLAGS\1${CFLAGS}:g" */Makefile.am */Rules.make || die "sed failed"
+ sed -i -e "s:^CFLAGS\(.*\)-O2:CFLAGS\1${CFLAGS}:g" */Makefile.* */Rules.make || die "sed failed"
# patch capi20/Makefile.am to use -fPIC for shared library
- sed -i -e "s:^\(libcapi20_la_CFLAGS = \):\1-fPIC :g" capi20/Makefile.am || die "sed failed"
+ sed -i -e "s:^\(libcapi20_la_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 "/\"\/usr\/share\/isdn\"/i\"/lib/firmware\"," capiinit/capiinit.c || die "sed failed"
+ 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"
}
src_compile() {
@@ -52,8 +54,7 @@ src_compile() {
ebegin "Updating autotools-generated files"
aclocal -I . || die "aclocal failed"
automake -a || die "automake failed"
- export WANT_AUTOCONF=2.5
- autoconf || die "autoconf failed"
+ WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
libtoolize -f -c || die "libtoolize failed"
eend $?
cd ${S}
@@ -63,17 +64,15 @@ src_compile() {
}
src_install() {
- dodir /dev
make DESTDIR=${D} install || die "make install failed"
# install docs
newdoc rcapid/README README.rcapid
- newdoc pppdcapiplugin/README README.pppdcapiplugin
dodoc scripts/makedev.sh ${FILESDIR}/README.gentoo
- docinto pppdcapiplugin.examples; dodoc pppdcapiplugin/examples/*
+ docinto pppdcapiplugin; dodoc pppdcapiplugin/README pppdcapiplugin/examples/*
# install init-script + init-config
- dodir /etc/conf.d # BUG: w/o newconfd failes
+ dodir /etc/conf.d # BUG: w/o newconfd fails
newinitd ${FILESDIR}/capi.initd capi
newconfd ${FILESDIR}/capi.confd capi
@@ -100,14 +99,21 @@ src_install() {
}
pkg_postinst() {
+ einfo
einfo "Please read the instructions in:"
einfo "/usr/share/doc/${PF}/README.gentoo.gz"
- einfo ""
+ 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
einfo "If you have another active ISDN board, you should create"
einfo "/lib/firmware and copy there your board's firmware."
+ 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 7ef81d727149..33e55856d49b 100644
--- a/net-dialup/capi4k-utils/files/capi.blacklist
+++ b/net-dialup/capi4k-utils/files/capi.blacklist
@@ -1,6 +1,6 @@
-# Copyright 1999-2004 Gentoo Foundation
+# 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.1 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.blacklist,v 1.2 2005/03/29 22:16:07 genstef Exp $
# 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 f045f52a63ec..0f9e6a45586f 100644
--- a/net-dialup/capi4k-utils/files/capi.conf
+++ b/net-dialup/capi4k-utils/files/capi.conf
@@ -1,21 +1,73 @@
+# 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.2 2005/03/29 22:16:07 genstef Exp $
+
# card file proto io irq mem cardnr options
#
+
+##############################
+# ISA/PCI devices #
+##############################
+
+### AVM B1 (you also have to install the firmware)
#b1isa b1.t4 DSS1 0x150 7 - - P2P
#b1pci b1.t4 DSS1 - - - -
+
+### AVM C2(you also have to install the firmware)
+#c2 c2.bin DSS1 - - - -
+#c2 - DSS1 - - - -
+
+### AVM C4 (you also have to install the firmware)
#c4 c4.bin DSS1 - - - -
#c4 - DSS1 - - - -
#c4 - DSS1 - - - - P2P
#c4 - DSS1 - - - - P2P
-#c2 c2.bin DSS1 - - - -
-#c2 - DSS1 - - - -
+
+### AVM t1 (you also have to install the firmware)
#t1isa t1.t4 DSS1 0x340 9 - 0
#t1pci t1.t4 DSS1 - - - -
-#fcpci - - - - - -
+
+### AVM FritzCard ISA (A1)
#fcclassic - - 0x200 7 - -
-#fcusb2 fus2base.frm - - - - -
-#fcusb2 fus3base.frm - - - - -
+
+### AVM FritzCard PCI
+#fcpci - - - - - -
+
+### AVM DSL controllers
#fcdsl fdslbase.bin - - - - -
#fcdsl2 fds2base.bin - - - - -
#fcdslsl fdssbase.bin - - - - -
+
+
+##############################
+# USB devices #
+##############################
+
+# If you're using hotplug, you shouldn't configure your devices in this config.
+# USB devices are detected automatically. If you don't want to use hotplug, then
+# set CAPI_HOTPLUG_USB=0 in /etc/conf.d/capi and uncomment your card(s) below.
+
+### AVM FRITZCARD!USB
+#fcusb - - - - - -
+
+### AVM FRITZX!USB
+#fxusb - - - - - -
+
+### AVM FRITZX!USB OEM
+#fxusb_CZ - - - - - -
+
+### AVM FRITZCARD!USB v2.0
+#fcusb2 fus2base.frm - - - - -
+
+### AVM FRITZCARD!USB v2.1
+#fcusb2 fus3base.frm - - - - -
+
+### AVM BlueFRITZ!USB
+#bfusb - - - - - -
+
+### AVM FRITZDSL!USB (DSL/ISDN)
#fcdslusb fdsubase.frm - - - - -
+
+### AVM FRITZDSL!USB SL (DSL only)
#fcdslslusb fdlubase.frm - - - - -
+
diff --git a/net-dialup/capi4k-utils/files/capi.confd b/net-dialup/capi4k-utils/files/capi.confd
index 73d5f9942513..31dc5c9dfb11 100644
--- a/net-dialup/capi4k-utils/files/capi.confd
+++ b/net-dialup/capi4k-utils/files/capi.confd
@@ -1,6 +1,6 @@
-# Copyright 1999-2004 Gentoo Foundation
+# 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.1 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.confd,v 1.2 2005/03/29 22:16:07 genstef Exp $
# do you want to use USB hotplug?
# if disabled, you have to configure your device in /etc/capi.conf
@@ -9,3 +9,5 @@ CAPI_HOTPLUG_USB=1
# should via hotplug added cards generate a beep?
CAPI_HOTPLUG_BEEP=1
+# should CAPIDRV be loaded?
+CAPI_LOAD_CAPIDRV=1
diff --git a/net-dialup/capi4k-utils/files/capi.hotplug b/net-dialup/capi4k-utils/files/capi.hotplug
index 9ed7517069ff..00be239e424c 100644
--- a/net-dialup/capi4k-utils/files/capi.hotplug
+++ b/net-dialup/capi4k-utils/files/capi.hotplug
@@ -1,20 +1,41 @@
#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
+# 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.1 2005/03/29 06:43:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.hotplug,v 1.2 2005/03/29 22:16:07 genstef Exp $
. /etc/conf.d/capi
[ "$CAPI_HOTPLUG_USB" = "0" ] && exit 0
+# syslog output
+syslog() { # <msg>
+ /usr/bin/logger -t "capi-usb" "$1"
+}
+
+beep_ok() {
+ [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;1200]\a\033[10;262]" > /dev/console
+}
+
+beep_error() {
+ [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;300]\a\033[10;262]" > /dev/console
+}
+
# driver lookup
cardinfo() { # <driver>
- /bin/sed 2>/dev/null -n "s:^\([1-9][0-9]*\) \+${1} \+\([^ ]\+\) \+\([^ ]\+\).*:\1 \3 \2:p" /proc/capi/controller
+ # /proc/capi/controller: <controller> <drivername> <state> <cardname> <controllerinfo>
+ /bin/sed 2>/dev/null -n "s:^\([1-9][0-9]*\) \+${1} \+\([^ ]\+\) \+\([^ ]\+\) \+\([^ ]\+\):\1 \3 \2 \4:p" /proc/capi/controller
}
# AVM firmware loader
-avmusb() { # <card> <firmware>
- /usr/sbin/avmcapictrl load "/lib/firmware/${2}" "${1}"
+avmusb() { # <driver> <usbdev> <firmware>
+ local CARD NAME STATUS TYPE VER DEV FIRMWARE
+ while read CARD NAME STATUS TYPE VER DEV; do # AVM cardinfo
+ if [ "${STATUS}" = "detected" -a ${DEV} -eq ${2} ]; then
+ syslog "loading firmware ${3} into controller ${CARD} (${NAME})"
+ /usr/sbin/avmcapictrl load "/lib/firmware/${3}" "${CARD}"
+ break
+ fi
+ done < <(cardinfo "${1}")
}
# normalize and split product code
@@ -66,30 +87,46 @@ case "${VENDID}" in
FIRMWARE="fdlubase.frm"
;;
*) # unknown card
- echo "unknown USB product: $VENDID"
+ syslog "unknown USB product: ${VENDID}"
exit 1
esac
case "$ACTION" in
add)
/bin/ln 2>/dev/null -s "$$" "$LOCK" || exit 0
- for MODULE in kernelcapi capi capidrv $DRIVER; do
- /sbin/modprobe -s $MODULE || exit 1
- done
+
+ # loading capi + capidrv
+ ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -sq capi ) && \
+ ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" = "0" ] || /sbin/modprobe -sq capidrv )
+ if [ $? -ne 0 ]; then
+ syslog "could not load CAPI!"
+ beep_error; /bin/rm -f "$LOCK"; exit 1
+ fi
+
+ # loading driver
+ if ! /sbin/modprobe -sq $DRIVER; then
+ syslog "could not load driver ${DRIVER}!"
+ beep_error; /bin/rm -f "$LOCK"; exit 1
+ fi
+
+ # loading firmware
if [ -n "$LOADER" -a -n "$FIRMWARE" ]; then
CNT=0 # wait for udev
while [ ! -e /dev/capi20 -a $CNT -lt 10 ]; do
sleep 1; : $((CNT++))
done
- read CARD NAME STATUS < <(cardinfo $DRIVER)
- [ "$STATUS" = "detected" ] && $LOADER $CARD $FIRMWARE
+ if [ -f "/lib/firmware/${FIRMWARE}" ]; then
+ $LOADER $DRIVER $USBDEV $FIRMWARE
+ else
+ syslog "firmware ${FIRMWARE} not found!"
+ beep_error; /bin/rm -f "$LOCK"; exit 1
+ fi
fi
- [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;1200]\a\033[10;262]" > /dev/console
- /bin/rm -f "$LOCK"
+
+ beep_ok; /bin/rm -f "$LOCK"
;;
remove)
/sbin/modprobe -sqr $DRIVER
- [ "$CAPI_HOTPLUG_BEEP" = "0" ] || echo -en "\033[10;300]\a\033[10;262]" > /dev/console
;;
esac
exit 0
diff --git a/net-dialup/capi4k-utils/files/capi.initd b/net-dialup/capi4k-utils/files/capi.initd
index 9901bc77b6d2..7644eb710a07 100644
--- a/net-dialup/capi4k-utils/files/capi.initd
+++ b/net-dialup/capi4k-utils/files/capi.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
-# Copyright 1999-2004 Gentoo Foundation
+# 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.2 2005/03/29 06:55:24 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/capi4k-utils/files/capi.initd,v 1.3 2005/03/29 22:16:07 genstef Exp $
opts="start stop info"
@@ -9,44 +9,43 @@ depend() {
after coldplug isapnp
}
-get_modules() {
- /usr/bin/cut 2>/dev/null -f2 -d' ' /proc/capi/controller
-}
-
start() {
if [ ! -e /etc/capi.conf ] ; then
eerror "You're missing /etc/capi.conf (comes with a capi-driver)."
- eerror "Emerge net-dialup/fcpci if you are having an AVM Fritz!Card PCI"
+ eerror "Emerge net-dialup/fritzcapi if you are having an AVM Fritz!Card"
return 1
fi
ebegin "Loading CAPI"
- ( [ -f /proc/capi/capi20 ] || /sbin/modprobe capi ) && \
- ( [ -f /proc/capi/capidrv ] || /sbin/modprobe capidrv )
+ ( [ -f /proc/capi/capi20 ] || /sbin/modprobe -s capi ) && \
+ ( [ -f /proc/capi/capidrv -o "$CAPI_LOAD_CAPIDRV" = "0" ] || /sbin/modprobe -s capidrv )
eend $? || return 1
ebegin "Starting CAPI"
-
- CNT=0 # wait for udev
+
+ local CNT=0 # wait for udev
while [ ! -e /dev/capi20 -a $CNT -lt 10 ]; do
sleep 1; : $((CNT++))
done
- if /usr/sbin/capiinit activate ; then
- while read INFO; do einfo " $INFO"; done < /proc/capi/controller
+ if /usr/sbin/capiinit 2>/dev/null activate ; then
+ eindent
+ while read INFO; do einfo "$INFO"; done < /proc/capi/controller
+ eoutdent
fi
eend $?
}
stop() {
- local DRIVERS=$(get_modules)
+ local DRIVERS=$(/usr/bin/cut 2>/dev/null -f1 -d' ' /proc/capi/driver)
- ebegin "Unloading CAPI"
+ ebegin "Stopping CAPI"
/sbin/modprobe -sqr capidrv
/usr/sbin/capiinit 2>/dev/null stop
for DRV in $DRIVERS; do /sbin/modprobe -sqr $DRV; done
+ /sbin/modprobe -sqr capi
eend 0
}