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