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