]>
Commit | Line | Data |
---|---|---|
84eca061 JB |
1 | # |
2 | # Conditional build | |
3 | %bcond_with hotplug # old-style (pre-udev) hotplug support | |
0160d02c | 4 | %bcond_without ppp # pppd plugin |
cb361dd9 | 5 | # |
6f6c8480 | 6 | %include /usr/lib/rpm/macros.perl |
cb361dd9 | 7 | Summary: DAHDI telephony device support |
8 | Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI | |
9 | Name: dahdi-tools | |
0160d02c | 10 | Version: 2.9.1 |
d4845b0b JB |
11 | Release: 1 |
12 | License: GPL v2 | |
cb361dd9 | 13 | Group: Base/Kernel |
256e3dd0 | 14 | Source0: http://downloads.asterisk.org/pub/telephony/dahdi-tools/%{name}-%{version}.tar.gz |
0160d02c | 15 | # Source0-md5: 140729230c6d2a73ba88c723d7e3c0d9 |
cb361dd9 | 16 | Source1: dahdi.init |
17 | Source2: dahdi.sysconfig | |
18 | Patch0: %{name}-as-needed.patch | |
6f6c8480 | 19 | Patch1: %{name}-perl-path.patch |
d4845b0b | 20 | Patch2: %{name}-includes.patch |
cb361dd9 | 21 | URL: http://www.asterisk.org/ |
58e6c841 | 22 | BuildRequires: dahdi-linux-devel >= 2.3.0 |
256e3dd0 | 23 | BuildRequires: libusb-compat-devel >= 0.1 |
cb361dd9 | 24 | BuildRequires: newt-devel |
25 | BuildRequires: perl-base | |
26 | BuildRequires: perl-tools-pod | |
0160d02c | 27 | %{?with_ppp:BuildRequires: ppp-plugin-devel} |
6f6c8480 | 28 | BuildRequires: rpm-perlprov >= 4.1-13 |
e2e6d412 | 29 | BuildRequires: rpmbuild(macros) >= 1.379 |
d4845b0b | 30 | Obsoletes: dahdi-tools-utils |
e2e6d412 | 31 | Obsoletes: zaptel |
bfab6dda | 32 | Obsoletes: zaptel-utils |
cb361dd9 | 33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
cb361dd9 | 35 | %description |
36 | DAHDI telephony device driver. | |
37 | ||
38 | %description -l pl.UTF-8 | |
39 | Sterownik do urządzeń telefonicznych DAHDI. | |
40 | ||
41 | %package devel | |
42 | Summary: DAHDI development headers | |
43 | Summary(pl.UTF-8): Pliki nagłówkowe DAHDI | |
44 | Group: Development/Libraries | |
d4845b0b JB |
45 | Requires: %{name} = %{version}-%{release} |
46 | Requires: dahdi-linux-devel | |
e2e6d412 | 47 | Obsoletes: zaptel-devel |
cb361dd9 | 48 | |
49 | %description devel | |
50 | DAHDI development headers. | |
51 | ||
52 | %description devel -l pl.UTF-8 | |
53 | Pliki nagłówkowe DAHDI. | |
54 | ||
55 | %package static | |
56 | Summary: DAHDI static library | |
57 | Summary(pl.UTF-8): Biblioteka statyczna DAHDI | |
58 | Group: Development/Libraries | |
d4845b0b | 59 | Requires: %{name}-devel = %{version}-%{release} |
cb361dd9 | 60 | |
61 | %description static | |
62 | DAHDI static library. | |
63 | ||
64 | %description static -l pl.UTF-8 | |
65 | Biblioteka statyczna DAHDI. | |
66 | ||
bfab6dda JB |
67 | %package perl |
68 | Summary: DAHDI utility programs written in Perl | |
69 | Summary(pl.UTF-8): Programy narzędziowe DAHDI napisane w Perlu | |
70 | Group: Applications/Communications | |
71 | Requires: perl-Dahdi = %{version}-%{release} | |
72 | ||
73 | %description perl | |
74 | DAHDI utility programs written in Perl. | |
75 | ||
76 | %description perl -l pl.UTF-8 | |
77 | Programy narzędziowe DAHDI napisane w Perlu. | |
78 | ||
cb361dd9 | 79 | %package init |
80 | Summary: DAHDI init scripts | |
81 | Summary(pl.UTF-8): Skrypty inicjalizujące DAHDI | |
82 | Group: Applications/Communications | |
83 | Requires(post,preun): /sbin/chkconfig | |
d4845b0b | 84 | Requires: %{name} = %{version}-%{release} |
cb361dd9 | 85 | Requires: rc-scripts |
e2e6d412 | 86 | Obsoletes: zaptel-init |
cb361dd9 | 87 | |
88 | %description init | |
89 | DAHDI boot-time initialization. | |
90 | ||
91 | %description init -l pl.UTF-8 | |
92 | Inicjalizacja DAHDI w czasie startu systemu. | |
93 | ||
fc45f4e9 JR |
94 | %package udev |
95 | Summary: udev rules for DAHDI kernel modules | |
96 | Summary(pl.UTF-8): Reguły udev dla modułów jądra Linuksa dla DAHDI | |
97 | Group: Base/Kernel | |
98 | Obsoletes: dahdi-linux-udev < 2.9.0 | |
99 | Requires: %{name} >= 2.2.0 | |
100 | Requires: udev-core | |
101 | ||
102 | %description udev | |
103 | udev rules for DAHDI kernel modules. | |
104 | ||
105 | %description udev -l pl.UTF-8 | |
106 | Reguły udev dla modułów jądra Linuksa dla DAHDI. | |
107 | ||
84eca061 JB |
108 | %package -n bash-completion-dahdi |
109 | Summary: Bash completion for DAHDI commands | |
110 | Summary(pl.UTF-8): Bashowe dopełnianie składni dla poleceń DAHDI | |
111 | Group: Applications/Shells | |
112 | Requires: %{name} = %{version}-%{release} | |
113 | Requires: bash-completion | |
114 | ||
115 | %description -n bash-completion-dahdi | |
116 | Bash completion for DAHDI commands. | |
117 | ||
118 | %description -n bash-completion-dahdi -l pl.UTF-8 | |
119 | Bashowe dopełnianie składni dla poleceń DAHDI. | |
120 | ||
cb361dd9 | 121 | %package -n perl-Dahdi |
122 | Summary: Perl interface to DAHDI | |
d4845b0b | 123 | Summary(pl.UTF-8): Perlowy interfejs do DAHDI |
cb361dd9 | 124 | Group: Development/Languages/Perl |
bfab6dda | 125 | # needs dahdi_scan |
d4845b0b | 126 | Requires: %{name} = %{version}-%{release} |
cb361dd9 | 127 | |
128 | %description -n perl-Dahdi | |
129 | Perl inferface to DAHDI. | |
130 | ||
131 | %description -n perl-Dahdi -l pl.UTF-8 | |
d4845b0b | 132 | Perlowy interfejs do DAHDI. |
cb361dd9 | 133 | |
0160d02c JB |
134 | %package -n ppp-plugin-dahdi |
135 | Summary: DAHDI plugin for PPP daemon | |
136 | Summary(pl.UTF-8): Wtyczka DAHDI dla demona PPP | |
137 | Group: Libraries | |
138 | Requires: ppp | |
139 | ||
140 | %description -n ppp-plugin-dahdi | |
141 | DAHDI plugin for PPP daemon. | |
142 | ||
143 | %description -n ppp-plugin-dahdi -l pl.UTF-8 | |
144 | Wtyczka DAHDI dla demona PPP. | |
145 | ||
cb361dd9 | 146 | %prep |
147 | %setup -q | |
148 | %patch0 -p1 | |
6f6c8480 | 149 | %patch1 -p1 |
d4845b0b | 150 | %patch2 -p1 |
cb361dd9 | 151 | |
152 | cat > download-logger <<'EOF' | |
153 | #!/bin/sh | |
154 | # keep log of files make wanted to download in firmware/ dir | |
155 | echo "$@" >> download.log | |
156 | EOF | |
157 | chmod a+rx download-logger | |
cb361dd9 | 158 | |
159 | %build | |
160 | %configure | |
1a3180a1 AM |
161 | %{__make} \ |
162 | CC="%{__cc}" \ | |
163 | OPTFLAGS="%{rpmcppflags} %{rpmcflags}" | |
cb361dd9 | 164 | |
0160d02c JB |
165 | %if %{with ppp} |
166 | %{__make} -C ppp \ | |
167 | CC="%{__cc}" \ | |
168 | COPTS="%{rpmcflags} %{rpmcppflags}" | |
169 | %endif | |
170 | ||
cb361dd9 | 171 | %install |
172 | rm -rf $RPM_BUILD_ROOT | |
cb361dd9 | 173 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} |
174 | ||
fc45f4e9 | 175 | %{__make} -j1 config install \ |
cb361dd9 | 176 | DESTDIR=$RPM_BUILD_ROOT |
fc45f4e9 | 177 | |
0160d02c JB |
178 | %if %{with ppp} |
179 | %{__make} -C ppp install \ | |
180 | DESTDIR=$RPM_BUILD_ROOT \ | |
181 | LIBDIR=%{_libdir}/pppd/plugins | |
182 | %endif | |
183 | ||
cb361dd9 | 184 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dahdi |
185 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dahdi | |
186 | touch $RPM_BUILD_ROOT%{_sysconfdir}/dahdi.conf | |
187 | ||
84eca061 JB |
188 | # sample configuration files - nothing enabled by default, so safe to install |
189 | %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/dahdi/assigned-spans.conf{.sample,} | |
190 | %{__mv} $RPM_BUILD_ROOT%{_sysconfdir}/dahdi/span-types.conf{.sample,} | |
191 | ||
192 | # old-style hotplug stuff | |
193 | %if %{without hotplug} | |
194 | %{__rm} $RPM_BUILD_ROOT/etc/hotplug/usb/xpp_* | |
195 | %endif | |
196 | # used by upstream (but not PLD) init script | |
197 | %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/dahdi/{init.conf,modules} | |
198 | ||
cb361dd9 | 199 | %clean |
200 | rm -rf $RPM_BUILD_ROOT | |
201 | ||
202 | %post init | |
203 | /sbin/chkconfig --add dahdi | |
204 | %service dahdi restart | |
205 | ||
206 | %preun init | |
207 | if [ "$1" = "0" ]; then | |
208 | %service dahdi stop | |
209 | /sbin/chkconfig --del dahdi | |
210 | fi | |
211 | ||
212 | %files | |
213 | %defattr(644,root,root,755) | |
214 | %doc README | |
215 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi.conf | |
216 | %dir %{_sysconfdir}/dahdi | |
217 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi/system.conf | |
84eca061 JB |
218 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi/assigned-spans.conf |
219 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi/span-types.conf | |
220 | %if %{with hotplug} | |
221 | %attr(755,root,root) /etc/hotplug/usb/xpp_fxloader | |
222 | /etc/hotplug/usb/xpp_fxloader.usermap | |
223 | %endif | |
224 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/dahdi.blacklist.conf | |
225 | %config(noreplace) %verify(not md5 mtime size) /etc/modprobe.d/dahdi.conf | |
d4845b0b | 226 | %attr(755,root,root) %{_sbindir}/astribank_* |
bfab6dda JB |
227 | %attr(755,root,root) %{_sbindir}/dahdi_cfg |
228 | %attr(755,root,root) %{_sbindir}/dahdi_maint | |
229 | %attr(755,root,root) %{_sbindir}/dahdi_monitor | |
230 | %attr(755,root,root) %{_sbindir}/dahdi_scan | |
231 | %attr(755,root,root) %{_sbindir}/dahdi_speed | |
232 | %attr(755,root,root) %{_sbindir}/dahdi_test | |
233 | %attr(755,root,root) %{_sbindir}/dahdi_tool | |
fc45f4e9 JR |
234 | %attr(755,root,root) %{_sbindir}/dahdi_span_assignments |
235 | %attr(755,root,root) %{_sbindir}/dahdi_span_types | |
236 | %attr(755,root,root) %{_sbindir}/dahdi_waitfor_span_assignments | |
d4845b0b | 237 | %attr(755,root,root) %{_sbindir}/fxotune |
d4845b0b | 238 | %attr(755,root,root) %{_sbindir}/sethdlc |
d4845b0b JB |
239 | %attr(755,root,root) %{_libdir}/libtonezone.so.1.* |
240 | %attr(755,root,root) %ghost %{_libdir}/libtonezone.so.1 | |
241 | %attr(755,root,root) %{_libdir}/libtonezone.so.2.* | |
242 | %attr(755,root,root) %ghost %{_libdir}/libtonezone.so.2 | |
cb361dd9 | 243 | %{_datadir}/dahdi |
d4845b0b | 244 | %{_mandir}/man8/astribank_*.8* |
bfab6dda JB |
245 | %{_mandir}/man8/dahdi_cfg.8* |
246 | %{_mandir}/man8/dahdi_maint.8* | |
247 | %{_mandir}/man8/dahdi_monitor.8* | |
248 | %{_mandir}/man8/dahdi_scan.8* | |
249 | %{_mandir}/man8/dahdi_test.8* | |
250 | %{_mandir}/man8/dahdi_tool.8* | |
d4845b0b | 251 | %{_mandir}/man8/fxotune.8* |
fc45f4e9 JR |
252 | %{_mandir}/man8/dahdi_span_assignments.8* |
253 | %{_mandir}/man8/dahdi_span_types.8* | |
254 | %{_mandir}/man8/dahdi_waitfor_span_assignments.8* | |
cb361dd9 | 255 | |
256 | %files devel | |
257 | %defattr(644,root,root,755) | |
d4845b0b JB |
258 | %attr(755,root,root) %{_libdir}/libtonezone.so |
259 | %{_includedir}/dahdi/tonezone.h | |
cb361dd9 | 260 | |
261 | %files static | |
262 | %defattr(644,root,root,755) | |
d4845b0b | 263 | %{_libdir}/libtonezone.a |
cb361dd9 | 264 | |
bfab6dda JB |
265 | %files perl |
266 | %defattr(644,root,root,755) | |
267 | %attr(755,root,root) %{_sbindir}/dahdi_genconf | |
268 | %attr(755,root,root) %{_sbindir}/dahdi_hardware | |
269 | %attr(755,root,root) %{_sbindir}/dahdi_registration | |
270 | %attr(755,root,root) %{_sbindir}/lsdahdi | |
271 | %attr(755,root,root) %{_sbindir}/twinstar | |
272 | %attr(755,root,root) %{_sbindir}/xpp_blink | |
273 | %attr(755,root,root) %{_sbindir}/xpp_sync | |
84eca061 JB |
274 | # for dahdi_genconf |
275 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi/genconf_parameters | |
bfab6dda JB |
276 | %{_mandir}/man8/dahdi_genconf.8* |
277 | %{_mandir}/man8/dahdi_hardware.8* | |
278 | %{_mandir}/man8/dahdi_registration.8* | |
279 | %{_mandir}/man8/lsdahdi.8* | |
280 | %{_mandir}/man8/twinstar.8* | |
281 | %{_mandir}/man8/xpp_blink.8* | |
282 | %{_mandir}/man8/xpp_sync.8* | |
283 | ||
d4845b0b | 284 | %files init |
cb361dd9 | 285 | %defattr(644,root,root,755) |
d4845b0b JB |
286 | %attr(754,root,root) /etc/rc.d/init.d/dahdi |
287 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dahdi | |
cb361dd9 | 288 | |
fc45f4e9 JR |
289 | %files udev |
290 | %defattr(644,root,root,755) | |
291 | %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/dahdi.rules | |
292 | %config(noreplace) %verify(not md5 mtime size) /etc/udev/rules.d/xpp.rules | |
293 | ||
84eca061 JB |
294 | %files -n bash-completion-dahdi |
295 | %defattr(644,root,root,755) | |
296 | /etc/bash_completion.d/dahdi | |
297 | ||
cb361dd9 | 298 | %files -n perl-Dahdi |
299 | %defattr(644,root,root,755) | |
6f6c8480 | 300 | %{perl_vendorlib}/Dahdi |
301 | %{perl_vendorlib}/Dahdi.pm | |
0160d02c JB |
302 | |
303 | %if %{with ppp} | |
304 | %files -n ppp-plugin-dahdi | |
305 | %defattr(644,root,root,755) | |
306 | %attr(755,root,root) %{_libdir}/pppd/plugins/dahdi.so | |
307 | %endif |