]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - isdn4k-utils/isdn4k-utils.nm
c176834dc653333c5d8b7f6683cc3d77d9094125
[people/ms/ipfire-3.x.git] / isdn4k-utils / isdn4k-utils.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = isdn4k-utils
7 version = 3.2
8 devel_ver = CVS-2010-05-01
9 release = 8
10 thisapp = %{name}-%{devel_ver}-patched
11
12 groups = Networking/Tools
13 url =
14 license = GPLv2+ and GPL+ and MIT and BSD and zlib
15 summary = Utilities for configuring an ISDN subsystem.
16
17 description
18 The isdn4k-utils package contains a collection of utilities needed
19 for configuring and running an ISDN subsystem.
20 end
21
22 source_dl = ftp://ftp.isdn4linux.de/pub/isdn4linux/utils/
23 sources = %{thisapp}.tar.bz2
24
25 build
26 requires
27 autoconf
28 automake
29 libpcap-devel
30 libtool
31 ncurses-devel
32 ppp-devel
33 perl
34 end
35
36 CFLAGS += \
37 -D_FILE_OFFSET_BITS=64 \
38 -D_LARGEFILE_SOURCE
39
40 prepare_cmds
41 # remove useless files
42 find -type d -name CVS | xargs rm -rf
43
44 # enable capi20.new
45 rm -rf capi20 && mv capi20.new capi20
46
47 # Reconfigure the whole package
48 for i in */configure; do
49 cd `dirname $i`
50 autoreconf --force --install || exit 1
51 cd ..
52 done
53
54 # Set configuration
55 mv .config.rpm .config
56 sed -e "s/^CONFIG_BUILDX11=.*/#&/" -i .config
57 sed -e "s/^CONFIG_VBOX=.*/#&/" -i .config
58 sed -e "s/^CONFIG_XMONISDN=.*/#&/" -i .config
59 sed -e "s/^CONFIG_XISDNLOAD=.*/#&/" -i .config
60 echo "CONFIG_GENMAN=y" >> .config
61 echo "CONFIG_FAQ=y" >> .config
62 echo "CONFIG_FAQDIR='%{datadir}/doc/isdn4k-utils'" >> .config
63 echo "CONFIG_DATADIR='%{datadir}/isdn'" >> .config
64 echo "LIBDIR='%{libdir}'" >> .config
65 echo "CONFIG_FIRMWAREDIR='%{datadir}/isdn'" >> .config
66 echo "CONFIG_CARD_SBINDIR='%{sbindir}'" >> .config
67 sed -e "s,',,g" .config > .config.h
68 end
69
70 build
71 make subconfig
72
73 make CFLAGS="%{CFLAGS}"
74 end
75
76 install
77 mkdir -pv %{BUILDROOT}/usr/sbin
78 make install CFLAGS="%{CFLAGS}" LIBDIR="%{libdir}" DESTDIR="%{BUILDROOT}"
79
80 # Install config files for capi.
81 mkdir -pv %{BUILDROOT}/etc
82 install -m 644 capiinit/capi.conf %{BUILDROOT}/etc
83 install -m 644 %{DIR_SOURCE}/capi20.conf %{BUILDROOT}/etc
84
85 # Install ipppd configuration files.
86 mkdir -pv %{BUILDROOT}/etc/ppp
87 touch %{BUILDROOT}/etc/ppp/ioptions
88 end
89 end
90
91 packages
92 package %{name}
93 prerequires += systemd-units
94
95 conflicts
96 filesystem < 002
97 end
98
99 configfiles
100 /etc/capi.conf
101 /etc/capi20.conf
102 /etc/ppp/ioptions
103 end
104
105 script postin
106 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
107 end
108
109 script preun
110 /bin/systemctl --no-reload disable capi.service isdn.service >/dev/null 2>&1 || :
111 /bin/systemctl stop capi.service isdn.service >/dev/null 2>&1 || :
112 end
113
114 script postun
115 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
116 end
117
118 script postup
119 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
120 /bin/systemctl try-restart capi.service isdn.service >/dev/null 2>&1 || :
121 end
122 end
123
124 package %{name}-devel
125 template DEVEL
126 end
127
128 package %{name}-debuginfo
129 template DEBUGINFO
130 end
131 end