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