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