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