]>
Commit | Line | Data |
---|---|---|
b3826e10 | 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.22 | |
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: 7626febc4a01e16e012dfccb9e4ab9d2 | |
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 | 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 | 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 | #%patch9 -p1 | |
148 | ||
149 | %if %{with rxfax} | |
150 | cd apps | |
151 | %patch10 -p0 | |
152 | cp %{SOURCE10} . | |
153 | cp %{SOURCE11} . | |
154 | %endif | |
155 | ||
156 | %patch11 -p1 | |
157 | ||
158 | %{?with_bluetooth:%patch12 -p1} | |
159 | %{?with_zhonehack:%patch13 -p1} | |
160 | %if %{with bristuff} | |
161 | %patch14 -p1 | |
162 | %patch15 -p1 | |
163 | %patch16 -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 | # safe checks | |
186 | %{?with_bristuff:grep '^#define HAVE_GSMAT 1' include/asterisk/autoconfig.h || exit 1} | |
187 | ||
188 | cp -f .cleancount .lastclean | |
189 | ||
190 | %{__make} -j1 -C menuselect \ | |
191 | %{?with_verbose:NOISY_BUILD=yes} \ | |
192 | CC="%{__cc}" \ | |
193 | OPTIMIZE="%{rpmcflags}" | |
194 | ||
195 | %{__make} -j1 \ | |
196 | %{?with_verbose:NOISY_BUILD=yes} \ | |
197 | CC="%{__cc}" \ | |
198 | OPTIMIZE="%{rpmcflags}" \ | |
199 | CHANNEL_LIBS+=chan_bluetooth.so || : | |
200 | ||
201 | # rerun needed; asterisk want's that | |
202 | %{__make} -j1 \ | |
203 | %{?with_verbose:NOISY_BUILD=yes} \ | |
204 | CC="%{__cc}" \ | |
205 | OPTIMIZE="%{rpmcflags}" \ | |
206 | CHANNEL_LIBS+=chan_bluetooth.so | |
207 | ||
208 | # it requires doxygen - I don't know if we should do this... | |
209 | #%{__make} progdocs | |
210 | ||
211 | # safe checks | |
212 | %{?with_bristuff:objdump -p channels/chan_zap.so | grep -qE 'NEEDED +libgsmat\.so' || exit 1} | |
213 | ||
214 | %install | |
215 | rm -rf $RPM_BUILD_ROOT | |
216 | install -d $RPM_BUILD_ROOT{/var/{log/asterisk/cdr-csv,spool/asterisk/monitor},/etc/{rc.d/init.d,sysconfig,logrotate.d}} | |
217 | ||
218 | install %{SOURCE3} sounds | |
219 | install %{SOURCE4} sounds | |
220 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name} | |
221 | ||
222 | %{__make} -j1 install \ | |
223 | DESTDIR=$RPM_BUILD_ROOT | |
224 | %{__make} -j1 samples \ | |
225 | DESTDIR=$RPM_BUILD_ROOT | |
226 | ||
227 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
228 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
229 | ||
230 | %clean | |
231 | rm -rf $RPM_BUILD_ROOT | |
232 | ||
233 | %post | |
234 | /sbin/chkconfig --add asterisk | |
235 | # this was insane; breaking all current calls | |
236 | #%%service asterisk restart "Asterisk daemon" | |
237 | ||
238 | %preun | |
239 | if [ "$1" = "0" ]; then | |
240 | %service asterisk stop | |
241 | /sbin/chkconfig --del asterisk | |
242 | fi | |
243 | ||
244 | %files | |
245 | %defattr(644,root,root,755) | |
246 | %doc BUGS ChangeLog CHANGES CREDITS README* UPGRADE.txt configs doc/*.txt | |
247 | %attr(755,root,root) %{_sbindir}/* | |
248 | %dir %{_sysconfdir}/asterisk | |
249 | %attr(754,root,root) /etc/rc.d/init.d/%{name} | |
250 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name} | |
251 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} | |
252 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.conf | |
253 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.adsi | |
254 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/extensions.ael | |
255 | %dir %{_libdir}/asterisk | |
256 | %dir %{_libdir}/asterisk/modules | |
257 | %attr(755,root,root) %{_libdir}/asterisk/modules/*.so | |
258 | %dir /var/lib/asterisk | |
259 | %dir /var/lib/asterisk/agi-bin | |
260 | %dir /var/lib/asterisk/images | |
261 | %dir /var/lib/asterisk/keys | |
262 | %dir /var/lib/asterisk/moh | |
263 | /var/lib/asterisk/moh/fpm-calm-river.wav | |
264 | /var/lib/asterisk/moh/fpm-sunshine.wav | |
265 | /var/lib/asterisk/moh/fpm-world-mix.wav | |
266 | %dir /var/lib/asterisk/sounds | |
267 | %dir /var/lib/asterisk/sounds/digits | |
268 | %dir /var/lib/asterisk/sounds/dictate | |
269 | %dir /var/lib/asterisk/sounds/followme | |
270 | %dir /var/lib/asterisk/sounds/letters | |
271 | %dir /var/lib/asterisk/sounds/phonetic | |
272 | %dir /var/lib/asterisk/sounds/silence | |
273 | /var/lib/asterisk/images/*.jpg | |
274 | /var/lib/asterisk/keys/*.pub | |
275 | /var/lib/asterisk/sounds/*.gsm | |
276 | /var/lib/asterisk/sounds/digits/*.gsm | |
277 | /var/lib/asterisk/sounds/dictate/*.gsm | |
278 | /var/lib/asterisk/sounds/followme/*.gsm | |
279 | /var/lib/asterisk/sounds/letters/*.gsm | |
280 | /var/lib/asterisk/sounds/phonetic/*.gsm | |
281 | /var/lib/asterisk/sounds/silence/*.gsm | |
282 | %dir /var/spool/asterisk | |
283 | %dir /var/spool/asterisk/monitor | |
284 | #%%dir /var/spool/asterisk/vm | |
285 | %dir /var/spool/asterisk/voicemail | |
286 | %dir /var/spool/asterisk/voicemail/default | |
287 | %dir /var/spool/asterisk/voicemail/default/1234 | |
288 | %dir /var/log/asterisk | |
289 | %dir /var/log/asterisk/cdr-csv | |
290 | %{_mandir}/man8/asterisk.8* | |
291 | %{_mandir}/man8/astgenkey.8* | |
292 | %{_mandir}/man8/autosupport.8* | |
293 | %{_mandir}/man8/safe_asterisk.8* | |
294 | %dir /var/lib/asterisk/firmware | |
295 | %dir /var/lib/asterisk/firmware/iax | |
296 | /var/lib/asterisk/firmware/iax/iaxy.bin | |
297 | ||
298 | %files examples | |
299 | %defattr(644,root,root,755) | |
300 | %attr(755,root,root) /var/lib/asterisk/agi-bin/agi-test.agi | |
301 | %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-sphinx-test | |
302 | %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-test | |
303 | %attr(755,root,root) /var/lib/asterisk/agi-bin/jukebox.agi | |
304 | /var/spool/asterisk/voicemail/default/1234/busy.gsm | |
305 | /var/spool/asterisk/voicemail/default/1234/unavail.gsm | |
306 | ||
307 | #%dir /var/lib/asterisk/agi-bin/* | |
308 | ||
309 | %files devel | |
310 | %defattr(644,root,root,755) | |
311 | %dir %{_includedir}/asterisk | |
312 | %{_includedir}/asterisk/*.h | |
313 | %{_includedir}/asterisk.h |