]> git.pld-linux.org Git - packages/asterisk.git/blob - asterisk.spec
- use external libedit
[packages/asterisk.git] / asterisk.spec
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)
12 %bcond_without  h323            # With H.323 support
13 %bcond_with     zaptel          # zaptel instead of dahdi
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 #
22 Summary:        Asterisk PBX
23 Summary(pl.UTF-8):      Centralka (PBX) Asterisk
24 Name:           asterisk
25 Version:        1.4.44
26 Release:        1%{?with_bristuff:.bristuff}
27 License:        GPL v2
28 Group:          Applications/System
29 Source0:        http://downloads.digium.com/pub/asterisk/releases/%{name}-%{version}.tar.gz
30 # Source0-md5:  31daa6d5702f58bea1448e9ef45c9c8e
31 Source1:        %{name}.init
32 Source2:        %{name}.sysconfig
33 Source3:        http://downloads.digium.com/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.4.6.tar.gz
34 # Source3-md5:  02e582b6c7de58e5eaba220229c0a71a
35 Source4:        http://downloads.digium.com/pub/telephony/sounds/asterisk-moh-freeplay-wav.tar.gz
36 # Source4-md5:  e523fc2b4ac524f45da7815e97780540
37 Source5:        %{name}.logrotate
38 Patch0:         %{name}-m4.patch
39 Patch1:         %{name}-configure.patch
40 Patch2:         %{name}-no_k6_on_sparc.patch
41 Patch3:         %{name}-lib.patch
42 Patch4:         %{name}-external-libedit.patch
43 Source10:       http://soft-switch.org/downloads/spandsp/spandsp-%{_spandsp_version}/asterisk-1.2.x/app_txfax.c
44 # Source10-md5: 8c8fcb263b76897022b4c28052a7b439
45 Source11:       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
48 Patch10:        %{name}-txfax-Makefile.patch
49 Patch11:        %{name}-fix-ptlib.patch
50 Patch12:        %{name}-chan_bluetooth.patch
51 Patch13:        %{name}-zhone.patch
52 # http://svn.debian.org/wsvn/pkg-voip/asterisk/trunk/debian/patches/bristuff
53 Patch14:        %{name}-bristuff.patch
54 Patch15:        %{name}-bristuff-build.patch
55 Patch16:        %{name}-bristuff-libpri.patch
56 Patch17:        %{name}-r150557.patch
57 URL:            http://www.asterisk.org/
58 BuildRequires:  autoconf
59 BuildRequires:  automake
60 BuildRequires:  bison
61 %{?with_bluetooth:BuildRequires: bluez-devel}
62 %if %{with zaptel}
63 BuildRequires:  zaptel-devel >= 1.2.10
64 %else
65 BuildRequires:  dahdi-linux-devel
66 %endif
67 BuildRequires:  freetds >= 0.63
68 BuildRequires:  gawk
69 BuildRequires:  gcc >= 5:3.4
70 BuildRequires:  iksemel-devel
71 BuildRequires:  imap-static
72 BuildRequires:  libedit-devel
73 BuildRequires:  mysql-devel
74 BuildRequires:  ncurses-devel
75 BuildRequires:  openssl-devel >= 0.9.7d
76 BuildRequires:  rpmbuild(macros) >= 1.268
77 BuildRequires:  sed >= 4.0
78 %{?with_rxfax:BuildRequires:    spandsp-devel-%{_spandsp_version}}
79 BuildRequires:  speex-devel
80 BuildRequires:  unixODBC-devel
81 BuildRequires:  zlib-devel
82 %if %{with h323}
83 BuildRequires:  openh323-devel
84 BuildRequires:  pwlib-devel
85 %endif
86 %if %{with bristuff}
87 BuildRequires:  libgsmat-devel
88 BuildRequires:  libpri-bristuff-devel >= 1.2.4
89 %else
90 BuildRequires:  libpri-devel >= 1.2.4
91 %endif
92 Requires(post,preun):   /sbin/chkconfig
93 Requires:       rc-scripts
94 %if %{with h323}
95 %requires_eq    openh323
96 %requires_eq    pwlib
97 %endif
98 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99
100 %description
101 Asterisk is an Open Source PBX and telephony development platform that
102 can both replace a conventional PBX and act as a platform for
103 developing custom telephony applications for delivering dynamic
104 content over a telephone similarly to how one can deliver dynamic
105 content through a web browser using CGI and a web server.
106
107 Asterisk talks to a variety of telephony hardware including BRI, PRI,
108 POTS, and IP telephony clients using the Inter-Asterisk eXchange
109 protocol (e.g. gnophone or miniphone). For more information and a
110 current list of supported hardware, see http://www.asterisk.org/.
111
112 %description -l pl.UTF-8
113 Asterisk to wolnodostępna centralka (PBX) i platforma programistyczna
114 dla telefonii, mogąca zastąpić konwencjonalne PBX-y oraz służyć jako
115 platforma do rozwijania własnych aplikacji telefonicznych do
116 przekazywania dynamicznej treści przez telefon, podobnie jak można
117 przekazywać dynamiczną treść przez przeglądarkę WWW przy użyciu CGI i
118 serwera WWW.
119
120 Asterisk współpracuje z wielorakim sprzętem telefonicznym, w tym BRI,
121 PRI, POTS oraz klienty telefonii IP używające protokołu Inter-Asterisk
122 eXchange (np. gnophone lub miniphone). Więcej informacji i listę
123 obsługiwanego sprzętu można znaleźć pod http://www.asterisk.org/.
124
125 %package devel
126 Summary:        Header files for Asterisk platform
127 Summary(pl.UTF-8):      Pliki nagłówkowe platformy Asterisk
128 Group:          Development
129
130 %description devel
131 Header files for Asterisk development platform.
132
133 %description devel -l pl.UTF-8
134 Pliki nagłówkowe platformy programistycznej Asterisk.
135
136 %package examples
137 Summary:        Example files for the Asterisk PBX
138 Summary(pl.UTF-8):      Pliki przykładowe dla centralki Asterisk
139 Group:          Applications/System
140 Requires:       %{name} = %{version}-%{release}
141
142 %description examples
143 Example files for the Asterisk PBX.
144
145 %description examples -l pl.UTF-8
146 Pliki przykładowe dla centralki Asterisk.
147
148 %prep
149 %setup -q -n %{name}-%{version}
150
151 %{?with_zhone:sed -i -e 's|.*#define.*ZHONE_HACK.*|#define ZHONE_HACK 1|g' channels/chan_dahdi.c}
152
153 #%patch0 -p0
154 #%patch1 -p1
155 #%patch2 -p1
156 #%patch3 -p1
157 #%patch5 -p1
158 #%patch6 -p1
159 #%patch7 -p1
160 #%patch9 -p1
161 %patch4 -p1
162
163 %if %{with rxfax}
164 cd apps
165 %patch10 -p0
166 cp %{SOURCE10} .
167 cp %{SOURCE11} .
168 %endif
169
170 #%patch11 -p1
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
179 #%patch17 -p2
180
181 sed -i -e "s#/usr/lib/#/usr/%{_lib}/#g#" Makefile
182
183 mkdir -p imap/c-client
184 ln -s %{_libdir}/libc-client.a imap/c-client/c-client.a
185 ln -s %{_includedir}/imap/* imap/c-client/
186 echo '-lssl -lpam' > imap/c-client/LDFLAGS
187
188 %build
189 rm -f pbx/.depend
190
191 %{__aclocal} -I autoconf
192 %{__autoheader}
193 %{__autoconf}
194
195 CPPFLAGS="%{rpmcppflags} -I/usr/include/imap"; export CPPFLAGS
196 %if %{with h323}
197 CPPFLAGS="$CPPFLAGS -I/usr/include/openh323"; export CPPFLAGS
198 %endif
199 %configure \
200 %if %{with zaptel}
201         --with-zaptel=%{_prefix} \
202         --without-dahdi \
203 %else
204         --with-dahdi=%{_prefix} \
205         --without-zaptel \
206 %endif
207         --without-osptk \
208         %{!?with_h323:--without-h323} \
209         %{?with_bristuff:--with-gsmat=%{_prefix}} \
210         --with-imap="`pwd`"/imap
211
212
213 # safe checks
214 %{?with_bristuff:grep '^#define HAVE_GSMAT 1' include/asterisk/autoconfig.h || exit 1}
215
216 cp -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
240 %{?with_bristuff:objdump -p channels/chan_dahdi.so | grep -qE 'NEEDED +libgsmat\.so' || exit 1}
241
242 %install
243 rm -rf $RPM_BUILD_ROOT
244 install -d $RPM_BUILD_ROOT{/var/{log/asterisk/cdr-csv,spool/asterisk/monitor},/etc/{rc.d/init.d,sysconfig,logrotate.d}}
245
246 install %{SOURCE3} sounds
247 install %{SOURCE4} sounds
248 install %{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
255 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
256 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
257
258 %clean
259 rm -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
267 if [ "$1" = "0" ]; then
268         %service asterisk stop
269         /sbin/chkconfig --del asterisk
270 fi
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
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
295 /var/lib/asterisk/moh/reno_project-system.wav
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
326 #/var/lib/asterisk/firmware/iax/iaxy.bin
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.080723 seconds and 4 git commands to generate.