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