summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Briesenick <sbriesen@gentoo.org>2005-09-03 20:56:26 +0000
committerStefan Briesenick <sbriesen@gentoo.org>2005-09-03 20:56:26 +0000
commita8e095c3f1acc413f6092a36294000711cd1a467 (patch)
tree68b2660d53a5e7bbeb7f2b1723100788207f8f47 /net-dialup
parentbug 80540 and other fixes (diff)
downloadgentoo-2-a8e095c3f1acc413f6092a36294000711cd1a467.tar.gz
gentoo-2-a8e095c3f1acc413f6092a36294000711cd1a467.tar.bz2
gentoo-2-a8e095c3f1acc413f6092a36294000711cd1a467.zip
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).
(Portage version: 2.0.51.22-r2)
Diffstat (limited to 'net-dialup')
-rw-r--r--net-dialup/isdn4k-utils/ChangeLog16
-rw-r--r--net-dialup/isdn4k-utils/files/auerswald.usermap10
-rw-r--r--net-dialup/isdn4k-utils/files/config-3.7_pre20050821137
-rw-r--r--net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre200508211
-rw-r--r--net-dialup/isdn4k-utils/files/hisax.conf8
-rw-r--r--net-dialup/isdn4k-utils/files/hisax.initd61
-rw-r--r--net-dialup/isdn4k-utils/files/hisax.usermap4
-rw-r--r--net-dialup/isdn4k-utils/files/ioptions4
-rw-r--r--net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch51
-rw-r--r--net-dialup/isdn4k-utils/files/isdn.blacklist22
-rw-r--r--net-dialup/isdn4k-utils/files/isdn.confd16
-rw-r--r--net-dialup/isdn4k-utils/files/isdn.initd90
-rw-r--r--net-dialup/isdn4k-utils/files/isdn.pcmcia22
-rw-r--r--net-dialup/isdn4k-utils/files/isdn.pcmcia.conf117
-rw-r--r--net-dialup/isdn4k-utils/files/isdnlog.confd4
-rw-r--r--net-dialup/isdn4k-utils/files/isdnlog.initd26
-rw-r--r--net-dialup/isdn4k-utils/files/isdnlog.logrotated4
-rw-r--r--net-dialup/isdn4k-utils/files/options.ippp04
-rw-r--r--net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050821.ebuild321
19 files changed, 816 insertions, 102 deletions
diff --git a/net-dialup/isdn4k-utils/ChangeLog b/net-dialup/isdn4k-utils/ChangeLog
index 4592eed81d4c..aedbb8e289dd 100644
--- a/net-dialup/isdn4k-utils/ChangeLog
+++ b/net-dialup/isdn4k-utils/ChangeLog
@@ -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:
diff --git a/net-dialup/isdn4k-utils/files/auerswald.usermap b/net-dialup/isdn4k-utils/files/auerswald.usermap
index 846c04b349bf..9d9f177ce0e9 100644
--- a/net-dialup/isdn4k-utils/files/auerswald.usermap
+++ b/net-dialup/isdn4k-utils/files/auerswald.usermap
@@ -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
index 000000000000..bf4875ca9916
--- /dev/null
+++ b/net-dialup/isdn4k-utils/files/config-3.7_pre20050821
@@ -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
index 000000000000..f0dac960c47f
--- /dev/null
+++ b/net-dialup/isdn4k-utils/files/digest-isdn4k-utils-3.7_pre20050821
@@ -0,0 +1 @@
+MD5 dcbe134eb8d4a4aea4a24a180a129c93 isdn4k-utils-CVS-2005-08-21.tar.bz2 5650794
diff --git a/net-dialup/isdn4k-utils/files/hisax.conf b/net-dialup/isdn4k-utils/files/hisax.conf
index 880dc347fade..4c2ae52de9c8 100644
--- a/net-dialup/isdn4k-utils/files/hisax.conf
+++ b/net-dialup/isdn4k-utils/files/hisax.conf
@@ -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)
diff --git a/net-dialup/isdn4k-utils/files/hisax.initd b/net-dialup/isdn4k-utils/files/hisax.initd
index a872d1349608..9d4eb062f5fd 100644
--- a/net-dialup/isdn4k-utils/files/hisax.initd
+++ b/net-dialup/isdn4k-utils/files/hisax.initd
@@ -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 $?
}
-
diff --git a/net-dialup/isdn4k-utils/files/hisax.usermap b/net-dialup/isdn4k-utils/files/hisax.usermap
index 62290f15e517..9219619cc5f3 100644
--- a/net-dialup/isdn4k-utils/files/hisax.usermap
+++ b/net-dialup/isdn4k-utils/files/hisax.usermap
@@ -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
diff --git a/net-dialup/isdn4k-utils/files/ioptions b/net-dialup/isdn4k-utils/files/ioptions
index 60a59c22dd0b..39cd232ddaba 100644
--- a/net-dialup/isdn4k-utils/files/ioptions
+++ b/net-dialup/isdn4k-utils/files/ioptions
@@ -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
index 000000000000..df4b85b055dc
--- /dev/null
+++ b/net-dialup/isdn4k-utils/files/ipppd-pcap-0.9.3.patch
@@ -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 */
diff --git a/net-dialup/isdn4k-utils/files/isdn.blacklist b/net-dialup/isdn4k-utils/files/isdn.blacklist
index 1c788e5923b7..28e9b019df35 100644
--- a/net-dialup/isdn4k-utils/files/isdn.blacklist
+++ b/net-dialup/isdn4k-utils/files/isdn.blacklist
@@ -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
diff --git a/net-dialup/isdn4k-utils/files/isdn.confd b/net-dialup/isdn4k-utils/files/isdn.confd
index 99b4d6350270..de4b15b4932c 100644
--- a/net-dialup/isdn4k-utils/files/isdn.confd
+++ b/net-dialup/isdn4k-utils/files/isdn.confd
@@ -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"
+
diff --git a/net-dialup/isdn4k-utils/files/isdn.initd b/net-dialup/isdn4k-utils/files/isdn.initd
index 2121efd4c326..7ce1ca8f029a 100644
--- a/net-dialup/isdn4k-utils/files/isdn.initd
+++ b/net-dialup/isdn4k-utils/files/isdn.initd
@@ -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
index 000000000000..faf1c25cc541
--- /dev/null
+++ b/net-dialup/isdn4k-utils/files/isdn.pcmcia
@@ -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
index 000000000000..d0008ef2de06
--- /dev/null
+++ b/net-dialup/isdn4k-utils/files/isdn.pcmcia.conf
@@ -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"
+
diff --git a/net-dialup/isdn4k-utils/files/isdnlog.confd b/net-dialup/isdn4k-utils/files/isdnlog.confd
index 33ea1d6b3375..2d2ede10eb70 100644
--- a/net-dialup/isdn4k-utils/files/isdnlog.confd
+++ b/net-dialup/isdn4k-utils/files/isdnlog.confd
@@ -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
# ~~~~~~~~~~~~~~~~~~
diff --git a/net-dialup/isdn4k-utils/files/isdnlog.initd b/net-dialup/isdn4k-utils/files/isdnlog.initd
index a6c3e73f8341..1db96d4428c9 100644
--- a/net-dialup/isdn4k-utils/files/isdnlog.initd
+++ b/net-dialup/isdn4k-utils/files/isdnlog.initd
@@ -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
diff --git a/net-dialup/isdn4k-utils/files/isdnlog.logrotated b/net-dialup/isdn4k-utils/files/isdnlog.logrotated
index c2417f191869..952377e2611b 100644
--- a/net-dialup/isdn4k-utils/files/isdnlog.logrotated
+++ b/net-dialup/isdn4k-utils/files/isdnlog.logrotated
@@ -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
diff --git a/net-dialup/isdn4k-utils/files/options.ippp0 b/net-dialup/isdn4k-utils/files/options.ippp0
index 7e13aed4c6ab..13983f19ee96 100644
--- a/net-dialup/isdn4k-utils/files/options.ippp0
+++ b/net-dialup/isdn4k-utils/files/options.ippp0
@@ -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
index 000000000000..822d001c9b9c
--- /dev/null
+++ b/net-dialup/isdn4k-utils/isdn4k-utils-3.7_pre20050821.ebuild
@@ -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
+}