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