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