]> git.pld-linux.org Git - packages/asterisk.git/blob - asterisk.spec
- move bristuff marker to release; make sure that gsmat is detected when building...
[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%{?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:  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 # 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 %install
212 rm -rf $RPM_BUILD_ROOT
213 install -d $RPM_BUILD_ROOT{/var/{log/asterisk/cdr-csv,spool/asterisk/monitor},/etc/{rc.d/init.d,sysconfig,logrotate.d}}
214
215 install %{SOURCE3} sounds
216 install %{SOURCE4} sounds
217 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
218
219 %{__make} -j1 install \
220         DESTDIR=$RPM_BUILD_ROOT
221 %{__make} -j1 samples \
222         DESTDIR=$RPM_BUILD_ROOT
223
224 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
225 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
226
227 %clean
228 rm -rf $RPM_BUILD_ROOT
229
230 %post
231 /sbin/chkconfig --add asterisk
232 # this was insane; breaking all current calls
233 #%%service asterisk restart "Asterisk daemon"
234
235 %preun
236 if [ "$1" = "0" ]; then
237         %service asterisk stop
238         /sbin/chkconfig --del asterisk
239 fi
240
241 %files
242 %defattr(644,root,root,755)
243 %doc BUGS ChangeLog CHANGES CREDITS README* UPGRADE.txt configs doc/*.txt
244 %attr(755,root,root) %{_sbindir}/*
245 %dir %{_sysconfdir}/asterisk
246 %attr(754,root,root) /etc/rc.d/init.d/%{name}
247 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
248 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
249 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.conf
250 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/*.adsi
251 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/asterisk/extensions.ael
252 %dir %{_libdir}/asterisk
253 %dir %{_libdir}/asterisk/modules
254 %attr(755,root,root) %{_libdir}/asterisk/modules/*.so
255 %dir /var/lib/asterisk
256 %dir /var/lib/asterisk/agi-bin
257 %dir /var/lib/asterisk/images
258 %dir /var/lib/asterisk/keys
259 %dir /var/lib/asterisk/moh
260 /var/lib/asterisk/moh/fpm-calm-river.wav
261 /var/lib/asterisk/moh/fpm-sunshine.wav
262 /var/lib/asterisk/moh/fpm-world-mix.wav
263 %dir /var/lib/asterisk/sounds
264 %dir /var/lib/asterisk/sounds/digits
265 %dir /var/lib/asterisk/sounds/dictate
266 %dir /var/lib/asterisk/sounds/followme
267 %dir /var/lib/asterisk/sounds/letters
268 %dir /var/lib/asterisk/sounds/phonetic
269 %dir /var/lib/asterisk/sounds/silence
270 /var/lib/asterisk/images/*.jpg
271 /var/lib/asterisk/keys/*.pub
272 /var/lib/asterisk/sounds/*.gsm
273 /var/lib/asterisk/sounds/digits/*.gsm
274 /var/lib/asterisk/sounds/dictate/*.gsm
275 /var/lib/asterisk/sounds/followme/*.gsm
276 /var/lib/asterisk/sounds/letters/*.gsm
277 /var/lib/asterisk/sounds/phonetic/*.gsm
278 /var/lib/asterisk/sounds/silence/*.gsm
279 %dir /var/spool/asterisk
280 %dir /var/spool/asterisk/monitor
281 #%%dir /var/spool/asterisk/vm
282 %dir /var/spool/asterisk/voicemail
283 %dir /var/spool/asterisk/voicemail/default
284 %dir /var/spool/asterisk/voicemail/default/1234
285 %dir /var/log/asterisk
286 %dir /var/log/asterisk/cdr-csv
287 %{_mandir}/man8/asterisk.8*
288 %{_mandir}/man8/astgenkey.8*
289 %{_mandir}/man8/autosupport.8*
290 %{_mandir}/man8/safe_asterisk.8*
291 %dir /var/lib/asterisk/firmware
292 %dir /var/lib/asterisk/firmware/iax
293 /var/lib/asterisk/firmware/iax/iaxy.bin
294
295 %files examples
296 %defattr(644,root,root,755)
297 %attr(755,root,root) /var/lib/asterisk/agi-bin/agi-test.agi
298 %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-sphinx-test
299 %attr(755,root,root) /var/lib/asterisk/agi-bin/eagi-test
300 %attr(755,root,root) /var/lib/asterisk/agi-bin/jukebox.agi
301 /var/spool/asterisk/voicemail/default/1234/busy.gsm
302 /var/spool/asterisk/voicemail/default/1234/unavail.gsm
303
304 #%dir /var/lib/asterisk/agi-bin/*
305
306 %files devel
307 %defattr(644,root,root,755)
308 %dir %{_includedir}/asterisk
309 %{_includedir}/asterisk/*.h
310 %{_includedir}/asterisk.h
This page took 0.041432 seconds and 3 git commands to generate.