]>
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 | # | |
9 | # Conditional build: | |
10 | %bcond_with rxfax # without rx (also tx :-D) fax | |
11 | %bcond_with bluetooth # without bluetooth support (NFT) | |
12 | %bcond_with zhone # zhone hack | |
13 | %bcond_with zhone_hack # huge hack workarounding broken zhone channel banks which start randomly | |
14 | # issuing pulse-dialled calls to weird numbers | |
15 | %bcond_with bristuff # BRIstuff (Junghanns.NET BRI adapters) support | |
16 | %bcond_with verbose # verbose build | |
17 | # | |
18 | %define _spandsp_version 0.0.2pre26 | |
19 | # | |
20 | Summary: Asterisk PBX | |
21 | Summary(pl.UTF-8): Centralka (PBX) Asterisk | |
22 | Name: asterisk | |
23 | Version: 1.6.0.1 | |
24 | Release: 1%{?with_bristuff:.bristuff} | |
25 | License: GPL v2 | |
26 | Group: Applications/System | |
27 | Source0: http://ftp.digium.com/pub/asterisk/releases/%{name}-%{version}.tar.gz | |
28 | # Source0-md5: 5277db1134f0dc736932279c6a25c29a | |
29 | Source1: %{name}.init | |
30 | Source2: %{name}.sysconfig | |
31 | Source3: http://ftp.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.4.13.tar.gz | |
32 | # Source3-md5: 65add705003e9aebdb4cd03bd1a26f97 | |
33 | Source4: http://ftp.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-wav.tar.gz | |
34 | # Source4-md5: e523fc2b4ac524f45da7815e97780540 | |
35 | Source5: %{name}.logrotate | |
36 | Patch0: %{name}-m4.patch | |
37 | Patch1: %{name}-configure.patch | |
38 | Patch2: %{name}-no_k6_on_sparc.patch | |
39 | Patch3: %{name}-lib.patch | |
40 | Source10: http://soft-switch.org/downloads/spandsp/spandsp-%{_spandsp_version}/asterisk-1.2.x/app_txfax.c | |
41 | # Source10-md5: 8c8fcb263b76897022b4c28052a7b439 | |
42 | Source11: http://soft-switch.org/downloads/spandsp/spandsp-%{_spandsp_version}/asterisk-1.2.x/app_rxfax.c | |
43 | # Source11-md5: ab6983b51c412883545b36993d704999 | |
44 | # http://soft-switch.org/downloads/spandsp/spandsp-%{_spandsp_version}/asterisk-1.2.x/apps_Makefile.patch | |
45 | Patch10: %{name}-txfax-Makefile.patch | |
46 | Patch11: %{name}-fix-ptlib.patch | |
47 | Patch12: %{name}-chan_bluetooth.patch | |
48 | Patch13: %{name}-zhone.patch | |
49 | # http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff | |
50 | Patch14: %{name}-bristuff.patch | |
51 | Patch15: %{name}-bristuff-build.patch | |
52 | Patch16: %{name}-bristuff-libpri.patch | |
53 | URL: http://www.asterisk.org/ | |
54 | # http://downloads.digium.com/pub/security/AST-2009-001.html | |
55 | # Upgrade to 1.6.0.3: | |
56 | BuildRequires: security(CVE-2009-0041) | |
57 | # http://downloads.digium.com/pub/security/AST-2009-002.html | |
58 | # Upgrade to 1.6.0.6: | |
59 | BuildRequires: security(CVE-2009-0871) | |
60 | # http://downloads.digium.com/pub/security/AST-2009-003.html | |
61 | # Upgrade to 1.6.0.8: | |
62 | BuildRequires: security(CVE-2008-3903) | |
63 | BuildRequires: autoconf | |
64 | BuildRequires: automake | |
65 | BuildRequires: bison | |
66 | %{?with_bluetooth:BuildRequires: bluez-devel} | |
67 | BuildRequires: freetds >= 0.63 | |
68 | BuildRequires: gawk | |
69 | BuildRequires: gcc >= 5:3.4 | |
70 | BuildRequires: iksemel-devel | |
71 | BuildRequires: imap-static | |
72 | BuildRequires: mysql-devel | |
73 | BuildRequires: ncurses-devel | |
74 | BuildRequires: openssl-devel >= 0.9.7d | |
75 | BuildRequires: rpmbuild(macros) >= 1.268 | |
76 | BuildRequires: sed >= 4.0 | |
77 | %{?with_rxfax:BuildRequires: spandsp-devel-%{_spandsp_version}} | |
78 | BuildRequires: speex-devel | |
79 | BuildRequires: unixODBC-devel | |
80 | BuildRequires: zaptel-devel >= 1.2.10 | |
81 | BuildRequires: zlib-devel | |
82 | BuildRequires: openh323-devel | |
83 | BuildRequires: pwlib-devel | |
84 | %if %{with bristuff} | |
85 | BuildRequires: libgsmat-devel | |
86 | BuildRequires: libpri-bristuff-devel >= 1.2.4 | |
87 | %else | |
88 | BuildRequires: libpri-devel >= 1.2.4 | |
89 | %endif | |
90 | Requires(post,preun): /sbin/chkconfig | |
91 | Requires: rc-scripts | |
92 | %requires_eq openh323 | |
93 | %requires_eq pwlib | |
94 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
95 | ||
96 | %description | |
97 | Asterisk is an Open Source PBX and telephony development platform that | |
98 | can both replace a conventional PBX and act as a platform for | |
99 | developing custom telephony applications for delivering dynamic | |
100 | content over a telephone similarly to how one can deliver dynamic | |
101 | content through a web browser using CGI and a web server. | |
102 | ||
103 | Asterisk talks to a variety of telephony hardware including BRI, PRI, | |
104 | POTS, and IP telephony clients using the Inter-Asterisk eXchange | |
105 | protocol (e.g. gnophone or miniphone). For more information and a | |
106 | current list of supported hardware, see http://www.asterisk.org/. | |
107 | ||
108 | %description -l pl.UTF-8 | |
109 | Asterisk to wolnodostępna centralka (PBX) i platforma programistyczna | |
110 | dla telefonii, mogąca zastąpić konwencjonalne PBX-y oraz służyć jako | |
111 | platforma do rozwijania własnych aplikacji telefonicznych do | |
112 | przekazywania dynamicznej treści przez telefon, podobnie jak można | |
113 | przekazywać dynamiczną treść przez przeglądarkę WWW przy użyciu CGI i | |
114 | serwera WWW. | |
115 | ||
116 | Asterisk współpracuje z wielorakim sprzętem telefonicznym, w tym BRI, | |
117 | PRI, POTS oraz klienty telefonii IP używające protokołu Inter-Asterisk | |
118 | eXchange (np. gnophone lub miniphone). Więcej informacji i listę | |
119 | obsługiwanego sprzętu można znaleźć pod http://www.asterisk.org/. | |
120 | ||
121 | %package devel | |
122 | Summary: Header files for Asterisk platform | |
123 | Summary(pl.UTF-8): Pliki nagłówkowe platformy Asterisk | |
124 | Group: Development | |
125 | ||
126 | %description devel | |
127 | Header files for Asterisk development platform. | |
128 | ||
129 | %description devel -l pl.UTF-8 | |
130 | Pliki nagłówkowe platformy programistycznej Asterisk. | |
131 | ||
132 | %package examples | |
133 | Summary: Example files for the Asterisk PBX | |
134 | Summary(pl.UTF-8): Pliki przykładowe dla centralki Asterisk | |
135 | Group: Applications/System | |
136 | Requires: %{name} = %{version}-%{release} | |
137 | ||
138 | %description examples | |
139 | Example files for the Asterisk PBX. | |
140 | ||
141 | %description examples -l pl.UTF-8 | |
142 | Pliki przykładowe dla centralki Asterisk. | |
143 | ||
144 | %prep | |
145 | %setup -q -n %{name}-%{version} | |
146 | ||
147 | %{?with_zhone:sed -i -e 's|.*#define.*ZHONE_HACK.*|#define ZHONE_HACK 1|g' channels/chan_zap.c} | |
148 | ||
149 | %patch0 -p0 | |
150 | #%patch1 -p1 | |
151 | #%patch2 -p1 | |
152 | #%patch3 -p1 | |
153 | #%patch5 -p1 | |
154 | #%patch6 -p1 | |
155 | #%patch7 -p1 | |
156 | #%patch9 -p1 | |
157 | ||
158 | %if %{with rxfax} | |
159 | cd apps | |
160 | %patch10 -p0 | |
161 | cp %{SOURCE10} . | |
162 | cp %{SOURCE11} . | |
163 | %endif | |
164 | ||
165 | %patch11 -p1 | |
166 | ||
167 | %{?with_bluetooth:%patch12 -p1} | |
168 | %{?with_zhonehack:%patch13 -p1} | |
169 | %if %{with bristuff} | |
170 | %patch14 -p1 | |
171 | %patch15 -p1 | |
172 | %patch16 -p1 | |
173 | %endif | |
174 | ||
175 | sed -i -e "s#/usr/lib/#/usr/%{_lib}/#g#" Makefile | |
176 | ||
177 | mkdir -p imap/c-client | |
178 | ln -s %{_libdir}/libc-client.a imap/c-client/c-client.a | |
179 | ln -s %{_includedir}/imap/* imap/c-client/ | |
180 | echo '-lssl -lpam' > imap/c-client/LDFLAGS | |
181 | ||
182 | %build | |
183 | rm -f pbx/.depend | |
184 | ||
185 | %{__aclocal} | |
186 | %{__autoheader} | |
187 | %{__autoconf} | |
188 | ||
189 | CPPFLAGS="-I/usr/include/openh323"; export CPPFLAGS | |
190 | %configure \ | |
191 | %{?with_bristuff:--with-gsmat=%{_prefix}} \ | |
192 | --with-imap="`pwd`"/imap | |
193 | ||
194 | # safe checks | |
195 | %{?with_bristuff:grep '^#define HAVE_GSMAT 1' include/asterisk/autoconfig.h || exit 1} | |
196 | ||
197 | cp -f .cleancount .lastclean | |
198 | ||
199 | %{__make} -j1 -C menuselect \ | |
200 | %{?with_verbose:NOISY_BUILD=yes} \ | |
201 | CC="%{__cc}" \ | |
202 | OPTIMIZE="%{rpmcflags}" | |
203 | ||
204 | %{__make} -j1 \ | |
205 | %{?with_verbose:NOISY_BUILD=yes} \ | |
206 | CC="%{__cc}" \ | |
207 | OPTIMIZE="%{rpmcflags}" \ | |
208 | CHANNEL_LIBS+=chan_bluetooth.so || : | |
209 | ||
210 | # rerun needed; asterisk want's that | |
211 | %{__make} -j1 \ | |
212 | %{?with_verbose:NOISY_BUILD=yes} \ | |
213 | CC="%{__cc}" \ | |
214 | OPTIMIZE="%{rpmcflags}" \ | |
215 | CHANNEL_LIBS+=chan_bluetooth.so | |
216 | ||
217 | # it requires doxygen - I don't know if we should do this... | |
218 | #%{__make} progdocs | |
219 | ||
220 | # safe checks | |
221 | %{?with_bristuff:objdump -p channels/chan_zap.so | grep -qE 'NEEDED +libgsmat\.so' || exit 1} | |
222 | ||
223 | %install | |
224 | rm -rf $RPM_BUILD_ROOT | |
225 | install -d $RPM_BUILD_ROOT{/var/{log/asterisk/cdr-csv,spool/asterisk/monitor},/etc/{rc.d/init.d,sysconfig,logrotate.d}} | |
226 | ||
227 | install %{SOURCE3} sounds | |
228 | install %{SOURCE4} sounds | |
229 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
230 | ||
231 | %{__make} -j1 install \ | |
232 | DESTDIR=$RPM_BUILD_ROOT | |
233 | %{__make} -j1 samples \ | |
234 | DESTDIR=$RPM_BUILD_ROOT | |
235 | ||
236 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
237 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
238 | ||
239 | %clean | |
240 | rm -rf $RPM_BUILD_ROOT | |
241 | ||
242 | %post | |
243 | /sbin/chkconfig --add asterisk | |
244 | # this was insane; breaking all current calls | |
245 | #%%service asterisk restart "Asterisk daemon" | |
246 | ||
247 | %preun | |
248 | if [ "$1" = "0" ]; then | |
249 | %service asterisk stop | |
250 | /sbin/chkconfig --del asterisk | |
251 | fi | |
252 | ||
253 | %files | |
254 | %defattr(644,root,root,755) | |
255 | %doc BUGS ChangeLog CHANGES CREDITS README* UPGRADE.txt configs doc/*.txt | |
256 | %attr(755,root,root) %{_sbindir}/* | |
257 | %dir %{_sysconfdir}/asterisk | |
258 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
259 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} | |
260 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
261 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.conf | |
262 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.adsi | |
263 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.lua | |
264 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/extensions.ael | |
265 | %dir %{_libdir}/asterisk | |
266 | %dir %{_libdir}/asterisk/modules | |
267 | %attr(755,root,root) %{_libdir}/asterisk/modules/*.so | |
268 | %dir /var/lib/asterisk | |
269 | %dir /var/lib/asterisk/agi-bin | |
270 | %dir /var/lib/asterisk/images | |
271 | %dir /var/lib/asterisk/keys | |
272 | %dir /var/lib/asterisk/moh | |
273 | /var/lib/asterisk/moh/fpm-calm-river.wav | |
274 | /var/lib/asterisk/moh/fpm-sunshine.wav | |
275 | /var/lib/asterisk/moh/fpm-world-mix.wav | |
276 | %dir /var/lib/asterisk/sounds | |
277 | %dir /var/lib/asterisk/sounds/en | |
278 | %dir /var/lib/asterisk/sounds/en/digits | |
279 | %dir /var/lib/asterisk/sounds/en/dictate | |
280 | %dir /var/lib/asterisk/sounds/en/followme | |
281 | %dir /var/lib/asterisk/sounds/en/letters | |
282 | %dir /var/lib/asterisk/sounds/en/phonetic | |
283 | %dir /var/lib/asterisk/sounds/en/silence | |
284 | /var/lib/asterisk/images/*.jpg | |
285 | /var/lib/asterisk/keys/*.pub | |
286 | /var/lib/asterisk/phoneprov | |
287 | /var/lib/asterisk/sounds/en/*.gsm | |
288 | /var/lib/asterisk/sounds/en/digits/*.gsm | |
289 | /var/lib/asterisk/sounds/en/dictate/*.gsm | |
290 | /var/lib/asterisk/sounds/en/followme/*.gsm | |
291 | /var/lib/asterisk/sounds/en/letters/*.gsm | |
292 | /var/lib/asterisk/sounds/en/phonetic/*.gsm | |
293 | /var/lib/asterisk/sounds/en/silence/*.gsm | |
294 | /var/lib/asterisk/static-http | |
295 | %dir /var/spool/asterisk | |
296 | %dir /var/spool/asterisk/monitor | |
297 | #%%dir /var/spool/asterisk/vm | |
298 | %dir /var/spool/asterisk/voicemail | |
299 | %dir /var/spool/asterisk/voicemail/default | |
300 | %dir /var/spool/asterisk/voicemail/default/1234 | |
301 | %dir /var/spool/asterisk/voicemail/default/1234/en | |
302 | %dir /var/log/asterisk | |
303 | %dir /var/log/asterisk/cdr-csv | |
304 | %{_mandir}/man8/asterisk.8* | |
305 | %{_mandir}/man8/astgenkey.8* | |
306 | %{_mandir}/man8/autosupport.8* | |
307 | %{_mandir}/man8/safe_asterisk.8* | |
308 | %dir /var/lib/asterisk/firmware | |
309 | %dir /var/lib/asterisk/firmware/iax | |
310 | /var/lib/asterisk/firmware/iax/iaxy.bin | |
311 | ||
312 | %files examples | |
313 | %defattr(644,root,root,755) | |
314 | %attr(755,root,root) /var/lib/asterisk/agi-bin/agi-test.agi | |
315 | %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-sphinx-test | |
316 | %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-test | |
317 | %attr(755,root,root) /var/lib/asterisk/agi-bin/jukebox.agi | |
318 | /var/spool/asterisk/voicemail/default/1234/en/busy.gsm | |
319 | /var/spool/asterisk/voicemail/default/1234/en/unavail.gsm | |
320 | ||
321 | #%dir /var/lib/asterisk/agi-bin/* | |
322 | ||
323 | %files devel | |
324 | %defattr(644,root,root,755) | |
325 | %dir %{_includedir}/asterisk | |
326 | %{_includedir}/asterisk/*.h | |
327 | %{_includedir}/asterisk.h |