Gentoo Archives: gentoo-commits

From: "Tony Vroon (chainsaw)" <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/asterisk: asterisk-1.2.35.ebuild ChangeLog asterisk-1.2.37.ebuild
Date: Tue, 01 Dec 2009 10:54:32
Message-Id: E1NFQNJ-0004Ww-Ar@stork.gentoo.org
1 chainsaw 09/12/01 10:54:29
2
3 Modified: asterisk-1.2.35.ebuild ChangeLog
4 Added: asterisk-1.2.37.ebuild
5 Log:
6 Version bump as requested by Rajiv Aaron Manglani <rajiv@g.o> in security bug #295270. Fixes a remote crash caused by a comfort noise payload over 24 bytes in length. Reduce 1.2.35 keywords to PPC, unable to delete at this time.
7 (Portage version: 2.1.7.9/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.7 net-misc/asterisk/asterisk-1.2.35.ebuild
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.35.ebuild?rev=1.7&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.35.ebuild?rev=1.7&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.35.ebuild?r1=1.6&r2=1.7
15
16 Index: asterisk-1.2.35.ebuild
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.35.ebuild,v
19 retrieving revision 1.6
20 retrieving revision 1.7
21 diff -u -r1.6 -r1.7
22 --- asterisk-1.2.35.ebuild 1 Oct 2009 17:20:34 -0000 1.6
23 +++ asterisk-1.2.35.ebuild 1 Dec 2009 10:54:28 -0000 1.7
24 @@ -1,6 +1,6 @@
25 # Copyright 1999-2009 Gentoo Foundation
26 # Distributed under the terms of the GNU General Public License v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.35.ebuild,v 1.6 2009/10/01 17:20:34 armin76 Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.35.ebuild,v 1.7 2009/12/01 10:54:28 chainsaw Exp $
29
30 EAPI=2
31 inherit eutils multilib toolchain-funcs
32 @@ -21,7 +21,7 @@
33
34 SLOT="0"
35 LICENSE="GPL-2"
36 -KEYWORDS="alpha amd64 ~hppa ppc sparc x86"
37 +KEYWORDS="ppc"
38
39 RDEPEND="dev-libs/newt
40 media-sound/sox
41
42
43
44 1.230 net-misc/asterisk/ChangeLog
45
46 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.230&view=markup
47 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.230&content-type=text/plain
48 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.229&r2=1.230
49
50 Index: ChangeLog
51 ===================================================================
52 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
53 retrieving revision 1.229
54 retrieving revision 1.230
55 diff -u -r1.229 -r1.230
56 --- ChangeLog 1 Dec 2009 10:39:11 -0000 1.229
57 +++ ChangeLog 1 Dec 2009 10:54:28 -0000 1.230
58 @@ -1,6 +1,15 @@
59 # ChangeLog for net-misc/asterisk
60 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
61 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.229 2009/12/01 10:39:11 chainsaw Exp $
62 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.230 2009/12/01 10:54:28 chainsaw Exp $
63 +
64 +*asterisk-1.2.37 (01 Dec 2009)
65 +
66 + 01 Dec 2009; <chainsaw@g.o> asterisk-1.2.35.ebuild,
67 + +asterisk-1.2.37.ebuild:
68 + Version bump as requested by Rajiv Aaron Manglani <rajiv@g.o> in
69 + security bug #295270. Fixes a remote crash caused by a comfort noise
70 + payload over 24 bytes in length. Reduce 1.2.35 keywords to PPC, unable to
71 + delete at this time.
72
73 *asterisk-1.6.1.11 (01 Dec 2009)
74
75
76
77
78 1.1 net-misc/asterisk/asterisk-1.2.37.ebuild
79
80 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.37.ebuild?rev=1.1&view=markup
81 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.2.37.ebuild?rev=1.1&content-type=text/plain
82
83 Index: asterisk-1.2.37.ebuild
84 ===================================================================
85 # Copyright 1999-2009 Gentoo Foundation
86 # Distributed under the terms of the GNU General Public License v2
87 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.37.ebuild,v 1.1 2009/12/01 10:54:28 chainsaw Exp $
88
89 EAPI=2
90 inherit eutils multilib toolchain-funcs
91
92 IUSE="alsa curl debug doc gtk hardened lowmem mmx nosamples \
93 odbc osp postgres pri sqlite ssl speex zaptel elibc_uclibc"
94
95 AST_PATCHES="1.2.27-patches-1.0"
96
97 MY_P="${P/_p/.}"
98
99 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
100 HOMEPAGE="http://www.asterisk.org/"
101 SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz
102 mirror://gentoo/${PN}-${AST_PATCHES}.tar.bz2"
103
104 S="${WORKDIR}/${MY_P}"
105
106 SLOT="0"
107 LICENSE="GPL-2"
108 KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
109
110 RDEPEND="dev-libs/newt
111 media-sound/sox
112 ssl? ( dev-libs/openssl )
113 gtk? ( =x11-libs/gtk+-1.2* )
114 pri? ( =net-libs/libpri-1.2*[-bri] )
115 alsa? ( media-libs/alsa-lib )
116 curl? ( net-misc/curl )
117 odbc? ( dev-db/unixODBC )
118 speex? ( media-libs/speex )
119 sqlite? ( <dev-db/sqlite-3.0.0 )
120 zaptel? ( >=net-misc/zaptel-1.2.16 )
121 postgres? ( virtual/postgresql-base )
122 osp? ( >=net-libs/osptoolkit-3.3.4 )"
123
124 DEPEND="${RDEPEND}
125 sys-devel/flex
126 sys-devel/bison
127 doc? ( app-doc/doxygen )
128 virtual/logger"
129
130 #asterisk uses special mpg123 functions and does not work with mpeg321, bug #42703
131 PDEPEND="|| ( media-sound/mpg123 net-misc/asterisk-addons )"
132
133 QA_TEXTRELS_x86="usr/lib/asterisk/modules/codec_gsm.so"
134 QA_EXECSTACK_x86="usr/lib/asterisk/modules/codec_gsm.so"
135
136 #
137 # List of modules to ignore during scan (because they have been removed in 1.2.x)
138 #
139 SCAN_IGNORE_MODS="
140 app_qcall
141 chan_modem
142 chan_modem_i4l
143 chan_modem_bestdata
144 chan_modme_aopen"
145
146 #
147 # shortcuts
148 #
149 is_ast10update() {
150 return $(has_version "=net-misc/asterisk-1.0*")
151 }
152
153 is_astupdate() {
154 if ! is_ast10update; then
155 return $(has_version "<net-misc/asterisk-${PV}")
156 fi
157 return 0
158 }
159
160 #
161 # Scan for asterisk-1.0.x modules that will have to be updated
162 #
163 scan_modules() {
164 local modules_list=""
165 local n
166
167 for x in $(ls -1 "${ROOT}"usr/$(get_libdir)/asterisk/modules/*.so); do
168 echo -en "Scanning.... $(basename ${x}) \r"
169
170 # skip blacklisted modules
171 hasq $(basename ${x//.so}) ${SCAN_IGNORE_MODS} && continue
172
173 if $(readelf -s "${x}" | grep -q "\(ast_load\|ast_destroy\)$"); then
174 modules_list="${modules_list} $(basename ${x//.so})"
175 fi
176 done
177
178 if [[ -n "${modules_list}" ]]; then
179 echo " ========================================================"
180 ewarn "Please update or unmerge the following modules:"
181 echo
182
183 n=0
184 for x in ${modules_list}; do
185 ewarn " - ${x}"
186 (( n++ ))
187 done
188
189 echo
190 ewarn "Warning: $n outdated module(s) found!"
191 ewarn "Warning: asterisk may not work if you don't update them!"
192 echo " ========================================================"
193 echo
194 einfo "You can use the \"asterisk-updater\" script to update the modules"
195 epause
196 echo
197 return 1
198 else
199 einfo "No asterisk-1.0.x modules found!"
200 return 0
201 fi
202 }
203
204 pkg_setup() {
205 local checkfailed=0 waitaftermsg=0
206
207 if is_ast10update; then
208 ewarn " Asterisk UPGRADE Warning"
209 ewarn ""
210 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz after the installation!"
211 ewarn ""
212 ewarn " Asterisk UPGRADE Warning"
213 echo
214 waitaftermsg=1
215 fi
216
217 #
218 # Regular checks
219 #
220 einfo "Running some pre-flight checks..."
221 echo
222
223 }
224
225 src_prepare() {
226 #
227 # gentoo patchset
228 #
229 for x in $(grep -v "^#\| \+" "${WORKDIR}"/patches/patches.list); do
230 epatch "${WORKDIR}"/patches/${x}
231 done
232
233 if use mmx; then
234 if ! use hardened; then
235 einfo "Enabling mmx optimization"
236 sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
237 Makefile
238 else
239 ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
240 fi
241 fi
242
243 if ! use debug; then
244 einfo "Disabling debug support"
245 sed -i -e "s:^\(DEBUG=\):#\1:" \
246 Makefile
247 fi
248
249 if ! use ssl; then
250 einfo "Disabling crypto support"
251 sed -i -e 's:^#\(NOCRYPTO=yes\):\1:' \
252 -e '/^LIBS+=-lssl/d' Makefile || die
253 fi
254
255 epatch "${FILESDIR}/1.2.0/${PN}-1.2.35-lpc10-prototypes.diff"
256
257 #
258 # uclibc patch
259 #
260 if use elibc_uclibc; then
261 einfo "Patching asterisk for uclibc..."
262 epatch "${FILESDIR}"/1.0.0/${PN}-1.0.5-uclibc-dns.diff
263 epatch "${FILESDIR}"/1.2.0/${PN}-1.2.1-uclibc-getloadavg.diff
264 fi
265
266 #
267 # Disable AEL, security bug #171884
268 # Re-enable at your own risk (no USE since it can be critical)
269 #
270 sed -i -e 's/pbx_ael.so//' pbx/Makefile || die
271
272 # codecs/Makefile does not add -lspeexdsp needed for speex 1.2, bug #206463
273 if use speex && has_version ">=media-libs/speex-1.2"; then
274 sed -i -e "s/-lspeex/-lspeex -lspeexdsp/" codecs/Makefile \
275 || die "patching codecs/Makefile failed"
276 fi
277 }
278
279 src_compile() {
280 local myopts
281
282 use lowmem && \
283 myopts="-DLOW_MEMORY"
284
285 einfo "Building Asterisk..."
286 if use debug; then
287 unset CFLAGS
288 make \
289 CC=$(tc-getCC) \
290 NOTRACE=1 \
291 PWLIBDIR=/usr/share/pwlib \
292 OPTIONS="${myopts}" \
293 dont-optimize=1 || die "Make failed"
294 else
295 make \
296 CC=$(tc-getCC) \
297 NOTRACE=1 \
298 OPTIMIZE="${CFLAGS}" \
299 PWLIBDIR=/usr/share/pwlib \
300 OPTIONS="${myopts}" || die "Make failed"
301 fi
302
303 # create api docs
304 use doc && \
305 make progdocs
306 }
307
308 src_install() {
309
310 # install asterisk
311 make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" install || die "Make install failed"
312 make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" samples || die "Failed to create sample files"
313
314 # remove installed sample files if nosamples flag is set
315 if use nosamples; then
316 einfo "Skipping installation of sample files..."
317 rm -rf "${D}"var/spool/asterisk/voicemail/default
318 rm -f "${D}"var/lib/asterisk/mohmp3/*
319 rm -f "${D}"var/lib/asterisk/sounds/demo-*
320 rm -f "${D}"var/lib/asterisk/agi-bin/*
321 else
322 einfo "Sample files have been installed"
323 keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
324 fi
325
326 # move sample configuration files to doc directory
327 if is_ast10update; then
328 elog "Updating from old (pre-1.2) asterisk version, new configuration files have been installed"
329 elog "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
330 elif has_version "net-misc/asterisk"; then
331 elog "Configuration samples have been moved to: $ROOT/usr/share/doc/${PF}/conf"
332 insinto /usr/share/doc/${PF}/conf
333 doins "${D}"etc/asterisk/*.conf*
334 rm -f "${D}"etc/asterisk/*.conf* 2>/dev/null
335 fi
336
337 # don't delete these directories, even if they are empty
338 for x in voicemail meetme system dictate monitor tmp; do
339 keepdir /var/spool/asterisk/${x}
340 done
341 keepdir /var/lib/asterisk/sounds/priv-callerintros
342 keepdir /var/lib/asterisk/mohmp3
343 keepdir /var/lib/asterisk/agi-bin
344 keepdir /var/log/asterisk/cdr-csv
345 keepdir /var/log/asterisk/cdr-custom
346 keepdir /var/run/asterisk
347
348 # install astxs
349 dobin contrib/scripts/astxs
350
351 newinitd "${FILESDIR}"/1.2.0/asterisk.rc6 asterisk
352 newconfd "${FILESDIR}"/1.2.0/asterisk.confd asterisk
353
354 # install standard docs...
355 dodoc BUGS CREDITS ChangeLog HARDWARE README
356 dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
357 dodoc doc/README.*
358 dodoc doc/*.txt
359
360 docinto scripts
361 dodoc contrib/scripts/*
362
363 docinto utils
364 dodoc contrib/utils/*
365
366 docinto configs
367 dodoc configs/*
368
369 # install api docs
370 if use doc; then
371 insinto /usr/share/doc/${PF}/api/html
372 doins doc/api/html/*
373 fi
374
375 insinto /usr/share/doc/${PF}/cgi
376 doins contrib/scripts/vmail.cgi
377 doins images/*.gif
378
379 # install asterisk-updater
380 dosbin "${FILESDIR}"/1.2.0/asterisk-updater
381
382 # install asterisk.h, a lot of external modules need this
383 insinto /usr/include/asterisk
384 doins include/asterisk.h
385
386 # make sure misdn/capi stuff is not installed, provided by asterisk-chan_..
387 rm -f "${D}"/etc/asterisk/misdn.conf "${D}"/usr/lib/asterisk/modules/chan_misdn.so \
388 "${D}"/usr/share/doc/${PF}/{conf/misdn.conf,configs/misdn.conf.sample.gz,README.misdn.gz}
389 rm -f "${D}"/usr/include/asterisk/chan_capi{,_app}.h \
390 "${D}"/usr/share/doc/${PF}/{conf/capi.conf,configs/capi.conf.sample.gz}
391
392 # make sure the broken speex support does not keep Asterisk from starting up
393 # bug #206463 if you care about this. solution needs to work with --as-needed
394 rm -f "${D}"usr/$(get_libdir)/asterisk/modules/codec_speex.so || die "Unable to remove fatally flawed codec_speex.so"
395 }
396
397 pkg_preinst() {
398 enewgroup asterisk
399 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
400 }
401
402 pkg_postinst() {
403 einfo "Fixing permissions"
404 chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
405 chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
406
407 for x in lib run spool; do
408 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
409 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
410 done
411
412 chown asterisk:asterisk "${ROOT}"etc/asterisk/
413 chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
414 chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
415 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
416 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
417 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
418 echo
419
420 #
421 # Announcements, warnings, reminders...
422 #
423 einfo "Asterisk has been installed"
424 einfo ""
425 elog "If you want to know more about asterisk, visit these sites:"
426 elog "http://www.asteriskdocs.org/"
427 elog "http://www.voip-info.org/wiki-Asterisk"
428 elog
429 elog "http://www.automated.it/guidetoasterisk.htm"
430 elog
431 elog "Gentoo VoIP IRC Channel:"
432 elog "#gentoo-voip @ irc.freenode.net"
433 elog
434 elog "Please note that AEL is no longer built because of security bugs"
435 elog "See http://bugs.gentoo.org/show_bug.cgi?id=171884"
436 elog
437 echo
438 echo
439
440 #
441 # Warning about 1.0 -> 1.2 changes...
442 #
443 if is_ast10update; then
444 ewarn ""
445 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.gz before continuing"
446 ewarn ""
447 fi
448
449 if is_astupdate; then
450 ewarn ""
451 ewarn " - The initgroups patch has been dropped, please update your"
452 ewarn " \"conf.d/asterisk\" and \"init.d/asterisk\" file!"
453 ewarn ""
454 fi
455
456 # scan for old modules
457 if is_ast10update; then
458 einfo "Asterisk has been updated from pre-1.2.x, scanning for old modules"
459 scan_modules
460 fi
461 }
462
463 pkg_config() {
464 einfo "Do you want to reset file permissions and ownerships (y/N)?"
465
466 read tmp
467 tmp="$(echo $tmp | tr [:upper:] [:lower:])"
468
469 if [[ "$tmp" = "y" ]] ||\
470 [[ "$tmp" = "yes" ]]
471 then
472 einfo "Resetting permissions to defaults..."
473
474 for x in spool run lib log; do
475 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
476 chmod -R u=rwX,g=rX,o= "${ROOT}"var/${x}/asterisk
477 done
478
479 chown -R root:asterisk "${ROOT}"etc/asterisk
480 chmod -R u=rwX,g=rX,o= "${ROOT}"etc/asterisk
481
482 einfo "done"
483 else
484 einfo "skipping"
485 fi
486 }