]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - cgi-bin package - separate, because of suid-root | |
3 | # - separate plugins into packages | |
4 | # - use shared versions of lpc10, gsm,... | |
5 | # - CFLAGS passing | |
6 | # - fix bluetooth patch | |
7 | # - package commandline tools (aelparse etc.) | |
8 | # - system mxml | |
9 | # - ~/.asterisk_history gets encoded with \xxx on exit, each time yet again | |
10 | # - openh323 is missing regardless of BR, see http://pld.pastebin.com/f7f84c312 | |
11 | # | |
12 | # Conditional build: | |
13 | %bcond_with rxfax # without rx (also tx :-D) fax | |
14 | %bcond_with bluetooth # without bluetooth support (NFT) | |
15 | %bcond_with zhone # zhone hack | |
16 | %bcond_with zhone_hack # huge hack workarounding broken zhone channel banks which start randomly | |
17 | # issuing pulse-dialled calls to weird numbers | |
18 | %bcond_with bristuff # BRIstuff (Junghanns.NET BRI adapters) support | |
19 | %bcond_with verbose # verbose build | |
20 | ||
21 | %define spandsp_version 0.0.2pre26 | |
22 | %define rel 0.4 | |
23 | Summary: Asterisk PBX | |
24 | Summary(pl.UTF-8): Centralka (PBX) Asterisk | |
25 | Name: asterisk | |
26 | Version: 1.6.1.12 | |
27 | Release: %{rel}%{?with_bristuff:.bristuff} | |
28 | License: GPL v2 | |
29 | Group: Applications/System | |
30 | Source0: http://downloads.digium.com/pub/asterisk/releases/%{name}-%{version}.tar.gz | |
31 | # Source0-md5: d6bc1448b8fa274a2acaef1b15f4d485 | |
32 | Source1: %{name}.init | |
33 | Source2: %{name}.sysconfig | |
34 | Source3: http://downloads.digium.com/pub/telephony/sounds/releases/%{name}-core-sounds-en-gsm-1.4.13.tar.gz | |
35 | # Source3-md5: 65add705003e9aebdb4cd03bd1a26f97 | |
36 | Source4: http://downloads.digium.com/pub/telephony/sounds/%{name}-moh-freeplay-wav.tar.gz | |
37 | # Source4-md5: e523fc2b4ac524f45da7815e97780540 | |
38 | Source5: %{name}.logrotate | |
39 | Source10: http://soft-switch.org/downloads/spandsp/spandsp-%{spandsp_version}/asterisk-1.2.x/app_txfax.c | |
40 | # Source10-md5: 8c8fcb263b76897022b4c28052a7b439 | |
41 | Source11: http://soft-switch.org/downloads/spandsp/spandsp-%{spandsp_version}/asterisk-1.2.x/app_rxfax.c | |
42 | # Source11-md5: ab6983b51c412883545b36993d704999 | |
43 | Patch2: %{name}-no_k6_on_sparc.patch | |
44 | Patch3: %{name}-lib.patch | |
45 | Patch4: %{name}-ppc.patch | |
46 | Patch5: external-libedit.patch | |
47 | Patch6: pkg-config-gmime.patch | |
48 | Patch7: FHS-paths.patch | |
49 | # http://soft-switch.org/downloads/spandsp/spandsp-%{spandsp_version}/asterisk-1.2.x/apps_Makefile.patch | |
50 | Patch10: %{name}-txfax-Makefile.patch | |
51 | Patch12: %{name}-chan_bluetooth.patch | |
52 | Patch13: %{name}-zhone.patch | |
53 | # http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff | |
54 | Patch14: %{name}-bristuff.patch | |
55 | Patch15: %{name}-bristuff-build.patch | |
56 | Patch16: %{name}-bristuff-libpri.patch | |
57 | URL: http://www.asterisk.org/ | |
58 | BuildRequires: OSPToolkit | |
59 | BuildRequires: SDL_image-devel | |
60 | BuildRequires: alsa-lib-devel | |
61 | BuildRequires: autoconf | |
62 | BuildRequires: automake | |
63 | BuildRequires: bison | |
64 | %{?with_bluetooth:BuildRequires: bluez-devel} | |
65 | BuildRequires: curl-devel | |
66 | BuildRequires: dahdi-linux-devel | |
67 | BuildRequires: dahdi-tools-devel | |
68 | BuildRequires: freetds-devel >= 0.63 | |
69 | BuildRequires: gawk | |
70 | BuildRequires: gcc >= 5:3.4 | |
71 | BuildRequires: gmime22-devel | |
72 | BuildRequires: iksemel-devel | |
73 | BuildRequires: imap-devel | |
74 | BuildRequires: jack-audio-connection-kit-devel | |
75 | BuildRequires: libcap-devel | |
76 | BuildRequires: libedit-devel | |
77 | BuildRequires: libogg-devel | |
78 | BuildRequires: libvorbis-devel | |
79 | BuildRequires: mISDNuser-devel | |
80 | BuildRequires: mysql-devel | |
81 | BuildRequires: ncurses-devel | |
82 | BuildRequires: net-snmp-devel | |
83 | BuildRequires: newt-devel | |
84 | BuildRequires: openais-devel | |
85 | BuildRequires: openh323-devel | |
86 | BuildRequires: openldap-devel | |
87 | BuildRequires: openssl-devel >= 0.9.7d | |
88 | BuildRequires: pam-devel | |
89 | BuildRequires: pkgconfig | |
90 | BuildRequires: popt-devel | |
91 | BuildRequires: portaudio-devel | |
92 | BuildRequires: postgresql-devel | |
93 | BuildRequires: pwlib-devel | |
94 | BuildRequires: radiusclient-ng-devel | |
95 | BuildRequires: rpmbuild(macros) >= 1.268 | |
96 | BuildRequires: sed >= 4.0 | |
97 | BuildRequires: spandsp-devel | |
98 | %{?with_rxfax:BuildRequires: spandsp-devel-%{spandsp_version}} | |
99 | BuildRequires: speex-devel | |
100 | BuildRequires: sqlite-devel | |
101 | BuildRequires: sqlite3-devel | |
102 | BuildRequires: unixODBC-devel | |
103 | BuildRequires: xorg-lib-libX11-devel | |
104 | BuildRequires: zlib-devel | |
105 | %if %{with bristuff} | |
106 | BuildRequires: libgsmat-devel | |
107 | BuildRequires: libpri-bristuff-devel >= 1.2.4 | |
108 | %else | |
109 | BuildRequires: libpri-devel >= 1.2.4 | |
110 | %endif | |
111 | Requires(post,preun): /sbin/chkconfig | |
112 | Requires: rc-scripts | |
113 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
114 | ||
115 | %description | |
116 | Asterisk is an Open Source PBX and telephony development platform that | |
117 | can both replace a conventional PBX and act as a platform for | |
118 | developing custom telephony applications for delivering dynamic | |
119 | content over a telephone similarly to how one can deliver dynamic | |
120 | content through a web browser using CGI and a web server. | |
121 | ||
122 | Asterisk talks to a variety of telephony hardware including BRI, PRI, | |
123 | POTS, and IP telephony clients using the Inter-Asterisk eXchange | |
124 | protocol (e.g. gnophone or miniphone). For more information and a | |
125 | current list of supported hardware, see http://www.asterisk.org/. | |
126 | ||
127 | %description -l pl.UTF-8 | |
128 | Asterisk to wolnodostępna centralka (PBX) i platforma programistyczna | |
129 | dla telefonii, mogąca zastąpić konwencjonalne PBX-y oraz służyć jako | |
130 | platforma do rozwijania własnych aplikacji telefonicznych do | |
131 | przekazywania dynamicznej treści przez telefon, podobnie jak można | |
132 | przekazywać dynamiczną treść przez przeglądarkę WWW przy użyciu CGI i | |
133 | serwera WWW. | |
134 | ||
135 | Asterisk współpracuje z wielorakim sprzętem telefonicznym, w tym BRI, | |
136 | PRI, POTS oraz klienty telefonii IP używające protokołu Inter-Asterisk | |
137 | eXchange (np. gnophone lub miniphone). Więcej informacji i listę | |
138 | obsługiwanego sprzętu można znaleźć pod http://www.asterisk.org/. | |
139 | ||
140 | %package devel | |
141 | Summary: Header files for Asterisk platform | |
142 | Summary(pl.UTF-8): Pliki nagłówkowe platformy Asterisk | |
143 | Group: Development | |
144 | ||
145 | %description devel | |
146 | Header files for Asterisk development platform. | |
147 | ||
148 | %description devel -l pl.UTF-8 | |
149 | Pliki nagłówkowe platformy programistycznej Asterisk. | |
150 | ||
151 | %package examples | |
152 | Summary: Example files for the Asterisk PBX | |
153 | Summary(pl.UTF-8): Pliki przykładowe dla centralki Asterisk | |
154 | Group: Applications/System | |
155 | Requires: %{name} = %{version}-%{release} | |
156 | ||
157 | %description examples | |
158 | Example files for the Asterisk PBX. | |
159 | ||
160 | %description examples -l pl.UTF-8 | |
161 | Pliki przykładowe dla centralki Asterisk. | |
162 | ||
163 | %prep | |
164 | %setup -q | |
165 | %patch2 -p1 | |
166 | %patch3 -p1 | |
167 | %patch4 -p1 | |
168 | %patch5 -p0 | |
169 | %patch6 -p0 | |
170 | %patch7 -p0 | |
171 | ||
172 | %if %{with zhone} | |
173 | sed -i -e 's|.*#define.*ZHONE_HACK.*|#define ZHONE_HACK 1|g' channels/chan_zap.c | |
174 | %endif | |
175 | ||
176 | %if %{with rxfax} | |
177 | cd apps | |
178 | %patch10 -p0 | |
179 | cp %{SOURCE10} . | |
180 | cp %{SOURCE11} . | |
181 | %endif | |
182 | ||
183 | %{?with_bluetooth:%patch12 -p1} | |
184 | %{?with_zhonehack:%patch13 -p1} | |
185 | ||
186 | %if %{with bristuff} | |
187 | %patch14 -p1 | |
188 | %patch15 -p1 | |
189 | %patch16 -p1 | |
190 | %endif | |
191 | ||
192 | # avoid using it | |
193 | rm -rf imap | |
194 | ||
195 | %build | |
196 | rm -f pbx/.depend | |
197 | ||
198 | %{__aclocal} -I autoconf | |
199 | %{__autoheader} | |
200 | %{__autoconf} | |
201 | ||
202 | export CPPFLAGS="%{rpmcppflags} -I/usr/include/openh323" | |
203 | export WGET="/bin/true" | |
204 | ||
205 | # be sure to invoke ./configure with our flags | |
206 | cd menuselect/mxml | |
207 | %configure2_13 | |
208 | cd ../../ | |
209 | ||
210 | cd menuselect | |
211 | %{__aclocal} | |
212 | %{__autoheader} | |
213 | %{__autoconf} | |
214 | %configure | |
215 | cd .. | |
216 | ||
217 | cd main/editline | |
218 | %configure2_13 | |
219 | cd ../.. | |
220 | ||
221 | %configure \ | |
222 | %{?with_bristuff:--with-gsmat=%{_prefix}} \ | |
223 | --with-imap=system \ | |
224 | --with-gsm=/usr \ | |
225 | --with-libedit=yes | |
226 | ||
227 | # safe checks | |
228 | %{?with_bristuff:grep '^#define HAVE_GSMAT 1' include/asterisk/autoconfig.h || exit 1} | |
229 | ||
230 | cp -f .cleancount .lastclean | |
231 | ||
232 | %{__make} -j1 -C menuselect \ | |
233 | %{?with_verbose:NOISY_BUILD=yes} \ | |
234 | CC="%{__cc}" \ | |
235 | OPTIMIZE="%{rpmcflags}" | |
236 | ||
237 | %{__make} -j1 \ | |
238 | %{?with_verbose:NOISY_BUILD=yes} \ | |
239 | CC="%{__cc}" \ | |
240 | OPTIMIZE="%{rpmcflags}" \ | |
241 | CHANNEL_LIBS+=chan_bluetooth.so || : | |
242 | ||
243 | # rerun needed; asterisk wants that | |
244 | %{__make} -j1 \ | |
245 | %{?with_verbose:NOISY_BUILD=yes} \ | |
246 | CC="%{__cc}" \ | |
247 | OPTIMIZE="%{rpmcflags}" \ | |
248 | CHANNEL_LIBS+=chan_bluetooth.so | |
249 | ||
250 | # it requires doxygen - I don't know if we should do this... | |
251 | #%{__make} progdocs | |
252 | ||
253 | # safe checks | |
254 | %{?with_bristuff:objdump -p channels/chan_zap.so | grep -qE 'NEEDED +libgsmat\.so' || exit 1} | |
255 | ||
256 | %install | |
257 | rm -rf $RPM_BUILD_ROOT | |
258 | install -d $RPM_BUILD_ROOT{/var/{log/asterisk/cdr-csv,spool/asterisk/monitor},/etc/{rc.d/init.d,sysconfig,logrotate.d}} | |
259 | ||
260 | install %{SOURCE3} sounds | |
261 | install %{SOURCE4} sounds | |
262 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
263 | ||
264 | %{__make} -j1 install \ | |
265 | DESTDIR=$RPM_BUILD_ROOT | |
266 | %{__make} -j1 samples \ | |
267 | DESTDIR=$RPM_BUILD_ROOT | |
268 | ||
269 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
270 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
271 | ||
272 | # unpackaged at this point | |
273 | rm $RPM_BUILD_ROOT/var/lib/asterisk/moh/.asterisk-moh-opsound-wav | |
274 | rm $RPM_BUILD_ROOT/var/lib/asterisk/moh/CHANGES-asterisk-moh-opsound-wav | |
275 | rm $RPM_BUILD_ROOT/var/lib/asterisk/moh/CREDITS-asterisk-moh-opsound-wav | |
276 | rm $RPM_BUILD_ROOT/var/lib/asterisk/moh/LICENSE-asterisk-moh-opsound-wav | |
277 | rm $RPM_BUILD_ROOT/var/lib/asterisk/sounds/.asterisk-core-sounds-en-gsm-1.4.16 | |
278 | rm $RPM_BUILD_ROOT/var/lib/asterisk/sounds/en/CHANGES-asterisk-core-en-1.4.16 | |
279 | rm $RPM_BUILD_ROOT/var/lib/asterisk/sounds/en/core-sounds-en.txt | |
280 | rm $RPM_BUILD_ROOT/var/lib/asterisk/sounds/en/CREDITS-asterisk-core-en-1.4.16 | |
281 | rm $RPM_BUILD_ROOT/var/lib/asterisk/sounds/en/LICENSE-asterisk-core-en-1.4.16 | |
282 | ||
283 | %clean | |
284 | rm -rf $RPM_BUILD_ROOT | |
285 | ||
286 | %post | |
287 | /sbin/chkconfig --add asterisk | |
288 | # this was insane; breaking all current calls | |
289 | #%%service asterisk restart "Asterisk daemon" | |
290 | ||
291 | %preun | |
292 | if [ "$1" = "0" ]; then | |
293 | %service asterisk stop | |
294 | /sbin/chkconfig --del asterisk | |
295 | fi | |
296 | ||
297 | %files | |
298 | %defattr(644,root,root,755) | |
299 | %doc BUGS ChangeLog CHANGES CREDITS README* UPGRADE.txt configs doc/*.txt | |
300 | %attr(755,root,root) %{_sbindir}/* | |
301 | %dir %{_sysconfdir}/asterisk | |
302 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
303 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} | |
304 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
305 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.conf | |
306 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.adsi | |
307 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.lua | |
308 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/extensions.ael | |
309 | %dir %{_libdir}/asterisk | |
310 | %dir %{_libdir}/asterisk/modules | |
311 | %attr(755,root,root) %{_libdir}/asterisk/modules/app_*.so | |
312 | %attr(755,root,root) %{_libdir}/asterisk/modules/cdr_*.so | |
313 | %attr(755,root,root) %{_libdir}/asterisk/modules/chan_*.so | |
314 | %attr(755,root,root) %{_libdir}/asterisk/modules/codec_*.so | |
315 | %attr(755,root,root) %{_libdir}/asterisk/modules/format_*.so | |
316 | %attr(755,root,root) %{_libdir}/asterisk/modules/func_*.so | |
317 | %attr(755,root,root) %{_libdir}/asterisk/modules/pbx_*.so | |
318 | %attr(755,root,root) %{_libdir}/asterisk/modules/res_*.so | |
319 | ||
320 | %dir /var/lib/asterisk | |
321 | %dir /var/lib/asterisk/agi-bin | |
322 | %dir /var/lib/asterisk/images | |
323 | %dir /var/lib/asterisk/keys | |
324 | %dir /var/lib/asterisk/moh | |
325 | /var/lib/asterisk/moh/*.wav | |
326 | %dir /var/lib/asterisk/sounds | |
327 | %dir /var/lib/asterisk/sounds/en | |
328 | %dir /var/lib/asterisk/sounds/en/digits | |
329 | %dir /var/lib/asterisk/sounds/en/dictate | |
330 | %dir /var/lib/asterisk/sounds/en/followme | |
331 | %dir /var/lib/asterisk/sounds/en/letters | |
332 | %dir /var/lib/asterisk/sounds/en/phonetic | |
333 | %dir /var/lib/asterisk/sounds/en/silence | |
334 | /var/lib/asterisk/images/*.jpg | |
335 | /var/lib/asterisk/keys/*.pub | |
336 | /var/lib/asterisk/phoneprov | |
337 | /var/lib/asterisk/sounds/en/*.gsm | |
338 | /var/lib/asterisk/sounds/en/digits/*.gsm | |
339 | /var/lib/asterisk/sounds/en/dictate/*.gsm | |
340 | /var/lib/asterisk/sounds/en/followme/*.gsm | |
341 | /var/lib/asterisk/sounds/en/letters/*.gsm | |
342 | /var/lib/asterisk/sounds/en/phonetic/*.gsm | |
343 | /var/lib/asterisk/sounds/en/silence/*.gsm | |
344 | /var/lib/asterisk/static-http | |
345 | %dir /var/spool/asterisk | |
346 | %dir /var/spool/asterisk/monitor | |
347 | %dir /var/spool/asterisk/voicemail | |
348 | %dir /var/spool/asterisk/voicemail/default | |
349 | %dir /var/spool/asterisk/voicemail/default/1234 | |
350 | %dir /var/spool/asterisk/voicemail/default/1234/en | |
351 | %dir /var/log/asterisk | |
352 | %dir /var/log/asterisk/cdr-csv | |
353 | %{_mandir}/man8/asterisk.8* | |
354 | %{_mandir}/man8/astgenkey.8* | |
355 | %{_mandir}/man8/autosupport.8* | |
356 | %{_mandir}/man8/safe_asterisk.8* | |
357 | %dir /var/lib/asterisk/firmware | |
358 | %dir /var/lib/asterisk/firmware/iax | |
359 | #/var/lib/asterisk/firmware/iax/iaxy.bin | |
360 | ||
361 | %files examples | |
362 | %defattr(644,root,root,755) | |
363 | %attr(755,root,root) /var/lib/asterisk/agi-bin/agi-test.agi | |
364 | %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-sphinx-test | |
365 | %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-test | |
366 | %attr(755,root,root) /var/lib/asterisk/agi-bin/jukebox.agi | |
367 | /var/spool/asterisk/voicemail/default/1234/en/busy.gsm | |
368 | /var/spool/asterisk/voicemail/default/1234/en/unavail.gsm | |
369 | ||
370 | %files devel | |
371 | %defattr(644,root,root,755) | |
372 | %dir %{_includedir}/asterisk | |
373 | %{_includedir}/asterisk/*.h | |
374 | %{_includedir}/asterisk.h |