adding lots of USE flags, checking kernel options, reworked init-scripts, added pcmci...
authorStefan Briesenick <sbriesen@gentoo.org>
Sat, 3 Sep 2005 20:56:26 +0000 (20:56 +0000)
committerStefan Briesenick <sbriesen@gentoo.org>
Sat, 3 Sep 2005 20:56:26 +0000 (20:56 +0000)
Package-Manager: portage-2.0.51.22-r2

20 files changed:
net-dialup/isdn4k-utils/ChangeLog
net-dialup/isdn4k-utils/Manifest
net-dialup/isdn4k-utils/files/auerswald.usermap
net-dialup/isdn4k-utils/files/config-3.7_pre20050821 [new file with mode: 0644]
net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050821 [new file with mode: 0644]
net-dialup/isdn4k-utils/files/hisax.conf
net-dialup/isdn4k-utils/files/hisax.initd
net-dialup/isdn4k-utils/files/hisax.usermap
net-dialup/isdn4k-utils/files/ioptions
net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch [new file with mode: 0644]
net-dialup/isdn4k-utils/files/isdn.blacklist
net-dialup/isdn4k-utils/files/isdn.confd
net-dialup/isdn4k-utils/files/isdn.initd
net-dialup/isdn4k-utils/files/isdn.pcmcia [new file with mode: 0644]
net-dialup/isdn4k-utils/files/isdn.pcmcia.conf [new file with mode: 0644]
net-dialup/isdn4k-utils/files/isdnlog.confd
net-dialup/isdn4k-utils/files/isdnlog.initd
net-dialup/isdn4k-utils/files/isdnlog.logrotated
net-dialup/isdn4k-utils/files/options.ippp0
net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050821.ebuild [new file with mode: 0644]

index 4592eed81d4c88f3bad7fdd94b37da6f9295793a..aedbb8e289dd456fdd971508a423c925ca004972 100644 (file)
@@ -1,6 +1,20 @@
 # 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.44 2005/09/03 20:41:21 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/ChangeLog,v 1.45 2005/09/03 20:56:26 sbriesen Exp $
+
+*isdn4k-utils-3.7_pre20050821 (03 Sep 2005)
+
+  03 Sep 2005; Stefan Briesenick <sbriesen@gentoo.org>
+  +files/ipppd-pcap-0.9.3.patch, +files/config-3.7_pre20050821,
+  files/auerswald.usermap, files/hisax.conf, files/hisax.initd,
+  files/hisax.usermap, files/ioptions, files/isdn.blacklist,
+  files/isdn.confd, files/isdn.initd, +files/isdn.pcmcia,
+  +files/isdn.pcmcia.conf, files/isdnlog.confd, files/isdnlog.initd,
+  files/isdnlog.logrotated, files/options.ippp0,
+  +isdn4k-utils-3.7_pre20050821.ebuild:
+  adding lots of USE flags, checking kernel options, reworked init-scripts,
+  added pcmcia support for kernels < 2.6.13 (new pcmcia support will follow
+  soon), fixed pcap-0.9.3 issue (see bug 99190).
 
   03 Sep 2005; Stefan Briesenick <sbriesen@gentoo.org> metadata.xml,
   -isdn4k-utils-3.7_pre20050329.ebuild, isdn4k-utils-3.7_pre20050626.ebuild:
index 6dbcf87dd0fed4000ffc0579aad6de2d663b2134..604f489b18e5203065990cdeb0efbd8c6a031cbd 100644 (file)
@@ -1,24 +1,30 @@
 MD5 feee5c40e3619fe18a532086f1c13929 isdn4k-utils-3.7_pre20050626.ebuild 9401
-MD5 8298775c0cdaffb68452b882b04c8822 ChangeLog 11913
+MD5 3f52561800c5a07870522e2760ad559c isdn4k-utils-3.7_pre20050821.ebuild 10346
+MD5 d618b4ae5a3d2c78e70d0612d3511b39 ChangeLog 12620
 MD5 41bb308eb7db7d75c04a60f8cfb73be3 metadata.xml 418
 MD5 5eeb7174364e6bddb64a87d746660f78 isdn4k-utils-3.6_pre20041219-r1.ebuild 7145
-MD5 783ec6d5ce0fb40b310ae48e2de64348 files/isdnlog.confd 860
-MD5 ef3a37b1c8d2efcdb2d67b9fd8024a18 files/isdnlog.initd 2327
-MD5 83190cfc02f5adac34d8c9dbeaa5c6e3 files/ioptions 307
+MD5 64c78da4643b660b18da623dcf0d9826 files/isdnlog.confd 679
+MD5 8f84f8daae8d5655d6da26d18dce0626 files/isdnlog.initd 2418
+MD5 92412760dfacc81cfac908d522ac8e39 files/ioptions 86
+MD5 9898159595a17b492bb241b959f5f074 files/ipppd-pcap-0.9.3.patch 1590
 MD5 6896aa81dfefd061abda1c5a4e6576a0 files/digest-isdn4k-utils-3.6_pre20041219-r1 81
-MD5 ea30a6607264a8e7b46e63591e849701 files/isdnlog.logrotated 422
-MD5 32928ad4aa70eb4764f57baae475543e files/hisax.initd 5892
-MD5 620a852c37aaa852e5089d22b3a5a14d files/isdn.blacklist 504
-MD5 21b03f01f94e8b006d19e7fe137e4648 files/options.ippp0 669
-MD5 9c63ee81524f51cd1b9f419f00708195 files/hisax.usermap 188
+MD5 e56d47fcff15cbd8278b196cdffd7433 files/isdnlog.logrotated 191
+MD5 f04fcf14f44566a2ca0719204ed87e4a files/hisax.initd 6556
+MD5 f7290656d6dcbd0ec40f00e3d797f79d files/isdn.blacklist 356
+MD5 48266d44ebe70519d3fc67a6b0e260ff files/options.ippp0 443
+MD5 649d35c1add6b0d84e4280a432074351 files/hisax.usermap 122
+MD5 01f12d0a19d1304719792797f8977782 files/isdn.pcmcia.conf 4581
 MD5 521e30e785f269e397b134eaaedb9072 files/net.ippp0 2412
-MD5 99d61282daf6ef29dacefeaf666d3165 files/isdn.confd 568
-MD5 078c362ad4602156e0d4e1258d84c6a9 files/isdn.initd 2817
-MD5 4f88056cd66f6651639f8c05a2f7070f files/hisax.conf 1317
+MD5 6e0925cc6a39e1aa656b143bf4fc75f6 files/isdn.confd 634
+MD5 cd9fbe733c2252c425ca6961aea2b6fc files/isdn.initd 3820
+MD5 86576c4c0ae856485125ae3ae08c973d files/hisax.conf 1144
+MD5 fc829217e8c183d2ab6e9b6dd5dd50e6 files/isdn.pcmcia 523
 MD5 01e75c203125d9976400683136a21687 files/config-3.7_pre20050329 2872
 MD5 1485ac448762742431e425a8a9633caf files/config-3.7_pre20050626 2776
-MD5 a077770a61b46a7dbedad0213e5b14c3 files/auerswald.usermap 752
+MD5 6ac41911cd731019286016727a61f5ac files/config-3.7_pre20050821 2781
+MD5 857c709217075d76229be25e413710d9 files/auerswald.usermap 397
 MD5 0ec995fc0e6532f3934b3accad79f8cf files/digest-isdn4k-utils-3.7_pre20050626 81
+MD5 58808a3af01ef0246beb7d1b038c3faa files/digest-isdn4k-utils-3.7_pre20050821 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
index 846c04b349bf9643703c67c50b86116e16d0b45f..9d9f177ce0e966d2a270a2da2de4d207bf14353c 100644 (file)
@@ -1,4 +1,6 @@
-auerswald            0x0003      0x09bf   0x00c0    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
-auerswald            0x0003      0x09bf   0x00db    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
-auerswald            0x0003      0x09bf   0x00f1    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
-auerswald            0x0003      0x09bf   0x00f2    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+# /etc/hotplug/usb/capi.usermap
+
+auerswald  0x0003   0x09bf 0x00c0   0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
+auerswald  0x0003   0x09bf 0x00db   0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
+auerswald  0x0003   0x09bf 0x00f1   0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
+auerswald  0x0003   0x09bf 0x00f2   0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
diff --git a/net-dialup/isdn4k-utils/files/config-3.7_pre20050821 b/net-dialup/isdn4k-utils/files/config-3.7_pre20050821
new file mode 100644 (file)
index 0000000..bf4875c
--- /dev/null
@@ -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/isdn'
+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_pre20050821 b/net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050821
new file mode 100644 (file)
index 0000000..f0dac96
--- /dev/null
@@ -0,0 +1 @@
+MD5 dcbe134eb8d4a4aea4a24a180a129c93 isdn4k-utils-CVS-2005-08-21.tar.bz2 5650794
index 880dc347fadec08bad257d495a1a4986209d5d6d..4c2ae52de9c808ae412db818126cb7d04c4ea853 100644 (file)
@@ -1,14 +1,12 @@
-# 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.2 2005/07/01 22:34:02 sbriesen Exp $
-
+# /etc/hisax.conf - HiSax configuration file 
+#
 # Please read the HiSax kernel documentation first:
 # /usr/src/linux/Documentation/isdn/README.HiSax
 #
 # Then uncomment your cards below or add your own settings.
 # If you want your specific card to be added to the list
 # below, then drop me a line with your settings:
-# Stefan Briesenick <sbriesen@gmx.de>
+# Stefan Briesenick <sbriesen@gentoo.org>
 
 # 'proto' can be: 1TR6 DSS1 NI1 LEASED
 # 'debug' is optional, default is 4 (D-Channel Frames for isdnlog)
index a872d1349608d9011a713c94d682a638723b4685..9d4eb062f5fd5101179ac022d4fbd2d0c6bea23c 100644 (file)
@@ -1,12 +1,26 @@
 #!/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/isdn4k-utils/files/hisax.initd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/hisax.initd,v 1.3 2005/09/03 20:56:26 sbriesen Exp $
 
 depend() {
         use isapnp pcmcia
 }
 
+# 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
+}
+
 check_module() {
        /bin/grep 2>/dev/null -q "^${1} " /proc/modules
 }
@@ -17,8 +31,8 @@ get_first_free_idx() {
        if ! read _it _lin < <(/bin/head 2>/dev/null -n1 /dev/isdninfo); then
                echo "0"; return
        fi
-       read -a _idxa < <(echo $_lin)
-       while [ $_idx -lt 65 ]; do
+       read -a _idxa < <(echo ${_lin})
+       while [ ${_idx} -lt 65 ]; do
                : $((_idx++))
                if [ "${_idxa[$_idx]}" = "-" ]; then
                        echo $((_idx / 2)); return
@@ -120,18 +134,18 @@ read_config() {
        done < <(/bin/sed 2>/dev/null -ne "s:^[[:space:]]*\([1-9][0-9]\?[[:space:]]\+[^#]*\)[#]*.*$:\1:p" "$@")
 
        # build final hisax options
-       if [ -n "$HISAX_TYPE" ]; then
+       if [ -n "${HISAX_TYPE}" ]; then
                HISAX_OPTIONS="type=${HISAX_TYPE}"
-               [ "$HISAX_IRQ" = "$HISAX_DUMMY" ] || HISAX_OPTIONS="${HISAX_OPTIONS} irq=${HISAX_IRQ}"
-               [ "$HISAX_IO"  = "$HISAX_DUMMY" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io=${HISAX_IO}"
-               [ "$HISAX_IO0" = "$HISAX_DUMMY" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io0=${HISAX_IO0}"
-               [ "$HISAX_IO1" = "$HISAX_DUMMY" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io1=${HISAX_IO1}"
-               [ "$HISAX_MEM" = "$HISAX_DUMMY" ] || HISAX_OPTIONS="${HISAX_OPTIONS} mem=${HISAX_MEM}"
+               [ "${HISAX_IRQ}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} irq=${HISAX_IRQ}"
+               [ "${HISAX_IO}"  = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io=${HISAX_IO}"
+               [ "${HISAX_IO0}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io0=${HISAX_IO0}"
+               [ "${HISAX_IO1}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} io1=${HISAX_IO1}"
+               [ "${HISAX_MEM}" = "${HISAX_DUMMY}" ] || HISAX_OPTIONS="${HISAX_OPTIONS} mem=${HISAX_MEM}"
                HISAX_OPTIONS="${HISAX_OPTIONS} protocol=${HISAX_PROTO} id=${HISAX_ID}"
        fi
 
        # build final hisax_fcpcipnp options
-       if [ -n "$HISAXFC_TYPE" ]; then
+       if [ -n "${HISAXFC_TYPE}" ]; then
                HISAXFC_OPTIONS="protocol=${HISAXFC_PROTO}"
        fi
 
@@ -139,7 +153,7 @@ read_config() {
 }
 
 start() {
-       if [ ! -e /etc/hisax.conf ]; then
+       if [ ! -f /etc/hisax.conf ]; then
                eerror "You're missing /etc/hisax.conf"
                return 1
        fi
@@ -173,16 +187,22 @@ start() {
        fi
        eend $?
 
-       CNT=0  # wait for udev
-       while [ ! -e /dev/isdninfo -a $CNT -lt 10 ]; do
-               sleep 1; : $((CNT++))
-       done
+       # create ISDN devices if necessary
+       [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || /etc/init.d/isdn makedev
 
        if [ -n "${HISAX_FIRMWARE}" ]; then
                for ID in ${HISAX_FIRMWARE}; do
-                       ebegin "Loading firmware to ${ID}"
-                       /usr/sbin/hisaxctrl ${ID} 9 /lib/firmware/ISAR.BIN
-                       if ! eend $?; then
+                       FW=$(findfw "ISAR.BIN")
+                       if [ -n "${FW}" ]; then
+                               ebegin "Loading firmware '${FW##*/}' onto ${ID}"
+                               /usr/sbin/hisaxctrl "${ID}" 9 "${FW}"
+                               if ! eend $?; then
+                                       /sbin/modprobe -sqr hisax_fcpcipnp
+                                       /sbin/modprobe -sqr hisax
+                                       return 1
+                               fi
+                       else
+                               eerror "Firmware 'ISAR.BIN' not found in ${FWDIRS[0]}"
                                /sbin/modprobe -sqr hisax_fcpcipnp
                                /sbin/modprobe -sqr hisax
                                return 1
@@ -190,7 +210,7 @@ start() {
                done
        fi
 
-       CARDS=""
+       local CARDS="" ID VAL
        if [ -n "${HISAX_DEBUG}" ]; then
                for DBG in ${HISAX_DEBUG}; do
                        ID="${DBG%%\%*}"
@@ -199,7 +219,7 @@ start() {
                                ID="fcpcipnp${HISAX_CNT}"
                                : $((HISAX_CNT++))
                        fi
-                       /usr/sbin/hisaxctrl ${ID} 1 ${VAL}
+                       /usr/sbin/hisaxctrl "${ID}" 1 "${VAL}"
                        [ -z "${CARDS}" ] && CARDS="${ID}" || CARDS="${CARDS} ${ID}"
                done
        fi
@@ -212,4 +232,3 @@ stop() {
        /sbin/modprobe -sqr hisax_fcpcipnp && /sbin/modprobe -sqr hisax
        eend $?
 }
-
index 62290f15e5177029bed3f9ff8212ed749703aaa6..9219619cc5f33eda1a3d9c40f763a9257ef87513 100644 (file)
@@ -1 +1,3 @@
-hisax                0x0003      0x0483   0x4810    0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000
+# /etc/hotplug/usb/hisax.usermap
+
+hisax   0x0003   0x0483 0x4810   0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
index 60a59c22dd0bfebef3739509591089fbaec9f610..39cd232ddabae06c68c2976408a94f53930614e4 100644 (file)
@@ -1,6 +1,2 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/ioptions,v 1.1 2005/03/29 08:40:14 mrness Exp $
-
 # System-wide configuration for ipppd.
 # Normally, put all options into options.ipppX
diff --git a/net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch b/net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch
new file mode 100644 (file)
index 0000000..df4b85b
--- /dev/null
@@ -0,0 +1,51 @@
+--- ipppd/options.c.orig       2005-08-07 15:47:50.000000000 +0200
++++ ipppd/options.c    2005-08-21 00:01:06.000000000 +0200
+@@ -2633,6 +2633,10 @@
+ 
+ #ifdef IPPP_FILTER
+ 
++#if !defined(DLT_PPP_WITHDIRECTION) && defined(DLT_PPP_WITH_DIRECTION)
++#define DLT_PPP_WITHDIRECTION DLT_PPP_WITH_DIRECTION
++#endif
++      
+ #ifndef DLT_PPP_PPPD
+ #define DLT_PPP_PPPD  DLT_PPP
+ #warning "please update your pcap version to support in/outbound DLT_PPP_PPPD filter"
+@@ -2646,9 +2650,17 @@
+     int argc;
+     char **argv;
+ {
+-    if (pcap_compile_nopcap(65535, DLT_PPP_PPPD, &pass_filter, *argv, 1, netmask) == 0)
++    pcap_t* pc = pcap_open_dead (DLT_PPP_WITHDIRECTION, PPP_HDRLEN);
++    if (!pc) {
++        option_error("error in pass-filter expression: pcap_open_dead failed\n");
++        return 0;
++    }
++    if (pcap_compile(pc, &pass_filter, *argv, 1, netmask) == 0) {
++        pcap_close(pc);
+         return 1;
++    }
+     option_error("error in pass-filter expression.\n");
++    pcap_close(pc);
+     return 0;
+ }
+ 
+@@ -2660,9 +2672,17 @@
+     int argc;
+     char **argv;
+ {
+-    if (pcap_compile_nopcap(65535, DLT_PPP_PPPD, &active_filter, *argv, 1, netmask) == 0)
++    pcap_t* pc = pcap_open_dead (DLT_PPP_WITHDIRECTION, PPP_HDRLEN);
++    if (!pc) {
++        option_error("error in active-filter expression: pcap_open_dead failed\n");
++        return 0;
++    }
++    if (pcap_compile(pc, &active_filter, *argv, 1, netmask) == 0) {
++        pcap_close(pc);
+         return 1;
++    }
+     option_error("error in active-filter expression.\n");
++    pcap_close(pc);
+     return 0;
+ }
+ #endif /* IPPP_FILTER */
index 1c788e5923b7eea84ec8441d6e992630cb0beceb..28e9b019df35f4c77dc256f487504e701ab1c686 100644 (file)
@@ -1,20 +1,20 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdn.blacklist,v 1.1 2005/03/29 08:40:14 mrness Exp $
+# /etc/hotplug/blacklist.d/isdn
 
-# ISDN modules are load from /etc/init.d/{isdn,hisax}
-#auerswald
-#divas
-#act2000
-#hfc_usb
+# handled by /etc/init.d/hisax
 hisax
 hisax_fcpcipnp
 hisax_st5481
+
+# handled by hotplug. But it's disabled by default, because mISDN
+# also offers a CAPI 'hfcsusb' module which should be preferred.
+hfc_usb
+
+# temporarily disabled, because we need an init-script first
+#auerswald
+#divas
+#act2000
 #hysdn
 #icn
 #pcbit
 #sc
 #tpam
-
-# 2004-12-19 Stefan Briesenick <sbriesen@gmx.de>
-# some modules temporarily disabled, because we need an init-script first
index 99b4d63502700aebc5732242aea847ac9c0958cd..de4b15b4932c17e5f83ffb5089375203800f7adf 100644 (file)
@@ -1,13 +1,21 @@
-# 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.2 2005/07/01 22:34:02 sbriesen Exp $
+# configuraton file for /etc/init.d/isdn
 
-# if you have CAPI based cards connected to I4L via CAPIDRV.
+# if you have CAPI based cards connected to I4L via 'capidrv'
 DEPEND_ON_CAPI="yes"
 
+# How many ISDN channels should be used. On UDEV this limit
+# will be used to create the device nodes in /dev.
+# chan = cards * 2 (max = 64)
+ISDN_MAX_CHANNELS=16
+
+# MODE/GROUP when creating ISDN devices
+ISDNDEV_MODE="660"
+ISDNDEV_GROUP="dialout"
+
 # Location where isdnctrl will save its configuration
 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"
+
index 2121efd4c326d26fecb81e5a302b1211b8017e80..7ce1ca8f029a53b5d0f36b902c1eca3c9792324d 100644 (file)
@@ -1,46 +1,79 @@
 #!/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/isdn4k-utils/files/isdn.initd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdn.initd,v 1.3 2005/09/03 20:56:26 sbriesen Exp $
 
-opts="save reload info"
+opts="save reload makedev info"
 
 depend() {
-       use hisax pcmcia hotplug
+       use hisax
        [ "$DEPEND_ON_CAPI" = "yes" ] && need capi
 }
 
+# gets list of installed cards
 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
+       while [ ${IDX} -lt ${#IDMAP[*]} ]; do
                CARD=${IDMAP[$IDX]}
-               if [ "$CARD" != "-" -a "$CARD" != "$LAST" ]; then
+               if [ "${CARD}" != "-" -a "${CARD}" != "${LAST}" ]; then
                        echo "${CONTR} $((IDX-1)) ${CARD}"; : $((CONTR++))
                fi
-               LAST="$CARD"; : $((IDX++))
+               LAST="${CARD}"; : $((IDX++))
        done
 }
 
-show_cards() {
+# gets CAPI controller name
+capi_name() {  # <contr>
+       /bin/sed -n "s:^${1} \+[^ ]\+ \+[^ ]\+ \+\([^ ]\+\) \+.\+\$:\1:p" \
+               /proc/capi/controller 2>/dev/null
+}
+
+# displays installed ISDN cards
+show_cards() {  # < $(card_list)
        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}"
-                       ;;
+               case "${CARD}" in
+                       capidrv-[1-9]*)
+                               CAPI=$(capi_name ${CARD/capidrv-})
+                               einfo "${1}${CONTR} ${CARD} (${CAPI})"
+                               ;;
+                       *)
+                               einfo "${1}${CONTR} ${CARD}"
+                               ;;
                esac
        done
 }
 
+# creates ISDN devices for static /dev and udev
+makedev() {
+       if [ ! -e /dev/.devfsd ]; then
+               local CHAN
+               pushd /dev >/dev/null || return 1
+               ebegin "Creating ISDN devices"
+               /bin/rm -f isdninfo isdnctrl* ippp[0-9]* isdn[0-9]* ttyI[0-9]*
+               for ((CHAN = 0; CHAN < ISDN_MAX_CHANNELS; CHAN++)); do
+                       /bin/mknod -m "${ISDNDEV_MODE}" isdn${CHAN}     c 45 $((CHAN))       # b
+                       /bin/mknod -m "${ISDNDEV_MODE}" isdnctrl${CHAN} c 45 $((CHAN + 64))  # ctrl
+                       /bin/mknod -m "${ISDNDEV_MODE}" ippp${CHAN}     c 45 $((CHAN + 128)) # ppp
+                       /bin/mknod -m "${ISDNDEV_MODE}" ttyI${CHAN}     c 43 $((CHAN))       # tty
+               done
+               /bin/chgrp "${ISDNDEV_GROUP}" isdnctrl* ippp[0-9]* isdn[0-9]* ttyI[0-9]*
+               /bin/mknod -m 444 isdninfo c 45 255
+               /bin/ln -snf isdnctrl0 isdnctrl
+               popd >/dev/null
+               eend 0
+       fi
+}
+
+
 start() {
+       # create ISDN devices if necessary
+       [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || makedev
+
        local LIST="$(card_list)"
 
-       if [ -z "$LIST" ]; then
+       if [ -z "${LIST}" ]; then
                eerror "ERROR: no ISDN cards available"
                return 1
        fi
@@ -56,22 +89,22 @@ start() {
        fi
 
        einfo "Available ISDN cards:"
-       # eindent  -> waiting for new baselayout :-/
-       show_cards "   " < <(echo "$LIST")
-       # eoutdent
+       show_cards "  " < <(echo "${LIST}")
        return 0
 }
 
 stop() {
-        # if some other monitoring processes are running
+       local RET FCNT=0
+
+        # if some other monitoring processes are running, kill 'em
        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=$?
+               /bin/fuser -ks /dev/isdninfo; RET=$?
+               while [ ${RET} -eq 0 -a ${FCNT} -lt 10 ]; do
+                       : $((FCNT++)); sleep 0.5; /bin/fuser -s /dev/isdninfo; RET=$?
                done
-               [ $RET -eq 0 ] && eend 1 || eend 0
+               [ $RET -ne 0 ]
+               eend $?
        fi
 
        if [ -n "${IPROFD_SETTINGS}" ]; then
@@ -96,15 +129,16 @@ save() {
 reload() {
        ebegin "Reloading isdnctrl configuration"
        /usr/sbin/isdnctrl reset >/dev/null
-       [ ! -f "${ISDNCTRL_CONFIG}" ] || /usr/sbin/isdnctrl readconf "${ISDNCTRL_CONFIG}" >/dev/null
+       [ ! -f "${ISDNCTRL_CONFIG}" ] || \
+       /usr/sbin/isdnctrl readconf "${ISDNCTRL_CONFIG}" >/dev/null
        eend $?
 }
 
 info() {
        local LIST="$(card_list)"
-       if [ -z "$LIST" ]; then
+       if [ -z "${LIST}" ]; then
                eerror "ERROR: no ISDN cards available"
                return 1
        fi
-       show_cards < <(echo "$LIST")
+       show_cards < <(echo "${LIST}")
 }
diff --git a/net-dialup/isdn4k-utils/files/isdn.pcmcia b/net-dialup/isdn4k-utils/files/isdn.pcmcia
new file mode 100644 (file)
index 0000000..faf1c25
--- /dev/null
@@ -0,0 +1,22 @@
+#!/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/isdn4k-utils/files/isdn.pcmcia,v 1.1 2005/09/03 20:56:26 sbriesen Exp $
+
+. /etc/pcmcia/shared
+. /etc/conf.d/isdn
+
+# Syslog output
+syslog() {  # <msg>
+       /usr/bin/logger -t "isdn-pcmcia" "$@"
+}
+
+case "${ACTION}" in
+       start)
+               # create ISDN devices if necessary
+               [ -c /dev/isdninfo -a -c /dev/isdnctrl0 ] || /etc/init.d/isdn makedev
+               ;;
+       stop)
+               ;;
+esac
+exit 0
diff --git a/net-dialup/isdn4k-utils/files/isdn.pcmcia.conf b/net-dialup/isdn4k-utils/files/isdn.pcmcia.conf
new file mode 100644 (file)
index 0000000..d0008ef
--- /dev/null
@@ -0,0 +1,117 @@
+###############################################################################
+# Device driver definitions for passive ISDN cards (I4L)                      #
+# Please read "man 5 pcmcia" for detailed informations.                       #
+###############################################################################
+
+
+###############################################################################
+# Device driver definitions for AVM cards                                     #
+# Protocol is 1 for 1TR6 and 2 for EDSS1                                      #
+#                                                                             #
+# ATTENTION: card definition below is disabled by default since there         #
+# is also a (propritary) CAPI driver available for this card which has        #
+# T.30 Fax G3 support.                                                        #
+###############################################################################
+
+device "avma1_cs"
+  class "isdn" module "hisax" opts "type=26 protocol=2 id=avma1_cs" module "avma1_cs"
+# class "isdn" module "hisax" opts "type=26" module "avma1_cs" opts "irq_list=15,12,11,10,9,7"
+
+
+###############################################################################
+# Device driver definition for ELSA cards                                     #
+# Protocol is 1 for 1TR6 and 2 for EDSS1                                      #
+###############################################################################
+
+device "elsa_cs"
+  class "isdn" module "hisax" opts "type=10 protocol=2", "elsa_cs"
+
+
+###############################################################################
+# Device driver definitions for for the Sedlbauer Speed Star ISDN adapter     #
+# Protocol is 1 for 1TR6 and 2 for EDSS1                                      #
+#                                                                             #
+# -> sedl_cs is the older but proofed module. This is used by default.        #
+# -> sedlbauer_cs is the newer one and will replace sedl_cs one day.          #
+#    Please test this module and report your experience to the author.        #
+###############################################################################
+
+device "sedl_cs"
+  class "isdn" module "hisax" opts "type=22 protocol=2", "sedl_cs"
+
+device "sedlbauer_cs"
+  class "isdn" module "hisax" opts "type=22 protocol=2", "sedlbauer_cs"
+
+
+###############################################################################
+# Device driver definitions for Teles ISDN cards                              #
+# Protocol is 1 for 1TR6 and 2 for EDSS1                                      #
+###############################################################################
+
+device "teles_cs"
+  class "isdn" module "hisax" opts "type=0", "teles_cs" opts "protocol=2"
+
+
+###############################################################################
+# Card definitions                                                            #
+###############################################################################
+
+#card "AVM ISDN-Controller A1"
+#  version "AVM", "ISDN A"
+#  bind "avma1_cs"
+
+card "Elsa ISDN Adapter"
+  version "ELSA GmbH, Aachen", "MicroLink ISDN/MC ", "*"
+  bind "elsa_cs"
+
+card "Elsa ISDN Adapter"
+  version "ELSA AG (Aachen, Germany)", "MicroLink ISDN/MC ", "*"
+  bind "elsa_cs"
+
+card "Sedlbauer PCMCIA ISDN-Card"
+  version "SEDLBAUER", "*", "*","*"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "Sedlbauer Speed Star PCMCIA ISDN-Card"
+  version "SEDLBAUER", "ISDN-Adapter", "*","*"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "Sedlbauer Speed Star PCMCIA ISDN-Card"
+  version "SEDLBAUER", "ISDN-Adapter", " (c) 93-95 VK&CB","*"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "Sedlbauer Speed Star PCMCIA ISDN-Card"
+  version "SEDLBAUER", "ISDN-Adapter", " (C) 93-94 VK&CB","*"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "Sedlbauer Speed Star PCMCIA ISDN-Card"
+  version "SEDLBAUER", "ISDN-Adapter (c) 93,94 VK&CB"
+  bind "sedlbauer_cs"
+
+card "Sedlbauer Speed Star PCMCIA ISDN-Card"
+  version "SEDLBAUER", "ISDN-Adapter", "4D98","*"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "Sedlbauer Speed Star PCMCIA ISDN-Card"
+  version "SEDLBAUER", "ISDN-Adapter", "4D67","*"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "Sedlbauer Speed Star II PCMCIA ISDN-Card"
+  version "SEDLBAUER", "speed star II", "V 3.1","(c) 93 - 98 cb & vk"
+  bind "sedlbauer_cs"
+# bind "sedl_cs"
+
+card "(c) RFI Elektronik GmbH, AnyCom ECO ISDN"
+  manfid 0x020c, 0x0103
+  bind "sedl_cs"
+
+card "TELES S0/PC ISDN"
+  version "TELES", "S0/PC"
+  bind "teles_cs"
+
index 33ea1d6b337528bcdf96aedacf2a20f8bdddfc4d..2d2ede10eb7041078c9accdb6141b9f43e617c2d 100644 (file)
@@ -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/isdn4k-utils/files/isdnlog.confd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $
+# configuraton file for /etc/init.d/isdnlog.*
 
 # naming conventions
 # ~~~~~~~~~~~~~~~~~~
index a6c3e73f83419cab282e348832cf11185aef841f..1db96d4428c9eff098ff1a5060808f570f85746f 100644 (file)
@@ -1,27 +1,29 @@
 #!/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/isdn4k-utils/files/isdnlog.initd,v 1.2 2005/07/01 22:34:02 sbriesen Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdnlog.initd,v 1.3 2005/09/03 20:56:26 sbriesen Exp $
 
 depend() {
        need isdn
 }
 
+# gets list of installed cards
 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
+       while [ ${IDX} -lt ${#IDMAP[*]} ]; do
                CARD=${IDMAP[$IDX]}
-               if [ "$CARD" != "-" -a "$CARD" != "$LAST" ]; then
+               if [ "${CARD}" != "-" -a "${CARD}" != "${LAST}" ]; then
                        echo "${CONTR} $((IDX-1)) ${CARD}"; : $((CONTR++))
                fi
-               LAST="$CARD"; : $((IDX++))
+               LAST="${CARD}"; : $((IDX++))
        done
 }
 
+# get info by contr, chan or card
 card_info() {
        local MASK
-       case "$1" in
+       case "${1}" in
                contr[0-9]*)
                        MASK="^${1#contr*} [0-9]\+ .*\$"
                        ;;
@@ -32,25 +34,25 @@ card_info() {
                        MASK="^[0-9]\+ [0-9]\+ ${1}\$"
                        ;;
        esac
-       /bin/grep "$MASK" <(card_list)
+       /bin/grep "${MASK}" <(card_list)
 }
 
 start() {
        local CONTR CHAN CARD TYPE="${myservice#*.*}"
-       read CONTR CHAN CARD < <(card_info "$TYPE")
+       read CONTR CHAN CARD < <(card_info "${TYPE}")
        
-       if [ -z "$CARD" ]; then
+       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}"
+       [ -f "${CONFIG}" ] || CONFIG="/etc/isdn/isdnlog.options.contr${CONTR}"
+       [ -f "${CONFIG}" ] || CONFIG="/etc/isdn/isdnlog.options.isdnctrl${CHAN}"
+       [ -f "${CONFIG}" ] || CONFIG="/etc/isdn/isdnlog.options.${CARD}"
  
-       if [ ! -e "$CONFIG" ]; then
+       if [ ! -f "${CONFIG}" ]; then
                eerror "ISDNLOG: You're missing /etc/isdn/isdnlog.options.${TYPE}"
                return 1
        fi
index c2417f1918698730afff76e083d8cd5426514298..952377e2611bb05ef90947519c631eba91d7ac99 100644 (file)
@@ -1,7 +1,3 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/isdnlog.logrotated,v 1.1 2005/03/29 08:40:14 mrness Exp $
-
 # isdnlog logrotate snippet for Gentoo Linux
 # contributed by Stefan Briesenick
 
index 7e13aed4c6ab2afc5cb18e5bce9830ba3cbea341..13983f19ee96b5d2ff83c3cbab467df4591ca44c 100644 (file)
@@ -1,7 +1,3 @@
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-dialup/isdn4k-utils/files/options.ippp0,v 1.1 2005/03/29 08:40:14 mrness Exp $
-
 # Example config for a personal ISP dialin
 # see "man ipppd" for explanation of all possible options
 
diff --git a/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050821.ebuild b/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050821.ebuild
new file mode 100644 (file)
index 0000000..822d001
--- /dev/null
@@ -0,0 +1,321 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: 
+
+inherit eutils multilib gnuconfig linux-info
+
+MY_PV="${PV/*_pre/}"
+MY_P="${PN}-CVS-${MY_PV:0:4}-${MY_PV:4:2}-${MY_PV:6:2}"
+
+FW_DIR="/lib/firmware"
+#FW_DIR="/lib/firmware/isdn"
+
+DESCRIPTION="ISDN4Linux Utils"
+SRC_URI="ftp://ftp.isdn4linux.de/pub/isdn4linux/CVS-Snapshots/${MY_P}.tar.bz2"
+HOMEPAGE="http://www.isdn4linux.de/"
+
+KEYWORDS="~alpha ~amd64 ~ppc ~x86"
+LICENSE="GPL-2"
+IUSE="X unicode activefilter ipppd isdnlog eurofile usb pcmcia"
+#IUSE="X unicode activefilter 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 )
+       eurofile? ( net-ftp/ftpbase )
+       ipppd? ( activefilter? ( >=virtual/libpcap-0.9.3 ) )"
+
+RDEPEND="${DEPEND}
+       virtual/modutils
+       ipppd? ( net-dialup/ppp )
+       pcmcia? ( virtual/pcmcia )"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+       # check kernel config
+       CONFIG_CHECK="ISDN ISDN_I4L"
+       if use ipppd; then
+               CONFIG_CHECK="${CONFIG_CHECK} ISDN_PPP"
+               use activefilter && CONFIG_CHECK="${CONFIG_CHECK} IPPP_FILTER"
+       fi
+       use eurofile && CONFIG_CHECK="${CONFIG_CHECK} X25 ISDN_X25"
+       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}"
+
+       # apply pcap patch (bug #99190)
+       use ipppd && use activefilter && \
+       epatch "${FILESDIR}/ipppd-pcap-0.9.3.patch"
+
+       # 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
+       use X || \
+               sed -i -e "s:^\(CONFIG_BUILDX11=.*\)$:# \1:g" \
+                       -e "s:^\(CONFIG_XISDNLOAD=.*\)$:# \1:g" \
+                       -e "s:^\(CONFIG_XMONISDN=.*\)$:# \1:g" .config
+
+       # build ipppd
+       if use ipppd; then
+               use activefilter || \
+               sed -i -e "s:^\(CONFIG_IPPP_FILTER=.*\)$:# \1:g" .config
+       else
+               sed -i -e "s:^\(CONFIG_IPPPD=.*\)$:# \1:g" \
+                       -e "s:^\(CONFIG_IPPPSTATS=.*\)$:# \1:g" .config
+       fi
+
+       # build isdnlog
+       use isdnlog || sed -i -e "s:^\(CONFIG_ISDNLOG=.*\)$:# \1:g" .config
+
+       # build eurofile (etf)
+       use eurofile || sed -i -e "s:^\(CONFIG_EUROFILE=.*\)$:# \1:g" .config
+
+       # set firmware location
+       sed -i -e "s:^\(CONFIG_FIRMWAREDIR=\).*$:\1'${FW_DIR}':g" .config
+
+       # selecting database support for isdnlog (only ONE is possible)
+       #use mysql    || sed -i -e "s:^\(CONFIG_ISDNLOG_MYSQL.*=.*\)$:# \1:g" .config
+       #use oracle   || sed -i -e "s:^\(CONFIG_ISDNLOG_ORACLE.*=.*\)$:# \1:g"  .config
+       #use 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 to UTF-8
+       if use unicode; then
+               einfo "Converting configs and docs to UTF-8"
+               for i in isdnlog/samples/{isdn,rate}.conf* isdnlog/*-??.dat \
+                       Mini-FAQ/*.txt FAQ/_howto/{pppbind,vbox_sound,xp-howto}.txt \
+                       eurofile/TODO isdnlog/{README,Isdn,.country-alias}; do
+                       iconv -f latin1 -t utf8 -o "${i}~" "${i}" && mv -f "${i}~" "${i}" || rm -f "${i}~"
+               done
+               for i in isdnlog/TODO; do
+                       iconv -f cp850 -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
+       emake -j1 MYCFLAGS="${CFLAGS}" subconfig || die "make subconfig failed"
+       emake -j1 MYCFLAGS="${CFLAGS}" || die "make failed"
+}
+
+src_install() {
+       keepdir /var/lib/isdn
+       dodir /usr/sbin "${FW_DIR}"
+
+       use isdnlog && dodir /usr/share/isdn
+       (use isdnlog || use eurofile) && dodir /etc/isdn
+       (use X || use isdnlog || use 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}${FW_DIR}"
+       rmdir --ignore-fail-on-non-empty "${D}/usr/share/isdn"
+
+       # remove obsolete firmware files (these are in net-dialup/isdn-firmware)
+       rm -f "${D}${FW_DIR}"/{bip1120,dnload,ds4bri,dspdload,loadpg,pc_??_ca,prload,te_????}.*
+
+       # install USB hotplug stuff
+       if use usb; then
+               insinto /etc/hotplug/blacklist.d
+               newins "${FILESDIR}/isdn.blacklist" isdn
+       fi
+
+       # install PCMCIA stuff
+       if use pcmcia; then
+               insinto /etc/pcmcia
+               newins "${FILESDIR}/isdn.pcmcia.conf" isdn.conf
+               exeinto /etc/pcmcia
+               newexe "${FILESDIR}/isdn.pcmcia" isdn
+       fi
+
+       # install init-scripts + configs
+       insinto /etc
+       newinitd "${FILESDIR}/isdn.initd" isdn
+       newconfd "${FILESDIR}/isdn.confd" isdn
+       newinitd "${FILESDIR}/hisax.initd" hisax
+       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 use 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 use 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 use oracle; then
+               #       docinto isdnlog/oracle
+               #       dodoc isdnlog/isdnlog/oracle/*.sql
+               #fi
+       fi
+
+       # install eurofile stuff
+       if use 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() {
+       einfo
+       einfo "Please edit:"
+       einfo
+       einfo "- /etc/conf.d/isdn   general config for init-script"
+       einfo "- /etc/hisax.conf    if you have hisax supported cards"
+       if use ipppd; then
+               einfo "- /etc/ppp/*         critical if you need networking"
+       fi
+       einfo
+       if use 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 use 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 use 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
+}