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