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