From: Stefan Schantl Date: Wed, 9 Nov 2011 19:45:39 +0000 (+0100) Subject: isdn4k-utils: Add systemd files, udev rules and config files for capi. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebfdf006ab84f3604dc70a1752d17e77e7cd72a0;p=ipfire-3.x.git isdn4k-utils: Add systemd files, udev rules and config files for capi. --- diff --git a/isdn4k-utils/40-isdn.rules b/isdn4k-utils/40-isdn.rules new file mode 100644 index 000000000..1a31cb6c9 --- /dev/null +++ b/isdn4k-utils/40-isdn.rules @@ -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 index 000000000..c0ac223d3 --- /dev/null +++ b/isdn4k-utils/capi20.conf @@ -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 +# +# 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 index d703afdf5..000000000 --- a/isdn4k-utils/isdn4k-utils-CVS-2006-07-20-glibc.patch +++ /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 - #include - - #ifdef __cplusplus diff --git a/isdn4k-utils/isdn4k-utils.nm b/isdn4k-utils/isdn4k-utils.nm index ecf7a653f..fa531d504 100644 --- a/isdn4k-utils/isdn4k-utils.nm +++ b/isdn4k-utils/isdn4k-utils.nm @@ -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 index 000000000..32d42f05e --- /dev/null +++ b/isdn4k-utils/systemd/capi.service @@ -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 index 000000000..3442737cc --- /dev/null +++ b/isdn4k-utils/systemd/isdn.service @@ -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