]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blobdiff - isdn4k-utils/isdn4k-utils.nm
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x
[people/ms/ipfire-3.x.git] / isdn4k-utils / isdn4k-utils.nm
index ecf7a653f5293e69fe17c894102aa0a942a0dd09..c176834dc653333c5d8b7f6683cc3d77d9094125 100644 (file)
@@ -6,7 +6,7 @@
 name       = isdn4k-utils
 version    = 3.2
 devel_ver  = CVS-2010-05-01
-release    = 1
+release    = 8
 thisapp    = %{name}-%{devel_ver}-patched
 
 groups     = Networking/Tools
@@ -15,8 +15,8 @@ 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 \
-       for configuring and running an ISDN subsystem. 
+       The isdn4k-utils package contains a collection of utilities needed
+       for configuring and running an ISDN subsystem.
 end
 
 source_dl  = ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/
@@ -30,12 +30,15 @@ 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 
+               # remove useless files
                find -type d -name CVS | xargs rm -rf
 
                # enable capi20.new
@@ -56,11 +59,11 @@ build
                sed -e "s/^CONFIG_XISDNLOAD=.*/#&/" -i .config
                echo "CONFIG_GENMAN=y" >> .config
                echo "CONFIG_FAQ=y" >> .config
-               echo "CONFIG_FAQDIR='/usr/share/doc/isdn4k-utils'" >> .config
-               echo "CONFIG_DATADIR='/usr/share/isdn'" >> .config
-               echo "LIBDIR='/usr/lib'" >> .config 
-               echo "CONFIG_FIRMWAREDIR='/usr/share/isdn'" >> .config 
-               echo "CONFIG_CARD_SBINDIR='/sbin'" >> .config 
+               echo "CONFIG_FAQDIR='%{datadir}/doc/isdn4k-utils'" >> .config
+               echo "CONFIG_DATADIR='%{datadir}/isdn'" >> .config
+               echo "LIBDIR='%{libdir}'" >> .config
+               echo "CONFIG_FIRMWAREDIR='%{datadir}/isdn'" >> .config
+               echo "CONFIG_CARD_SBINDIR='%{sbindir}'" >> .config
                sed -e "s,',,g" .config > .config.h
        end
 
@@ -72,11 +75,57 @@ build
 
        install
                mkdir -pv %{BUILDROOT}/usr/sbin
-               make install CFLAGS="%{CFLAGS}" DESTDIR="%{BUILDROOT}"
+               make install CFLAGS="%{CFLAGS}" LIBDIR="%{libdir}" DESTDIR="%{BUILDROOT}"
+
+               # 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
+
+               # Install ipppd configuration files.
+               mkdir -pv %{BUILDROOT}/etc/ppp
+               touch %{BUILDROOT}/etc/ppp/ioptions
        end
 end
 
 packages
        package %{name}
+               prerequires += systemd-units
+
+               conflicts
+                       filesystem < 002
+               end
+
+               configfiles
+                       /etc/capi.conf
+                       /etc/capi20.conf
+                       /etc/ppp/ioptions
+               end
+
+               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
+
+       package %{name}-debuginfo
+               template DEBUGINFO
        end
 end