]>
Commit | Line | Data |
---|---|---|
cb361dd9 | 1 | # |
2 | # TODO: | |
f3406a5e | 3 | # warning: Installed (but unpackaged) file(s) found: |
4 | # /etc/hotplug/usb/xpp_fxloader | |
5 | # /etc/hotplug/usb/xpp_fxloader.usermap | |
cb361dd9 | 6 | # |
7 | # Conditional build: | |
8 | %bcond_with oslec # with Open Source Line Echo Canceller | |
9 | %bcond_with bristuff # with bristuff support | |
10 | %bcond_without xpp # without Astribank | |
11 | %bcond_with verbose | |
12 | ||
6f6c8480 | 13 | %include /usr/lib/rpm/macros.perl |
14 | ||
cb361dd9 | 15 | %ifarch sparc |
16 | %undefine with_smp | |
17 | %endif | |
18 | %ifarch alpha | |
19 | %undefine with_xpp | |
20 | %endif | |
21 | ||
3d38b294 | 22 | %define rel 2 |
cb361dd9 | 23 | Summary: DAHDI telephony device support |
24 | Summary(pl.UTF-8): Obsługa urządzeń telefonicznych DAHDI | |
25 | Name: dahdi-tools | |
e2e6d412 | 26 | Version: 2.4.1 |
cb361dd9 | 27 | Release: %{rel}%{?with_bristuff:.bristuff} |
28 | License: GPL | |
29 | Group: Base/Kernel | |
30 | Source0: http://downloads.digium.com/pub/telephony/dahdi-tools/%{name}-%{version}.tar.gz | |
e2e6d412 | 31 | # Source0-md5: a06cf7c68b0b9fbb61f5804abd1a05e9 |
cb361dd9 | 32 | Source1: dahdi.init |
33 | Source2: dahdi.sysconfig | |
34 | Patch0: %{name}-as-needed.patch | |
6f6c8480 | 35 | Patch1: %{name}-perl-path.patch |
cb361dd9 | 36 | URL: http://www.asterisk.org/ |
58e6c841 | 37 | BuildRequires: dahdi-linux-devel >= 2.3.0 |
cb361dd9 | 38 | BuildRequires: newt-devel |
39 | BuildRequires: perl-base | |
40 | BuildRequires: perl-tools-pod | |
6f6c8480 | 41 | BuildRequires: rpm-perlprov >= 4.1-13 |
e2e6d412 | 42 | BuildRequires: rpmbuild(macros) >= 1.379 |
cb361dd9 | 43 | %{?with_bristuff:Provides: dahdi(bristuff)} |
e2e6d412 | 44 | Obsoletes: zaptel |
cb361dd9 | 45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
47 | # Rules: | |
48 | # - modules_X: single modules, just name module with no suffix | |
49 | # - modules_X: subdir modules are just directory name with slash like dirname/ | |
50 | # - keep X and X_in in sync | |
51 | # - X is used for actual building (entries separated with space), X_in for pld macros (entries separated with comma) | |
52 | ||
53 | %description | |
54 | DAHDI telephony device driver. | |
55 | ||
56 | %description -l pl.UTF-8 | |
57 | Sterownik do urządzeń telefonicznych DAHDI. | |
58 | ||
59 | %package devel | |
60 | Summary: DAHDI development headers | |
61 | Summary(pl.UTF-8): Pliki nagłówkowe DAHDI | |
62 | Group: Development/Libraries | |
63 | Requires: %{name} = %{version}-%{rel} | |
cb361dd9 | 64 | %{?with_bristuff:Provides: dahdi-devel(bristuff)} |
e2e6d412 | 65 | Obsoletes: zaptel-devel |
cb361dd9 | 66 | |
67 | %description devel | |
68 | DAHDI development headers. | |
69 | ||
70 | %description devel -l pl.UTF-8 | |
71 | Pliki nagłówkowe DAHDI. | |
72 | ||
73 | %package static | |
74 | Summary: DAHDI static library | |
75 | Summary(pl.UTF-8): Biblioteka statyczna DAHDI | |
76 | Group: Development/Libraries | |
77 | Requires: %{name}-devel = %{version}-%{rel} | |
78 | %{?with_bristuff:Provides: dahdi-static(bristuff)} | |
79 | ||
80 | %description static | |
81 | DAHDI static library. | |
82 | ||
83 | %description static -l pl.UTF-8 | |
84 | Biblioteka statyczna DAHDI. | |
85 | ||
86 | %package utils | |
87 | Summary: DAHDI utility programs | |
88 | Summary(pl.UTF-8): Programy narzędziowe DAHDI | |
cb361dd9 | 89 | Group: Applications/Communications |
e2e6d412 | 90 | Obsoletes: zaptel-utils |
cb361dd9 | 91 | |
92 | %description utils | |
93 | DAHDI card utility programs, mainly for diagnostics. | |
94 | ||
95 | %description utils -l pl.UTF-8 | |
96 | Programy narzędziowe do kart DAHDI, służące głównie do diagnostyki. | |
97 | ||
98 | %package init | |
99 | Summary: DAHDI init scripts | |
100 | Summary(pl.UTF-8): Skrypty inicjalizujące DAHDI | |
101 | Group: Applications/Communications | |
102 | Requires(post,preun): /sbin/chkconfig | |
cb361dd9 | 103 | Requires: %{name}-utils = %{version}-%{rel} |
104 | Requires: rc-scripts | |
e2e6d412 | 105 | Obsoletes: zaptel-init |
cb361dd9 | 106 | |
107 | %description init | |
108 | DAHDI boot-time initialization. | |
109 | ||
110 | %description init -l pl.UTF-8 | |
111 | Inicjalizacja DAHDI w czasie startu systemu. | |
112 | ||
113 | %package -n perl-Dahdi | |
114 | Summary: Perl interface to DAHDI | |
115 | Summary(pl.UTF-8): Perlowy interfejs do DAHDIa | |
116 | Group: Development/Languages/Perl | |
117 | Requires: %{name} = %{version}-%{rel} | |
118 | ||
119 | %description -n perl-Dahdi | |
120 | Perl inferface to DAHDI. | |
121 | ||
122 | %description -n perl-Dahdi -l pl.UTF-8 | |
123 | Perlowy interfejs do DAHDIa. | |
124 | ||
125 | %prep | |
126 | %setup -q | |
127 | %patch0 -p1 | |
6f6c8480 | 128 | %patch1 -p1 |
cb361dd9 | 129 | |
130 | %if %{with kernel} | |
131 | mkdir firmware | |
132 | for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6}; do | |
133 | ln -s $a firmware | |
134 | tar -C firmware -xzf $a | |
135 | done | |
136 | ||
137 | cat > download-logger <<'EOF' | |
138 | #!/bin/sh | |
139 | # keep log of files make wanted to download in firmware/ dir | |
140 | echo "$@" >> download.log | |
141 | EOF | |
142 | chmod a+rx download-logger | |
143 | %endif | |
144 | ||
145 | %build | |
146 | %configure | |
1a3180a1 AM |
147 | %{__make} \ |
148 | CC="%{__cc}" \ | |
149 | OPTFLAGS="%{rpmcppflags} %{rpmcflags}" | |
cb361dd9 | 150 | |
151 | %install | |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
154 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} | |
155 | ||
6f6c8480 | 156 | %{__make} -j1 install \ |
cb361dd9 | 157 | DESTDIR=$RPM_BUILD_ROOT |
158 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/dahdi | |
159 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/dahdi | |
160 | touch $RPM_BUILD_ROOT%{_sysconfdir}/dahdi.conf | |
161 | ||
162 | %clean | |
163 | rm -rf $RPM_BUILD_ROOT | |
164 | ||
165 | %post init | |
166 | /sbin/chkconfig --add dahdi | |
167 | %service dahdi restart | |
168 | ||
169 | %preun init | |
170 | if [ "$1" = "0" ]; then | |
171 | %service dahdi stop | |
172 | /sbin/chkconfig --del dahdi | |
173 | fi | |
174 | ||
175 | %files | |
176 | %defattr(644,root,root,755) | |
177 | %doc README | |
178 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi.conf | |
179 | %dir %{_sysconfdir}/dahdi | |
180 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dahdi/system.conf | |
181 | #/etc/hotplug/usb/xpp_fxloader | |
182 | #/etc/hotplug/usb/xpp_fxloader.usermap | |
183 | %attr(755,root,root) %{_sbindir}/* | |
184 | %attr(755,root,root) %{_libdir}/*.so.* | |
185 | %if %{with xpp} | |
186 | %{_datadir}/dahdi | |
187 | %{_mandir}/man8/* | |
188 | ||
189 | %files init | |
190 | %defattr(644,root,root,755) | |
191 | %attr(754,root,root) /etc/rc.d/init.d/* | |
192 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/dahdi | |
193 | ||
194 | %files devel | |
195 | %defattr(644,root,root,755) | |
196 | %attr(755,root,root) %{_libdir}/*.so | |
197 | %{_includedir}/dahdi | |
198 | ||
199 | %files static | |
200 | %defattr(644,root,root,755) | |
3d38b294 | 201 | %{_libdir}/*.a |
cb361dd9 | 202 | |
203 | %files utils | |
204 | %defattr(644,root,root,755) | |
205 | %attr(755,root,root) %{_sbindir}/* | |
206 | ||
207 | %files -n perl-Dahdi | |
208 | %defattr(644,root,root,755) | |
6f6c8480 | 209 | %{perl_vendorlib}/Dahdi |
210 | %{perl_vendorlib}/Dahdi.pm | |
cb361dd9 | 211 | %endif |