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