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