diff options
author | Stefan Briesenick <sbriesen@gentoo.org> | 2005-07-01 22:34:02 +0000 |
---|---|---|
committer | Stefan Briesenick <sbriesen@gentoo.org> | 2005-07-01 22:34:02 +0000 |
commit | a3debfcee5ea56680366c7ad4fdf5e30090f86f8 (patch) | |
tree | 4bb77907b162ab178c991e1004733cded6d5df8a /net-dialup | |
parent | Stable on ppc; Bug #97544. (diff) | |
download | gentoo-2-a3debfcee5ea56680366c7ad4fdf5e30090f86f8.tar.gz gentoo-2-a3debfcee5ea56680366c7ad4fdf5e30090f86f8.tar.bz2 gentoo-2-a3debfcee5ea56680366c7ad4fdf5e30090f86f8.zip |
version bump, fixes/enhancements to init-scripts + configs.
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'net-dialup')
-rw-r--r-- | net-dialup/isdn4k-utils/ChangeLog | 10 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/Manifest | 24 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/config-3.7_pre20050626 | 137 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050626 | 1 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/hisax.conf | 8 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/hisax.initd | 21 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/isdn.confd | 8 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/isdn.initd | 102 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/isdnlog.confd | 20 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/files/isdnlog.initd | 77 | ||||
-rw-r--r-- | net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050626.ebuild | 283 |
11 files changed, 595 insertions, 96 deletions
diff --git a/net-dialup/isdn4k-utils/ChangeLog b/net-dialup/isdn4k-utils/ChangeLog index 6b6c7eb14dec..2dfbbd8cf11f 100644 --- a/net-dialup/isdn4k-utils/ChangeLog +++ b/net-dialup/isdn4k-utils/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-dialup/isdn4k-utils # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/ChangeLog,v 1.40 2005/03/29 08:40:14 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/ChangeLog,v 1.41 2005/07/01 22:34:02 sbriesen Exp $ + +*isdn4k-utils-3.7_pre20050626 (01 Jul 2005) + + 01 Jul 2005; Stefan Briesenick <sbriesen@gentoo.org> + +files/config-3.7_pre20050626, files/hisax.conf, files/hisax.initd, + files/isdn.confd, files/isdn.initd, files/isdnlog.confd, + files/isdnlog.initd, +isdn4k-utils-3.7_pre20050626.ebuild: + version bump, fixes/enhancements to init-scripts + configs. *isdn4k-utils-3.7_pre20050329 (29 Mar 2005) diff --git a/net-dialup/isdn4k-utils/Manifest b/net-dialup/isdn4k-utils/Manifest index a05f472bc274..892874b5e556 100644 --- a/net-dialup/isdn4k-utils/Manifest +++ b/net-dialup/isdn4k-utils/Manifest @@ -1,26 +1,25 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - +MD5 3228eff26df68350870786e4f9026258 isdn4k-utils-3.7_pre20050626.ebuild 9288 MD5 7aeedfc11c7f11f8fc569a4cd2209aed isdn4k-utils-3.7_pre20050329.ebuild 7179 MD5 f7a17127bae62f8a2fd5f3b9bbc8d0ce ChangeLog 11114 MD5 bab835f739889e139f5acaf397d3d875 metadata.xml 215 MD5 5eeb7174364e6bddb64a87d746660f78 isdn4k-utils-3.6_pre20041219-r1.ebuild 7145 -MD5 710720ec1e40152a168e5a1e610c8eed files/isdnlog.confd 399 -MD5 f8f6a4d5dd4e75950256ccf5c8c2bd39 files/isdnlog.initd 1031 +MD5 f42523eea7af7775bccccf93ee175cad files/isdnlog.confd 753 +MD5 80e5b32167eed5ec836ed5a32243caef files/isdnlog.initd 2220 MD5 83190cfc02f5adac34d8c9dbeaa5c6e3 files/ioptions 307 MD5 6896aa81dfefd061abda1c5a4e6576a0 files/digest-isdn4k-utils-3.6_pre20041219-r1 81 MD5 ea30a6607264a8e7b46e63591e849701 files/isdnlog.logrotated 422 -MD5 7df3c56ec0ce4ec5f0b5cfa041429596 files/hisax.initd 5801 +MD5 fcdb88ad15d5ddbe628f6ac831b1230a files/hisax.initd 5787 MD5 620a852c37aaa852e5089d22b3a5a14d files/isdn.blacklist 504 MD5 21b03f01f94e8b006d19e7fe137e4648 files/options.ippp0 669 MD5 9c63ee81524f51cd1b9f419f00708195 files/hisax.usermap 188 MD5 521e30e785f269e397b134eaaedb9072 files/net.ippp0 2412 -MD5 aeecbcf03cb762b60e670eee70fc4913 files/isdn.confd 484 -MD5 a0abd85a99ac6b2faf4cae7b05c013e8 files/isdn.initd 2394 -MD5 daa2198f59b2708507b5ff681ebd4ab7 files/hisax.conf 1325 +MD5 0736da6ed831fadfa4cd90ceee7e41b7 files/isdn.confd 464 +MD5 6ea63cc4ca8e8fffbed55a23b88de42c files/isdn.initd 2713 +MD5 4caf7bc88dbc1b72f5a3602399be2eae files/hisax.conf 1213 MD5 01e75c203125d9976400683136a21687 files/config-3.7_pre20050329 2872 MD5 a077770a61b46a7dbedad0213e5b14c3 files/auerswald.usermap 752 MD5 3ffe8175b16f619144c182f11e3df55d files/digest-isdn4k-utils-3.7_pre20050329 81 +MD5 0ec995fc0e6532f3934b3accad79f8cf files/digest-isdn4k-utils-3.7_pre20050626 81 MD5 f26cdb4ad4237c11b371a7dcb2d89d17 files/3.6_pre20041219/isdnlog.confd 415 MD5 3f7c76a6d63f3677b81157bf9a7e84cd files/3.6_pre20041219/isdnlog.initd 1047 MD5 875318ba2ae375b068d0c7a7c1607e52 files/3.6_pre20041219/ioptions 323 @@ -35,10 +34,3 @@ MD5 0ead941effdcf6061c864112d4a68ccb files/3.6_pre20041219/isdn.confd 500 MD5 229cfd79f14eb291f6bb46b1275d4e0c files/3.6_pre20041219/isdn.initd 2410 MD5 673179cfabf5a9839cfbf81bc2eeb34e files/3.6_pre20041219/hisax.conf 1341 MD5 a077770a61b46a7dbedad0213e5b14c3 files/3.6_pre20041219/auerswald.usermap 752 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.1 (GNU/Linux) - -iD8DBQFCSRSAjiC39V7gKu0RApcFAJ0baV+UazTfH/Njtkt8Pqtcgqua9ACgsaPs -w9e5l7oJbsqnJSOBdi6BjJs= -=LdW6 ------END PGP SIGNATURE----- diff --git a/net-dialup/isdn4k-utils/files/config-3.7_pre20050626 b/net-dialup/isdn4k-utils/files/config-3.7_pre20050626 new file mode 100644 index 000000000000..5e7ea28c5682 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/config-3.7_pre20050626 @@ -0,0 +1,137 @@ +# +# Automatically generated by make menuconfig: don't edit +# + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y + +# +# General configuration +# +CONFIG_BUILDX11=y +CONFIG_KERNELDIR='/usr/src/linux' +CONFIG_BINDIR='/usr/bin' +CONFIG_SBINDIR='/usr/sbin' +CONFIG_CARD_SBINDIR='/usr/sbin' +CONFIG_MANDIR='/usr/share/man' +CONFIG_FIRMWAREDIR='/lib/firmware' +CONFIG_RUNDIR='/var/run' +CONFIG_LOCKDIR='/var/lock' +CONFIG_LOCKFILE='LCK..' +CONFIG_I4LCONFDIR='/etc/isdn' +CONFIG_CONFFILE='isdn.conf' +CONFIG_CALLERIDFILE='callerid.conf' +CONFIG_USERCONFFILE='~/.isdn' +CONFIG_COUNTRYCODE='49' +CONFIG_AREACODE='89' +CONFIG_COUNTRY_PREFIX='+' +CONFIG_AREA_PREFIX='0' +CONFIG_DATADIR='/usr/share/isdn' + +# +# Runtime configuration tools +# +CONFIG_ISDNCTRL=y +CONFIG_ISDNCTRL_CONF=y +CONFIG_ISDNCTRL_TIMRU=y +CONFIG_ISDNCTRL_DWABC_UDP_INFO=y +CONFIG_IPROFD=y +CONFIG_DIVERTCTRL=y + +# +# Card configuration tools +# +CONFIG_HISAXCTRL=y +CONFIG_ICNCTRL=y +# CONFIG_ICNCTRL_DEBUG=y +CONFIG_ACTCTRL=y +CONFIG_PCBITCTL=y +# CONFIG_AVMCAPICTRL is not set +CONFIG_ACTCTRL=y +CONFIG_EICONCTRL=y +CONFIG_LOOPCTRL=y +# CONFIG_LOOPCTRL_DEBUG=y + +# +# Tools for monitoring activity +# +CONFIG_IMON=y +CONFIG_IMONTTY=y +CONFIG_ISDNLOG=y + +# +# Options for isdnlog package +# +CONFIG_ISDNLOG_SERV_PORT=20011 +CONFIG_ISDNLOG_USERFILE='isdnlog.users' +CONFIG_ISDNLOG_CHARGEFILE='charge.dat' +CONFIG_ISDNLOG_LOGFILE='/var/log/isdn.log' +CONFIG_ISDNLOG_RELOADCMD='/etc/init.d/isdn restart' +CONFIG_ISDNLOG_STOPCMD='/etc/init.d/isdn stop' +CONFIG_ISDNLOG_REBOOTCMD='/sbin/reboot' +CONFIG_ISDNLOG_DOCDIR='' +CONFIG_ISDNLOG_OLDI4LCONFDIR='/etc/isdnlog' +CONFIG_ISDNLOG_OLDI4LCONFFILE='isdnlog.conf' +# CONFIG_ISDNLOG_POSTGRES=y +# CONFIG_ISDNLOG_POSTGRESDIR='/usr' +# CONFIG_ISDNLOG_MYSQLDB=y +# CONFIG_ISDNLOG_MYSQLDIR='/usr' +# CONFIG_ISDNLOG_ORACLE=y +CONFIG_ISDN_LOG_XX=y +CONFIG_ISDN_LOG_CC='' +CONFIG_ISDN_LOG_CC_EN=y +CONFIG_ISDN_LOG_DEST_DE=y +CONFIG_ISDN_LOG_DEST_AT=y +CONFIG_ISDN_LOG_DEST_NL=y +CONFIG_ISDN_LOG_DEST_CH=y +CONFIG_ISDN_LOG_DEST_BE=y +CONFIG_ISDN_LOG_DEST_CN=y +CONFIG_IPPPSTATS=y +CONFIG_XISDNLOAD=y +CONFIG_XMONISDN=y + +# +# Options for xmonisdn +# +CONFIG_XMONISDN_UPCMD='/etc/isdn/netup' +CONFIG_XMONISDN_DOWNCMD='/etc/isdn/netdown' + +# +# Applications +# +# CONFIG_VBOX is not set +CONFIG_IPPPD=y + +# +# Options for ipppd +# +CONFIG_IPPPD_MSCHAP=y +CONFIG_IPPP_FILTER=y +# CONFIG_IPPPD_RADIUS=y +# CONFIG_RADIUS_WTMP_LOGGING=y +# RADIUS_CLIENT_CONFIG_FILE='' +# CONFIG_CAPIFAX is not set +# CONFIG_RCAPID is not set +# CONFIG_PPPDCAPIPLUGIN is not set +CONFIG_EUROFILE=y + +# +# Options for eurofile +# +CONFIG_EFTD=y +CONFIG_EFTD_WUAUTH=y +CONFIG_EFTD_SERVER_MSN='' +# CONFIG_EFT_INSTALL_EFTD_SH is not set +CONFIG_EFTP=y +CONFIG_EFTP_READLINE=y +# CONFIG_EFTP_SETUID=y +CONFIG_EFTP_CLIENT_MSN='' +CONFIG_EFT_INSTALL_CONF=y + +# +# Documentation +# +CONFIG_GENMAN=y +# CONFIG_FAQ is not set diff --git a/net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050626 b/net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050626 new file mode 100644 index 000000000000..62011f6db4c6 --- /dev/null +++ b/net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050626 @@ -0,0 +1 @@ +MD5 0a653e1eb665f8a6f8b50bbc160969b3 isdn4k-utils-CVS-2005-06-26.tar.bz2 5649365 diff --git a/net-dialup/isdn4k-utils/files/hisax.conf b/net-dialup/isdn4k-utils/files/hisax.conf index 3e3ef67a75e0..880dc347fade 100644 --- a/net-dialup/isdn4k-utils/files/hisax.conf +++ b/net-dialup/isdn4k-utils/files/hisax.conf @@ -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/isdn4k-utils/files/hisax.conf,v 1.1 2005/03/29 08:40:14 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/hisax.conf,v 1.2 2005/07/01 22:34:02 sbriesen Exp $ # Please read the HiSax kernel documentation first: # /usr/src/linux/Documentation/isdn/README.HiSax @@ -40,8 +40,8 @@ # Sedlbauer Speed Fax+ PCI #28 DSS1 - - - - speedfax -# ASUSTeK ISDNLink P-IN100-ST-D (rev 02) -#35 DSS1 - - - - asustek +# HFC-PCI (see README.hfc-pci) +#35 DSS1 - - - - hfc-pci # AVM Fritz PCI/PnP (fake type, will use hisax_fcpcipnp) #99 DSS1 - - - - diff --git a/net-dialup/isdn4k-utils/files/hisax.initd b/net-dialup/isdn4k-utils/files/hisax.initd index 8502a238f60e..a872d1349608 100644 --- a/net-dialup/isdn4k-utils/files/hisax.initd +++ b/net-dialup/isdn4k-utils/files/hisax.initd @@ -1,9 +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/isdn4k-utils/files/hisax.initd,v 1.1 2005/03/29 08:40:14 mrness Exp $ - -opts="start stop" +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/hisax.initd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $ depend() { use isapnp pcmcia @@ -16,7 +14,7 @@ check_module() { get_first_free_idx() { local -a _idxa local _it _lin _idx=-1 - if ! read _it _lin < <(/usr/bin/head 2>/dev/null -n1 /dev/isdninfo); then + if ! read _it _lin < <(/bin/head 2>/dev/null -n1 /dev/isdninfo); then echo "0"; return fi read -a _idxa < <(echo $_lin) @@ -37,7 +35,7 @@ read_config() { while read H_TYPE H_PROTO H_IO H_IRQ H_MEM H_DEBUG H_ID; do # check and set card id - case ${H_TYPE} in + case "${H_TYPE}" in 99) # AVM Fritz PCI/PnP H_ID="#<FC>#" # fixed later ;; @@ -48,7 +46,7 @@ read_config() { esac # convert protocol to number - case "$H_PROTO" in + case "${H_PROTO}" in [eE][dD][sS][sS]1) H_PROTO_NR=2 ;; # EDSS1 [eE][uU][rR][oO]) H_PROTO_NR=2 ;; # EDSS1 [dD][sS][sS]1) H_PROTO_NR=2 ;; # EDSS1 @@ -75,7 +73,7 @@ read_config() { || HISAX_DEBUG="${HISAX_DEBUG} ${H_ID}%${H_DEBUG//\%}" # build list of cards which needs ISAR.BIN firmware - case ${H_TYPE} in + case "${H_TYPE}" in 28|29) [ -z "${HISAX_FIRMWARE}" ] \ && HISAX_FIRMWARE="${H_ID}" \ || HISAX_FIRMWARE="${HISAX_FIRMWARE} ${H_ID}" @@ -83,7 +81,7 @@ read_config() { esac # build options - case ${H_TYPE} in + case "${H_TYPE}" in 99) # AVM Fritz PCI/PnP if [ -z "${HISAXFC_TYPE}" ]; then HISAXFC_TYPE="${H_TYPE}" @@ -175,6 +173,11 @@ start() { fi eend $? + CNT=0 # wait for udev + while [ ! -e /dev/isdninfo -a $CNT -lt 10 ]; do + sleep 1; : $((CNT++)) + done + if [ -n "${HISAX_FIRMWARE}" ]; then for ID in ${HISAX_FIRMWARE}; do ebegin "Loading firmware to ${ID}" diff --git a/net-dialup/isdn4k-utils/files/isdn.confd b/net-dialup/isdn4k-utils/files/isdn.confd index 95d2b1bc3a4d..99b4d6350270 100644 --- a/net-dialup/isdn4k-utils/files/isdn.confd +++ b/net-dialup/isdn4k-utils/files/isdn.confd @@ -1,6 +1,9 @@ -# 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/isdn4k-utils/files/isdn.confd,v 1.1 2005/03/29 08:40:14 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdn.confd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $ + +# if you have CAPI based cards connected to I4L via CAPIDRV. +DEPEND_ON_CAPI="yes" # Location where isdnctrl will save its configuration ISDNCTRL_CONFIG="/var/lib/isdn/isdnctrl.conf" @@ -8,4 +11,3 @@ ISDNCTRL_CONFIG="/var/lib/isdn/isdnctrl.conf" # Location where iprofd will save the modem-register settings # comment out if you don't want to use iprofd IPROFD_SETTINGS="/var/lib/isdn/modem-register.dat" - diff --git a/net-dialup/isdn4k-utils/files/isdn.initd b/net-dialup/isdn4k-utils/files/isdn.initd index e4e3aa3dad33..2121efd4c326 100644 --- a/net-dialup/isdn4k-utils/files/isdn.initd +++ b/net-dialup/isdn4k-utils/files/isdn.initd @@ -1,41 +1,47 @@ #!/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/isdn4k-utils/files/isdn.initd,v 1.1 2005/03/29 08:40:14 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdn.initd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $ -opts="start stop save reload info show cards" +opts="save reload info" depend() { - use capi hisax + use hisax pcmcia hotplug + [ "$DEPEND_ON_CAPI" = "yes" ] && need capi } -check_cards() { - local -a _idxa - local _it _lin _idx=0 - read _it _lin < <(/usr/bin/head 2>/dev/null -n1 /dev/isdninfo) || return 1 - read -a _idxa < <(echo $_lin) - while [ $_idx -lt 65 ]; do - [ "${_idxa[$_idx]}" = "-" ] || return 0 - : $((_idx+=2)); [ -z "${_idxa[$_idx]}" ] && break +card_list() { # output: <contr> <chan> <card> + local IDMAP=() IDX=1 CONTR=0 LAST='-' CARD='' + read -a IDMAP < <(/bin/head 2>/dev/null -n1 /dev/isdninfo) || return 1 + while [ $IDX -lt ${#IDMAP[*]} ]; do + CARD=${IDMAP[$IDX]} + if [ "$CARD" != "-" -a "$CARD" != "$LAST" ]; then + echo "${CONTR} $((IDX-1)) ${CARD}"; : $((CONTR++)) + fi + LAST="$CARD"; : $((IDX++)) done - return 1 } -check_module() { - /bin/grep 2>/dev/null -q "^${1} " /proc/modules +show_cards() { + local CONTR CHAN CARD CAPI + while read CONTR CHAN CARD; do + case ${CARD} in + capidrv-[1-9]*) + CAPI=$(/bin/sed 2>/dev/null -n "s:^${CARD/capidrv-} \+[^ ]\+ \+[^ ]\+ \+\([^ ]\+\) \+.\+$:\1:p" /proc/capi/controller) + einfo "${1}${CONTR} ${CARD} (${CAPI})" + ;; + *) + einfo "${1}${CONTR} ${CARD}" + ;; + esac + done } start() { - /sbin/modprobe -s isdn && check_module isdn - if [ $? -ne 0 ]; then - eerror "ERROR: could not load ISDN driver" - /sbin/modprobe -sqr isdn - return 1 - fi + local LIST="$(card_list)" - if ! check_cards; then + if [ -z "$LIST" ]; then eerror "ERROR: no ISDN cards available" - /sbin/modprobe -sqr isdn return 1 fi @@ -45,21 +51,40 @@ start() { if [ -n "${IPROFD_SETTINGS}" ]; then ebegin "Starting modem-register daemon" - start-stop-daemon --start --quiet --exec /usr/sbin/iprofd -- "${IPROFD_SETTINGS}" + start-stop-daemon 2>/dev/null --start --quiet --exec /usr/sbin/iprofd -- "${IPROFD_SETTINGS}" eend $? fi + + einfo "Available ISDN cards:" + # eindent -> waiting for new baselayout :-/ + show_cards " " < <(echo "$LIST") + # eoutdent + return 0 } stop() { + # if some other monitoring processes are running + if /bin/fuser 2>/dev/null -s /dev/isdninfo; then + ebegin "Stopping monitoring processes" + /bin/fuser -ks /dev/isdninfo; RET=$?; FCNT=0 + while [ $RET -eq 0 -a $FCNT -lt 10 ]; do + echo -n "."; sleep 0.5; FCNT=$(($FCNT + 1)) + /bin/fuser -s /dev/isdninfo; RET=$? + done + [ $RET -eq 0 ] && eend 1 || eend 0 + fi + if [ -n "${IPROFD_SETTINGS}" ]; then ebegin "Stopping modem-register daemon" - start-stop-daemon --stop --quiet --retry 5 --exec /usr/sbin/iprofd + start-stop-daemon 2>/dev/null --stop --quiet --retry 5 --exec /usr/sbin/iprofd eend $? fi ebegin "Unloading isdnctrl configuration" - /usr/sbin/isdnctrl reset force >/dev/null + /usr/sbin/isdnctrl reset force &>/dev/null eend $? + + return 0 # ignore errors } save() { @@ -75,24 +100,11 @@ reload() { eend $? } -cards() { - local -a _idxa - local _it _lin _idx=0 - if ! read _it _lin < <(/usr/bin/head 2>/dev/null -n1 /dev/isdninfo); then - eerror "ERROR: no ISDN cards available" - return 1 - fi - read -a _idxa < <(echo $_lin) - while [ $_idx -lt 65 ]; do - [ "${_idxa[$_idx]}" = "-" ] || einfo "$((_idx / 2)) ${_idxa[$_idx]}" - : $((_idx+=2)); [ -z "${_idxa[$_idx]}" ] && break - done -} - info() { - /usr/sbin/isdnctrl status all -} - -show() { - /usr/sbin/isdnctrl list all + local LIST="$(card_list)" + if [ -z "$LIST" ]; then + eerror "ERROR: no ISDN cards available" + return 1 + fi + show_cards < <(echo "$LIST") } diff --git a/net-dialup/isdn4k-utils/files/isdnlog.confd b/net-dialup/isdn4k-utils/files/isdnlog.confd index c51551caaa7d..33ea1d6b3375 100644 --- a/net-dialup/isdn4k-utils/files/isdnlog.confd +++ b/net-dialup/isdn4k-utils/files/isdnlog.confd @@ -1,9 +1,21 @@ -# 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/isdn4k-utils/files/isdnlog.confd,v 1.1 2005/03/29 08:40:14 mrness Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdnlog.confd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $ -# here you can add some switches not covered by the -# corresponding /etc/isdnlog.options.contrX file. +# naming conventions +# ~~~~~~~~~~~~~~~~~~ +# An ISDN controller is either identified by controller number, +# by channel number or by name. So you have the following options +# to select your init-script extension: +# +# 1. isdnlog.contrX (selecting by controller number) +# 2. isdnlog.isdnctrlX (selecting by channel number) +# 3. isdnlog.XXXXX (selecting by card name) + +# Here you can add some switches not covered by the +# corresponding /etc/isdn/isdnlog.options.contrX file. +# Of course, instead of 'contrX' you can also use the +# other modifiers mentioned above. # # see "man (8) isdnlog" for further informations diff --git a/net-dialup/isdn4k-utils/files/isdnlog.initd b/net-dialup/isdn4k-utils/files/isdnlog.initd index 555b1816720f..a6c3e73f8341 100644 --- a/net-dialup/isdn4k-utils/files/isdnlog.initd +++ b/net-dialup/isdn4k-utils/files/isdnlog.initd @@ -1,33 +1,82 @@ #!/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/isdn4k-utils/files/isdnlog.initd,v 1.1 2005/03/29 08:40:14 mrness Exp $ - -opts="start stop" +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdnlog.initd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $ depend() { need isdn } +card_list() { # output: <contr> <chan> <card> + local IDMAP=() IDX=1 CONTR=0 LAST='-' CARD='' + read -a IDMAP < <(/bin/head 2>/dev/null -n1 /dev/isdninfo) || return 1 + while [ $IDX -lt ${#IDMAP[*]} ]; do + CARD=${IDMAP[$IDX]} + if [ "$CARD" != "-" -a "$CARD" != "$LAST" ]; then + echo "${CONTR} $((IDX-1)) ${CARD}"; : $((CONTR++)) + fi + LAST="$CARD"; : $((IDX++)) + done +} + +card_info() { + local MASK + case "$1" in + contr[0-9]*) + MASK="^${1#contr*} [0-9]\+ .*\$" + ;; + isdnctrl[0-9]*) + MASK="^[0-9]\+ ${1#isdnctrl*} .*\$" + ;; + *) + MASK="^[0-9]\+ [0-9]\+ ${1}\$" + ;; + esac + /bin/grep "$MASK" <(card_list) +} + start() { - local CONTR="${myservice#*.contr}" CTRL=$((CONTR * 2)) - local CONFIG="/etc/isdn/isdnlog.isdnctrl${CTRL}.options" + local CONTR CHAN CARD TYPE="${myservice#*.*}" + read CONTR CHAN CARD < <(card_info "$TYPE") + + if [ -z "$CARD" ]; then + eerror "ISDNLOG: Selected controller not available (${TYPE})" + return 1 + fi + + # try to find a configuration file + local CONFIG="/etc/isdn/isdnlog.isdnctrl${CHAN}.options" [ -e "$CONFIG" ] || CONFIG="/etc/isdn/isdnlog.options.contr${CONTR}" + [ -e "$CONFIG" ] || CONFIG="/etc/isdn/isdnlog.options.isdnctrl${CHAN}" + [ -e "$CONFIG" ] || CONFIG="/etc/isdn/isdnlog.options.${CARD}" - if [ ! -e "$CONFIG" ] ; then - eerror "You're missing ${CONFIG}" + if [ ! -e "$CONFIG" ]; then + eerror "ISDNLOG: You're missing /etc/isdn/isdnlog.options.${TYPE}" return 1 fi - ebegin "Starting ISDNLOG for controller #${CONTR}" - start-stop-daemon --start --quiet --pidfile "/var/run/isdnlog.isdnctrl${CTRL}.pid" \ - --exec /usr/sbin/isdnlog -- ${ISDNLOG_OPTIONS} -f "${CONFIG}" "/dev/isdnctrl${CTRL}" + rm -f "/var/run/${myservice}" # cleanup + + ebegin "Starting ISDNLOG for controller #${CONTR} (${CARD})" + start-stop-daemon --start --quiet --pidfile "/var/run/isdnlog.isdnctrl${CHAN}.pid" \ + --exec /usr/sbin/isdnlog -- ${ISDNLOG_OPTIONS} -f "${CONFIG}" "/dev/isdnctrl${CHAN}" && \ + echo "${CONTR} ${CHAN} ${CARD} ${CONFIG##*/}" > "/var/run/${myservice}" eend $? } stop() { - local CONTR="${myservice#*.contr}" CTRL=$((CONTR * 2)) - ebegin "Stopping ISDNLOG for controller #${CONTR}" - start-stop-daemon --stop --quiet --retry 5 --pidfile "/var/run/isdnlog.isdnctrl${CTRL}.pid" + if [ ! -f "/var/run/${myservice}" ]; then + eerror "ISDNLOG: Controller setup not found (${myservice#*.*})" + return 1 + fi + + local CONTR CHAN CARD CONF + read CONTR CHAN CARD CONF < "/var/run/${myservice}" + + ebegin "Stopping ISDNLOG for controller #${CONTR} (${CARD})" + start-stop-daemon --stop --quiet --retry 5 --pidfile "/var/run/isdnlog.isdnctrl${CHAN}.pid" eend $? + + rm -f "/var/run/${myservice}" + return 0 # ignore errors } diff --git a/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050626.ebuild b/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050626.ebuild new file mode 100644 index 000000000000..45d225f70cc5 --- /dev/null +++ b/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050626.ebuild @@ -0,0 +1,283 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050626.ebuild,v 1.1 2005/07/01 22:34:02 sbriesen Exp $ + +inherit eutils linux-info multilib gnuconfig + +MY_PV="${PV/*_pre/}" +MY_P="${PN}-CVS-${MY_PV:0:4}-${MY_PV:4:2}-${MY_PV:6:2}" + +DESCRIPTION="ISDN4Linux Utils" +SRC_URI="ftp://ftp.isdn4linux.de/pub/isdn4linux/CVS-Snapshots/${MY_P}.tar.bz2" +HOMEPAGE="http://www.isdn4linux.de/" + +KEYWORDS="~x86 ~amd64 ~alpha" +LICENSE="GPL-2" +IUSE="X unicode ipppd isdnlog eurofile" +#IUSE="X unicode ipppd isdnlog eurofile mysql postgres oracle" +SLOT="0" + +# mysql? ( dev-db/mysql ) +# oracle? ( dev-db/oracle-instantclient-basic ) +# postgres? ( dev-db/postgresql ) + +DEPEND="virtual/linux-sources + virtual/libc + sys-libs/ncurses + sys-libs/gdbm + dev-lang/tcl + X? ( virtual/x11 )" +RDEPEND="${DEPEND} + virtual/modutils + ipppd? ( net-dialup/ppp )" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + CONFIG_CHECK="PPP" + linux-info_pkg_setup + + # Get country code from I4L_CC variable + # default country: DE (Germany) + I4L_CC=$(echo -n "${I4L_CC}" | tr "[:lower:]" "[:upper:]") + [ -z "${I4L_CC}" ] && I4L_CC="DE" + I4L_CC_LOW=$(echo -n "${I4L_CC}" | tr "[:upper:]" "[:lower:]") + + # Get language from I4L_LANG variable ('de' or 'en') + I4L_LANG=$(echo -n "${I4L_CC}" | tr "[:lower:]" "[:upper:]") + if [ -z "${I4L_LANG}" ]; then + case "${I4L_CC}" in + AT|CH|DE) + I4L_LANG="DE" + ;; + *) + I4L_LANG="EN" + ;; + esac + fi + [ "${I4L_LANG}" = "DE" -o "${I4L_LANG}" = "EN" ] || I4L_LANG="EN" +} + +src_unpack() { + unpack ${A} + cd ${S} + + # patch all Makefiles to use our CFLAGS + find . -name "Makefile*" -type f | \ + xargs -r sed -i -e "s:^\(CFLAGS.*=.*-Wall\) -O2:\1 \$(MYCFLAGS):g" \ + -e "s:^\(CFLAGS.*=.*\) -O[26] -fomit-frame-pointer:\1 \$(MYCFLAGS):g" \ + -e "s:^\(CFLAGS.*=.*\) -fomit-frame-pointer -O2:\1 \$(MYCFLAGS):g" \ + -e "s:^\(CFLAGS.*=.*\) -g -Wall:\1 \$(MYCFLAGS) -Wall:g" \ + -e "s:^\(CFLAGS.*=.*\) -Wall -g:\1 -Wall \$(MYCFLAGS):g" \ + -e "s:^\(CFLAGS.*=.*-Wall.*\) -O2 -g:\1 \$(MYCFLAGS):g" \ + -e "s:^\(CFLAGS.*= -Wall\)$:\1 \$(MYCFLAGS):g" \ + -e "s:^\(CFLAGS.*=\) -g$:\1 \$(MYCFLAGS):g" || die "sed failed" + + # install our config + case "${I4L_CC}" in + DE|AT|NL|LU|CH) + # These countries are specially supported in the isdnlog source. + sed -e "s:^CONFIG_ISDN_LOG_XX=:CONFIG_ISDN_LOG_${I4L_CC}=:g" \ + -e "s:^\(CONFIG_ISDN_LOG_CC_\)..=:\1${I4L_LANG}=:g" \ + -e "s:^CONFIG_ISDN_LOG_CC=.*$:#:g" \ + < ${FILESDIR}/config-${PV} > .config || die "failed to modify .config" + ;; + *) + # Others get a generic isdnlog. + sed -e "s:^\(CONFIG_ISDN_LOG_CC=\).*$:\1'${I4L_CC_LOW}':g" \ + -e "s:^\(CONFIG_ISDN_LOG_CC_\)..=:\1${I4L_LANG}=:g" \ + < ${FILESDIR}/config-${PV} > .config || die "failed to modify .config" + ;; + esac + + # build X clients + useq X || \ + sed -i -e "s:^\(CONFIG_BUILDX11=.*\)$:# \1:g" \ + -e "s:^\(CONFIG_XISDNLOAD=.*\)$:# \1:g" \ + -e "s:^\(CONFIG_XMONISDN=.*\)$:# \1:g" .config + + # build ipppd + useq ipppd || \ + sed -i -e "s:^\(CONFIG_IPPPD=.*\)$:# \1:g" \ + -e "s:^\(CONFIG_IPPPSTATS=.*\)$:# \1:g" .config + + # build isdnlog + useq isdnlog || sed -i -e "s:^\(CONFIG_ISDNLOG=.*\)$:# \1:g" .config + + # build eurofile (etf) + useq eurofile || sed -i -e "s:^\(CONFIG_EUROFILE=.*\)$:# \1:g" .config + + # selecting database support for isdnlog (only ONE is possible) + #useq mysql || sed -i -e "s:^\(CONFIG_ISDNLOG_MYSQL.*=.*\)$:# \1:g" .config + #useq oracle || sed -i -e "s:^\(CONFIG_ISDNLOG_ORACLE.*=.*\)$:# \1:g" .config + #useq postgres || sed -i -e "s:^\(CONFIG_ISDNLOG_POSTGRES.*=.*\)$:# \1:g" .config + + # Patch in order to make generic config for countries which are not known to isdnlog source + sed -i -e "s:\$(INSTALL_DATA) rate-:-\$(INSTALL_DATA) rate-:g" \ + -e "s:\$(INSTALL_DATA) holiday-:-\$(INSTALL_DATA) holiday-:g" isdnlog/Makefile.in + + # Patch path to isdnlog docs + sed -i -e "s:^\(CONFIG_ISDNLOG_DOCDIR=\).*$:\1'/usr/share/doc/${PF}/isdnlog':g" .config + + # add --libdir to configure call in Makefile + sed -i -e "s:\(\./configure \):\1--libdir=/usr/$(get_libdir) :g" Makefile + + # Fixing /usr/lib to /usr/$(get_libdir} (for multilib-strict) + sed -i -e "s:/usr/lib:/usr/$(get_libdir):g" isdnctrl/Makefile.in + + # disable creation of /dev nodes + sed -i -e "s:\(sh scripts/makedev.sh\):echo \1:g" Makefile + sed -i -e "s:^\([[:space:]]*\)\(.*mknod.*capi20.*\)\$:\1# \2:g" \ + -e "s:^\([[:space:]]*\)\(.*rm.*capi20.*\)\$:\1# \2:g" \ + -e "s:^\([[:space:]]*\)\(.*chgrp.*capi20.*\)\$:\1true # \2:g" scripts/makedev.sh + + # if specified, convert all relevant files from latin1 to UTF-8 + if useq unicode; then + einfo "Converting configs and docs to UTF-8" + for i in isdnlog/samples/{isdn,rate}.conf* isdnlog/*-??.dat isdnlog/{Isdn,.country-alias}; do + iconv -f latin1 -t utf8 -o "${i}~" "${i}" && mv -f "${i}~" "${i}" || rm -f "${i}~" + done + fi +} + +src_compile() { + gnuconfig_update + for i in eicon; do + cd $i && autoconf || \ + die "autoconf failed in dir $i" + cd .. + done + make MYCFLAGS="$CFLAGS" subconfig || die "make subconfig failed" + make MYCFLAGS="$CFLAGS" || die "make failed" +} + +src_install() { + keepdir /var/lib/isdn + dodir /etc/conf.d /lib/firmware /usr/sbin + + useq isdnlog && dodir /usr/share/isdn + (useq isdnlog || useq eurofile) && dodir /etc/isdn + (useq X || useq isdnlog || useq eurofile) && dodir /usr/bin + + make DESTDIR=${D} install || die "make install failed" + + # move leftover firmware files to the right place + mv -f ${D}/usr/share/isdn/{*.bin,*.btl,ISAR.BIN} ${D}/lib/firmware/ + rmdir --ignore-fail-on-non-empty ${D}/usr/share/isdn + + # remove obsolete firmware files (these are in net-dialup/isdn-firmware) + rm -f ${D}/lib/firmware/{bip1120,dnload,ds4bri,dspdload,loadpg,pc_??_ca,prload,te_????}.* + + # install autoload/hotplug blacklist + insinto /etc/hotplug/blacklist.d + newins ${FILESDIR}/isdn.blacklist isdn + + # install init-scripts + configs + newinitd ${FILESDIR}/isdn.initd isdn + newconfd ${FILESDIR}/isdn.confd isdn + newinitd ${FILESDIR}/hisax.initd hisax + insinto /etc + doins ${FILESDIR}/hisax.conf + + # install docs (base) + dodoc NEWS README Mini-FAQ/isdn-faq.txt scripts/makedev.sh FAQ/_howto/xp* + + # install ipppd stuff + if useq ipppd; then + newinitd ${FILESDIR}/net.ippp0 net.ippp0 + insinto /etc/ppp + doins ${FILESDIR}/{ioptions,options.ippp0} + docinto ipppd + dodoc LEGAL.ipppcomp ipppd/{README,README.*.ORIG,NOTES.IPPPD} ipppcomp/README.LZS # ipppd/README.RADIUS + docinto ipppd/example + dodoc FAQ/_example/*.txt + docinto ipppd/howto + dodoc FAQ/_howto/{dns*,i4l_ipx*,isdn*,lan*,leased*,masq*,mppp*,ppp*,route*} + fi + + # install isdnlog stuff + if useq isdnlog; then + newinitd ${FILESDIR}/isdnlog.initd isdnlog.contr0 + newconfd ${FILESDIR}/isdnlog.confd isdnlog.contr0 + + insinto /usr/share/isdn + doins isdnlog/*.dat + + insinto /etc/logrotate.d + newins ${FILESDIR}/isdnlog.logrotated isdnlog + + insinto /etc/isdn # install example isdnlog configs + cp -f ${D}/etc/isdn/isdnlog.isdnctrl0.options ${D}/etc/isdn/isdnlog.options.example + mv -f ${D}/etc/isdn/isdnlog.isdnctrl0.options ${D}/etc/isdn/isdnlog.options.contr0 + doins isdnlog/samples/{isdn,rate}.conf.{at,de,lu,nl,no,pl} + newins isdnlog/samples/isdn.conf isdn.conf.unknown + if [ -f isdnlog/samples/isdn.conf.${I4L_CC_LOW} ]; then + newins isdnlog/samples/isdn.conf.${I4L_CC_LOW} isdn.conf + else + doins isdnlog/samples/isdn.conf + fi + if [ -f isdnlog/samples/rate.conf.${I4L_CC_LOW} ]; then + newins isdnlog/samples/rate.conf.${I4L_CC_LOW} rate.conf + fi + sed -i -e "s:/usr/lib/isdn/:/usr/share/isdn/:g" ${D}/etc/isdn/isdn.conf* + + docinto isdnlog + dodoc isdnlog/{BUGS,CREDITS,FAQ,Isdn,NEWS,README*,TODO} + dodoc FAQ/_howto/win* isdnlog/samples/provider + docinto isdnlog/areacode + dodoc areacode/*.doc + docinto isdnlog/contrib/isdnbill + dodoc isdnlog/contrib/isdnbill/{*.isdnbill,*.gz} + docinto isdnlog/contrib/winpopup + dodoc isdnlog/contrib/winpopup/* + + #if useq oracle; then + # docinto isdnlog/oracle + # dodoc isdnlog/isdnlog/oracle/*.sql + #fi + fi + + # install eurofile stuff + if useq eurofile; then + docinto eurofile + dodoc eurofile/{CHANGES,INSTALL,README*,TODO} + newdoc eurofile/src/wuauth/README README.AUTHLIB + docinto eurofile/scripts + dodoc eurofile/scripts/{eft_useradd,check_system,ix25test,eftd.sh,eftp.sh} + fi +} + +pkg_postinst() { + # creating device-nodes (bah! should be handled by udev!) + [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || \ + sh 2>/dev/null < <(zcat /usr/share/doc/${PF}/makedev.sh.gz) + + einfo + einfo "Please edit:" + einfo + einfo "- /etc/hisax.conf if you have hisax supported cards" + einfo "- /etc/ppp/* critical if you need networking" + einfo + if useq isdnlog; then + einfo "For isdnlog you should edit:" + einfo + einfo "- /etc/conf.d/isdnlog.contr0" + einfo "- /etc/isdn/isdnlog.options.contr0" + einfo "- /etc/isdn/*.conf" + einfo + fi + einfo "/etc/init.d/isdn will save and restore your isdnctrl config." + einfo "it will also handle the modem-register daemon." + einfo + if useq ipppd; then + einfo "/etc/init.d/net.ippp0 will start synchronous PPP connections" + einfo "which you need to set up using isdnctrl first!" + einfo + fi + if useq isdnlog; then + einfo "/etc/init.d/isdnlog.contr0 starts and stops isdnlog for contr0" + einfo "You can symlink it to isdnlog.contr1 and copy the corresponding" + einfo "configs if you have more than one card." + einfo + fi +} |