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