]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
isdn4k-utils: Add systemd files, udev rules and config files for capi.
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 9 Nov 2011 19:45:39 +0000 (20:45 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Wed, 9 Nov 2011 19:45:39 +0000 (20:45 +0100)
isdn4k-utils/40-isdn.rules [new file with mode: 0644]
isdn4k-utils/capi20.conf [new file with mode: 0644]
isdn4k-utils/isdn4k-utils-CVS-2006-07-20-glibc.patch [deleted file]
isdn4k-utils/isdn4k-utils.nm
isdn4k-utils/systemd/capi.service [new file with mode: 0644]
isdn4k-utils/systemd/isdn.service [new file with mode: 0644]

diff --git a/isdn4k-utils/40-isdn.rules b/isdn4k-utils/40-isdn.rules
new file mode 100644 (file)
index 0000000..1a31cb6
--- /dev/null
@@ -0,0 +1,4 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="capi", KERNEL=="capi", NAME="capi20", GROUP="dialout"
+SUBSYSTEM=="tty", KERNEL=="capi[0-9]*", NAME="capi/%n"
diff --git a/isdn4k-utils/capi20.conf b/isdn4k-utils/capi20.conf
new file mode 100644 (file)
index 0000000..c0ac223
--- /dev/null
@@ -0,0 +1,18 @@
+# libcapi20 features autodetection of connected CAPI
+# devices. In case you need to select a special device
+# use the remote configuration file:
+#   ~/.capi20rc
+# if it doesn't exist look for
+#   /etc/capi20.conf
+# 
+# To set the remote machine, the above file need to have
+# the following line
+#   REMOTE <driver> <remote hostname|ip-address> <remote port>
+#  
+# Drivers:
+#      * fritzbox      - Remote CAPI via FRITZ!Box
+#      * rcapi         - Melware Remote CAPI
+# 
+# If this doesn't exist, the library tries the old, normal way
+# of using the local /dev/isdn/capi20.
+# REMOTE fritzbox 192.168.178.1 5031
diff --git a/isdn4k-utils/isdn4k-utils-CVS-2006-07-20-glibc.patch b/isdn4k-utils/isdn4k-utils-CVS-2006-07-20-glibc.patch
deleted file mode 100644 (file)
index d703afd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -up isdn4k-utils-CVS-2006-07-20/capi20/capi20.h.orig isdn4k-utils-CVS-2006-07-20/capi20/capi20.h
---- isdn4k-utils-CVS-2006-07-20/capi20/capi20.h.orig   2007-09-27 21:45:43.000000000 +0200
-+++ isdn4k-utils-CVS-2006-07-20/capi20/capi20.h        2007-09-27 23:45:40.000000000 +0200
-@@ -20,6 +20,7 @@
- #ifndef __CAPI20_H__
- #define __CAPI20_H__
-+#include <sys/types.h>
- #include <sys/time.h>
- #ifdef __cplusplus
index ecf7a653f5293e69fe17c894102aa0a942a0dd09..fa531d50471e05d7058b5319afe940010b8b2628 100644 (file)
@@ -6,7 +6,7 @@
 name       = isdn4k-utils
 version    = 3.2
 devel_ver  = CVS-2010-05-01
-release    = 1
+release    = 2
 thisapp    = %{name}-%{devel_ver}-patched
 
 groups     = Networking/Tools
@@ -15,7 +15,7 @@ license    = GPLv2+ and GPL+ and MIT and BSD and zlib
 summary    = Utilities for configuring an ISDN subsystem.
 
 description
-       The isdn4k-utils package contains a collection of utilities needed \
+       The isdn4k-utils package contains a collection of utilities needed
        for configuring and running an ISDN subsystem. 
 end
 
@@ -30,9 +30,12 @@ build
                libtool
                ncurses-devel
                ppp-devel
+               perl
        end
 
-       CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+       CFLAGS += \
+               -D_FILE_OFFSET_BITS=64 \
+               -D_LARGEFILE_SOURCE
 
        prepare_cmds
                # remove useless files 
@@ -73,10 +76,42 @@ build
        install
                mkdir -pv %{BUILDROOT}/usr/sbin
                make install CFLAGS="%{CFLAGS}" DESTDIR="%{BUILDROOT}"
+
+               # Install udev rules for isdn.
+               mkdir -pv %{BUILDROOT}/lib/udev/rules.d/
+               install -m 644 %{DIR_SOURCE}/40-isdn.rules %{BUILDROOT}/lib/udev/rules.d/
+
+               # Install config files for capi.
+               mkdir -pv %{BUILDROOT}/etc
+               install -m 644 capiinit/capi.conf %{BUILDROOT}/etc
+               install -m 644 %{DIR_SOURCE}/capi20.conf %{BUILDROOT}/etc
        end
 end
 
 packages
        package %{name}
+               prerequires += systemd-units
+
+               script postin
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script preun
+                       /bin/systemctl --no-reload disable capi.service isdn.service >/dev/null 2>&1 || :
+                       /bin/systemctl stop capi.service isdn-service >/dev/null 2>&1 || :
+               end
+
+               script postun
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+               end
+
+               script postup
+                       /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+                       /bin/systemctl try-restart capi.service isdn.service >/dev/null 2>&1 || :
+               end
+       end
+
+       package %{name}-devel
+               template DEVEL
        end
 end
diff --git a/isdn4k-utils/systemd/capi.service b/isdn4k-utils/systemd/capi.service
new file mode 100644 (file)
index 0000000..32d42f0
--- /dev/null
@@ -0,0 +1,10 @@
+[Unit]
+Description=Capi services for passiv ISDN cards
+After=syslog.target
+
+[Service]
+ExecStart=/sbin/capiinit start
+ExecStop=/sbin/capiinit stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/isdn4k-utils/systemd/isdn.service b/isdn4k-utils/systemd/isdn.service
new file mode 100644 (file)
index 0000000..3442737
--- /dev/null
@@ -0,0 +1,15 @@
+[Unit]
+Description=ISDN Services
+Requires=syslog.target network.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/isdn start
+ExecStop=/usr/libexec/isdn stop
+Environment=BOOTUP=serial
+Environment=CONSOLETYPE=serial
+StandardError=syslog
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target