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