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