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