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