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.6.1.6.ebuild ChangeLog asterisk-1.6.1.1-r1.ebuild asterisk-1.6.1.5.ebuild asterisk-1.6.1.1.ebuild asterisk-1.6.1.4.ebuild asterisk-1.6.1.0.ebuild
Date: Fri, 04 Sep 2009 06:43:01
Message-Id: E1MjXKF-0004TE-Kc@stork.gentoo.org
1 chainsaw 09/09/04 11:51:31
2
3 Modified: ChangeLog
4 Added: asterisk-1.6.1.6.ebuild
5 Removed: asterisk-1.6.1.1-r1.ebuild asterisk-1.6.1.5.ebuild
6 asterisk-1.6.1.1.ebuild asterisk-1.6.1.4.ebuild
7 asterisk-1.6.1.0.ebuild
8 Log:
9 Version bump, security fix for IAX2 denial of service (AST-2009-006). Patch by Oskar Ellström to cope with non-standard LUA header location closes bug #283231 by Thomas Stein. Removing vulnerable 1.6 series ebuilds.
10 (Portage version: 2.1.6.13/cvs/Linux x86_64)
11
12 Revision Changes Path
13 1.208 net-misc/asterisk/ChangeLog
14
15 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.208&view=markup
16 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.208&content-type=text/plain
17 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.207&r2=1.208
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
22 retrieving revision 1.207
23 retrieving revision 1.208
24 diff -u -r1.207 -r1.208
25 --- ChangeLog 29 Aug 2009 22:53:20 -0000 1.207
26 +++ ChangeLog 4 Sep 2009 11:51:31 -0000 1.208
27 @@ -1,6 +1,18 @@
28 # ChangeLog for net-misc/asterisk
29 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.207 2009/08/29 22:53:20 chainsaw Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.208 2009/09/04 11:51:31 chainsaw Exp $
32 +
33 +*asterisk-1.6.1.6 (04 Sep 2009)
34 +
35 + 04 Sep 2009; <chainsaw@g.o> -asterisk-1.6.1.0.ebuild,
36 + -asterisk-1.6.1.1.ebuild, -asterisk-1.6.1.1-r1.ebuild,
37 + -asterisk-1.6.1.4.ebuild, -asterisk-1.6.1.5.ebuild,
38 + +asterisk-1.6.1.6.ebuild,
39 + +files/1.6.1/asterisk-1.6.1.6-lua-includes.patch:
40 + Version bump, security fix for IAX2 denial of service (AST-2009-006).
41 + Patch by Oskar Ellström to cope with non-standard LUA header location
42 + closes bug #283231 by Thomas Stein. Removing vulnerable 1.6 series
43 + ebuilds.
44
45 *asterisk-1.6.1.5 (29 Aug 2009)
46
47
48
49
50 1.1 net-misc/asterisk/asterisk-1.6.1.6.ebuild
51
52 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.6.ebuild?rev=1.1&view=markup
53 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.6.ebuild?rev=1.1&content-type=text/plain
54
55 Index: asterisk-1.6.1.6.ebuild
56 ===================================================================
57 # Copyright 1999-2009 Gentoo Foundation
58 # Distributed under the terms of the GNU General Public License v2
59 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.6.ebuild,v 1.1 2009/09/04 11:51:31 chainsaw Exp $
60
61 EAPI=1
62 inherit eutils autotools
63
64 MY_P="${PN}-${PV/_/-}"
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 LICENSE="GPL-2"
70 SLOT="0"
71 KEYWORDS="~amd64 ~x86"
72
73 IUSE="alsa +caps curl dahdi debug freetds h323 iconv imap jabber ldap keepsrc misdn newt nosamples odbc oss postgres radius snmp span speex ssl sqlite static vorbis"
74
75 RDEPEND="virtual/libc
76 sys-libs/ncurses
77 dev-libs/popt
78 sys-libs/zlib
79 alsa? ( media-libs/alsa-lib )
80 caps? ( sys-libs/libcap )
81 curl? ( net-misc/curl )
82 dahdi? ( >=net-libs/libpri-1.4.7
83 net-misc/dahdi-tools )
84 freetds? ( dev-db/freetds )
85 h323? ( dev-libs/pwlib
86 net-libs/openh323 )
87 iconv? ( virtual/libiconv )
88 imap? ( virtual/imap-c-client )
89 jabber? ( dev-libs/iksemel )
90 ldap? ( net-nds/openldap )
91 misdn? ( net-dialup/misdnuser )
92 newt? ( dev-libs/newt )
93 odbc? ( dev-db/unixODBC )
94 postgres? ( virtual/postgresql-base )
95 radius? ( net-dialup/radiusclient-ng )
96 snmp? ( net-analyzer/net-snmp )
97 span? ( media-libs/spandsp )
98 speex? ( media-libs/speex )
99 sqlite? ( dev-db/sqlite )
100 ssl? ( dev-libs/openssl )
101 vorbis? ( media-libs/libvorbis )"
102
103 DEPEND="${RDEPEND}
104 !<net-misc/asterisk-addons-1.6"
105
106 S="${WORKDIR}/${MY_P}"
107
108 #
109 # shortcuts
110 #
111
112 # update from asterisk-1.0.x
113 is_ast10update() {
114 return $(has_version "=net-misc/asterisk-1.0*")
115 }
116
117 # update from asterisk-1.2.x
118 is_ast12update() {
119 return $(has_version "=net-misc/asterisk-1.2*")
120 }
121
122 # update from asterisk 1.4.x
123 is_ast14update() {
124 return $(has_version "=net-misc/asterisk-1.4*")
125 }
126
127 # update in the asterisk-1.6.x line
128 is_astupdate() {
129 if ! is_ast10update && ! is_ast12update && !is_ast14update; then
130 return $(has_version "<net-misc/asterisk-${PV}")
131 fi
132 return 0
133 }
134
135 get_available_modules() {
136 local modules mod x
137
138 # build list of available modules...
139 for x in app cdr codec format func pbx res; do
140
141 for mod in $(find "${S}" -type f -name "${x}_*.c*" -print)
142 do
143 modules="${modules} $(basename ${mod/%.c*})"
144 done
145 done
146
147 echo "${modules}"
148 }
149
150 pkg_setup() {
151 local checkfailed=0 waitaftermsg=0
152
153 if is_ast10update || is_ast12update || is_ast14update ; then
154 ewarn " Asterisk UPGRADE Warning"
155 ewarn ""
156 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!"
157 ewarn ""
158 ewarn " Asterisk UPGRADE Warning"
159 echo
160 waitaftermsg=1
161 fi
162
163 if [[ $waitaftermsg -eq 1 ]]; then
164 einfo "Press Ctrl+C to abort"
165 echo
166 ebeep 10
167 fi
168
169 #
170 # Regular checks
171 #
172 einfo "Running some pre-flight checks..."
173 echo
174
175 # imap requires ssl if imap-c-client was built with ssl,
176 # conversely if ssl and imap are both on then imap-c-client needs ssl
177 if use imap; then
178 if use ssl && ! built_with_use virtual/imap-c-client ssl; then
179 eerror
180 eerror "IMAP with SSL requested, but your IMAP C-Client libraries"
181 eerror "are built without SSL!"
182 eerror
183 die "Please recompile the IMAP C-Client libraries with SSL support enabled"
184 elif ! use ssl && built_with_use virtual/imap-c-client ssl; then
185 eerror
186 eerror "IMAP without SSL requested, but your IMAP C-Client"
187 eerror "libraries are built with SSL!"
188 eerror
189 die "Please recompile the IMAP C-Client libraries without SSL support enabled"
190 fi
191 fi
192
193 if [[ -n "${ASTERISK_MODULES}" ]] ; then
194 ewarn "You are overriding ASTERISK_MODULES. We will assume you know what you are doing. There is no support for this option, try without if you see breakage."
195 fi
196 }
197
198 src_unpack() {
199 unpack ${A}
200 cd "${S}"
201
202 #
203 # comment about h323 issues
204 #
205 if use h323 ; then
206 ewarn "h323 useflag: It is known that the h323 module doesn't compile
207 the \"normal\" way: For a workaround, asterisk will be built two times
208 without cleaning the build dir."
209 fi
210
211 #
212 # put pid file(s) into /var/run/asterisk
213 #
214 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-var_rundir.patch || die "patch failed"
215
216 #
217 # fix gsm codec cflags (e.g. i586 core epias) and disable
218 # assembler optimizations
219 #
220 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-gsm-pic.patch || die "patch failed"
221
222 #
223 # add missing LIBS for uclibc
224 #
225 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-uclibc.patch || die "patch failed"
226
227 #
228 # link UW-IMAP with Kerberos5 if necessary
229 #
230 epatch "${FILESDIR}"/1.6.1/asterisk-1.6.1-imap-kerberos.patch || die "patch failed"
231
232 #
233 # compensate for non-standard LUA header paths in Gentoo
234 #
235 epatch "${FILESDIR}"/1.6.1/asterisk-1.6.1.6-lua-includes.patch || die "patch failed"
236
237 AT_M4DIR=autoconf eautoreconf
238
239 # parse modules list
240 if [[ -n "${ASTERISK_MODULES}" ]]; then
241 local x modules="$(get_available_modules)"
242
243 einfo "Custom list of modules specified, checking..."
244
245 use debug && {
246 einfo "Available modules: ${modules}"
247 einfo " Selected modules: ${ASTERISK_MODULES}"
248 }
249
250 for x in ${ASTERISK_MODULES}; do
251 if [[ "${x}" = "-*" ]]; then
252 MODULES_LIST=""
253 else
254 if has ${x} ${modules}
255 then
256 MODULES_LIST="${MODULES_LIST} ${x}"
257 else
258 eerror "Unknown module: ${x}"
259 fi
260 fi
261 done
262
263 export MODULES_LIST
264 fi
265 }
266
267 src_compile() {
268 #
269 # start with configure
270 #
271 econf \
272 --libdir="/usr/$(get_libdir)" \
273 --localstatedir="/var" \
274 --with-gsm=internal \
275 --with-popt \
276 --with-z \
277 $(use_with alsa asound) \
278 $(use_with caps cap) \
279 $(use_with curl) \
280 $(use_with dahdi pri) \
281 $(use_with dahdi tonezone) \
282 $(use_with dahdi) \
283 $(use_with freetds tds) \
284 $(use_with h323 h323 "/usr/share/openh323") \
285 $(use_with h323 pwlib "/usr/share/pwlib") \
286 $(use_with iconv) \
287 $(use_with imap) \
288 $(use_with jabber iksemel) \
289 $(use_with misdn isdnnet) \
290 $(use_with misdn suppserv) \
291 $(use_with misdn) \
292 $(use_with newt) \
293 $(use_with odbc) \
294 $(use_with oss) \
295 $(use_with postgres) \
296 $(use_with radius) \
297 $(use_with snmp netsnmp) \
298 $(use_with span spandsp) \
299 $(use_with speex) \
300 $(use_with speex speexdsp) \
301 $(use_with sqlite sqlite3) \
302 $(use_with ssl crypto) \
303 $(use_with ssl) \
304 $(use_with vorbis ogg) \
305 $(use_with vorbis) || die "econf failed"
306
307 #
308 # custom module filter
309 # run menuselect to evaluate the list of modules
310 # and rewrite the list afterwards
311 #
312 if [[ -n "${MODULES_LIST}" ]]
313 then
314 local mod category tmp_list failed_list
315
316 ###
317 # run menuselect
318
319 emake menuselect.makeopts || die "emake menuselect.makeopts failed"
320
321 ###
322 # get list of modules with failed dependencies
323
324 failed_list="$(awk -F= '/^MENUSELECT_DEPSFAILED=/{ print $3 }' menuselect.makeopts)"
325
326 ###
327 # traverse our list of modules
328
329 for category in app cdr codec format func pbx res; do
330 tmp_list=""
331
332 # search list of modules for matching ones first...
333 for mod in ${MODULES_LIST}; do
334 # module is from current category?
335 if [[ "${mod/%_*}" = "${category}" ]]
336 then
337 # check menuselect thinks the dependencies are met
338 if has ${mod} ${failed_list}
339 then
340 eerror "${mod}: dependencies required to build this module are not met, NOT BUILDING!"
341 else
342 tmp_list="${tmp_list} ${mod}"
343 fi
344 fi
345 done
346
347 use debug && echo "${category} tmp: ${tmp_list}"
348
349 # replace the module list for $category with our custom one
350 if [[ -n "${tmp_list}" ]]
351 then
352 category="$(echo ${category} | tr '[:lower:]' '[:upper:]')"
353 sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \
354 menuselect.makeopts || die "failed to set list of ${category} applications"
355 fi
356 done
357 fi
358
359 #
360 # fasten your seatbelts (and start praying)
361 #
362 if use h323 ; then
363 # emake one time to get h323 to make.... yea not "clean" but works
364 emake
365 fi
366
367 emake || die "emake failed"
368 }
369
370 src_install() {
371 # setup directory structure
372 #
373 mkdir -p "${D}"usr/lib/pkgconfig
374
375 emake DESTDIR="${D}" install || die "emake install failed"
376 emake DESTDIR="${D}" samples || die "emake samples failed"
377
378 # remove installed sample files if nosamples flag is set
379 if use nosamples; then
380 einfo "Skipping installation of sample files..."
381 rm -f "${D}"var/lib/asterisk/mohmp3/*
382 rm -f "${D}"var/lib/asterisk/sounds/demo-*
383 rm -f "${D}"var/lib/asterisk/agi-bin/*
384 else
385 einfo "Sample files have been installed"
386 fi
387 rm -rf "${D}"var/spool/asterisk/voicemail/default
388
389 # move sample configuration files to doc directory
390 if is_ast10update || is_ast12update || is_ast14update; then
391 einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed"
392 einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
393 fi
394
395 einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf"
396 insinto /usr/share/doc/${PF}/conf
397 doins "${D}"etc/asterisk/*.conf*
398
399 # keep directories
400 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
401 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
402
403 newinitd "${FILESDIR}"/1.6.1/asterisk.rc6 asterisk
404 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
405
406 # some people like to keep the sources around for custom patching
407 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
408 if use keepsrc
409 then
410 einfo "keepsrc useflag enabled, copying source..."
411 dodir /usr/src
412
413 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed"
414
415 ebegin "running make clean..."
416 emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed"
417 eend $?
418
419 einfo "Source files have been saved to "${ROOT}"usr/src/${PF}"
420 fi
421
422 # install the upgrade documentation
423 #
424 dodoc README UPGRADE* BUGS CREDITS
425
426 # install snmp mib files
427 #
428 if use snmp
429 then
430 insinto /usr/share/snmp/mibs/
431 doins doc/digium-mib.txt doc/asterisk-mib.txt
432 fi
433 }
434
435 pkg_preinst() {
436 enewgroup asterisk
437 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
438 }
439
440 pkg_postinst() {
441 ebegin "Fixing up permissions"
442 chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
443 chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
444
445 for x in lib run spool; do
446 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
447 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
448 done
449
450 chown asterisk:asterisk "${ROOT}"etc/asterisk/
451 chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
452 chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
453 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
454 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
455 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
456 eend $?
457
458 #
459 # Announcements, warnings, reminders...
460 #
461 einfo "Asterisk has been installed"
462 echo
463 elog "If you want to know more about asterisk, visit these sites:"
464 elog "http://www.asteriskdocs.org/"
465 elog "http://www.voip-info.org/wiki-Asterisk"
466 echo
467 elog "http://www.automated.it/guidetoasterisk.htm"
468 echo
469 elog "Gentoo VoIP IRC Channel:"
470 elog "#gentoo-voip @ irc.freenode.net"
471 echo
472 echo
473
474 #
475 # Warning about 1.x -> 1.6 changes...
476 #
477 if is_ast10update || is_ast12update || is_ast14update; then
478 ewarn ""
479 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 before continuing"
480 ewarn ""
481 fi
482 }
483
484 pkg_config() {
485 einfo "Do you want to reset file permissions and ownerships (y/N)?"
486
487 read tmp
488 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
489
490 if [[ "$tmp" = "y" ]] ||\
491 [[ "$tmp" = "yes" ]]
492 then
493 einfo "Resetting permissions to defaults..."
494
495 for x in spool run lib log; do
496 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
497 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
498 done
499
500 chown -R root:asterisk "${ROOT}"etc/asterisk
501 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
502
503 einfo "done"
504 else
505 einfo "skipping"
506 fi
507 }