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.14.ebuild ChangeLog asterisk-1.6.1.12-r1.ebuild asterisk-1.6.1.13.ebuild
Date: Tue, 02 Feb 2010 22:54:55
Message-Id: E1NcRdz-0000aL-Um@stork.gentoo.org
1 chainsaw 10/02/02 22:54:51
2
3 Modified: ChangeLog
4 Added: asterisk-1.6.1.14.ebuild
5 Removed: asterisk-1.6.1.12-r1.ebuild
6 asterisk-1.6.1.13.ebuild
7 Log:
8 Security update for AST-2010-001; remote T.38 over SIP crash by setting FaxMaxDatagram to a negative or exceptionally large value. Init script update by Jaco Kroon closes bug #303265. Remove vulnerable 1.6.1 branch ebuilds.
9 (Portage version: 2.2_rc62/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.246 net-misc/asterisk/ChangeLog
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.246&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.246&content-type=text/plain
16 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.245&r2=1.246
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
21 retrieving revision 1.245
22 retrieving revision 1.246
23 diff -u -r1.245 -r1.246
24 --- ChangeLog 2 Feb 2010 22:48:58 -0000 1.245
25 +++ ChangeLog 2 Feb 2010 22:54:51 -0000 1.246
26 @@ -1,6 +1,15 @@
27 # ChangeLog for net-misc/asterisk
28 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.245 2010/02/02 22:48:58 chainsaw Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.246 2010/02/02 22:54:51 chainsaw Exp $
31 +
32 +*asterisk-1.6.1.14 (02 Feb 2010)
33 +
34 + 02 Feb 2010; <chainsaw@g.o> -asterisk-1.6.1.12-r1.ebuild,
35 + -asterisk-1.6.1.13.ebuild, +asterisk-1.6.1.14.ebuild:
36 + Security update for AST-2010-001; remote T.38 over SIP crash by setting
37 + FaxMaxDatagram to a negative or exceptionally large value. Init script
38 + update by Jaco Kroon closes bug #303265. Remove vulnerable 1.6.1 branch
39 + ebuilds.
40
41 *asterisk-1.6.2.2 (02 Feb 2010)
42
43
44
45
46 1.1 net-misc/asterisk/asterisk-1.6.1.14.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.14.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.14.ebuild?rev=1.1&content-type=text/plain
50
51 Index: asterisk-1.6.1.14.ebuild
52 ===================================================================
53 # Copyright 1999-2010 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.14.ebuild,v 1.1 2010/02/02 22:54:51 chainsaw Exp $
56
57 EAPI=1
58 inherit eutils autotools
59
60 MY_P="${PN}-${PV/_/-}"
61
62 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
63 HOMEPAGE="http://www.asterisk.org/"
64 SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz"
65 LICENSE="GPL-2"
66 SLOT="0"
67 KEYWORDS="~amd64 ~x86"
68
69 IUSE="alsa +caps curl dahdi debug freetds iconv jabber ldap keepsrc misdn newt nosamples odbc oss postgres radius snmp span speex ssl sqlite static vorbis"
70
71 RDEPEND="sys-libs/ncurses
72 dev-libs/popt
73 sys-libs/zlib
74 alsa? ( media-libs/alsa-lib )
75 caps? ( sys-libs/libcap )
76 curl? ( net-misc/curl )
77 dahdi? ( >=net-libs/libpri-1.4.7
78 net-misc/dahdi-tools )
79 freetds? ( dev-db/freetds )
80 iconv? ( virtual/libiconv )
81 jabber? ( dev-libs/iksemel )
82 ldap? ( net-nds/openldap )
83 misdn? ( net-dialup/misdnuser )
84 newt? ( dev-libs/newt )
85 odbc? ( dev-db/unixODBC )
86 postgres? ( virtual/postgresql-base )
87 radius? ( net-dialup/radiusclient-ng )
88 snmp? ( net-analyzer/net-snmp )
89 span? ( media-libs/spandsp )
90 speex? ( media-libs/speex )
91 sqlite? ( dev-db/sqlite )
92 ssl? ( dev-libs/openssl )
93 vorbis? ( media-libs/libvorbis )"
94
95 DEPEND="${RDEPEND}
96 !<net-misc/asterisk-addons-1.6
97 !net-misc/asterisk-chan_unistim
98 !net-misc/zaptel"
99
100 S="${WORKDIR}/${MY_P}"
101
102 #
103 # shortcuts
104 #
105
106 # update from asterisk-1.0.x
107 is_ast10update() {
108 return $(has_version "=net-misc/asterisk-1.0*")
109 }
110
111 # update from asterisk-1.2.x
112 is_ast12update() {
113 return $(has_version "=net-misc/asterisk-1.2*")
114 }
115
116 # update from asterisk 1.4.x
117 is_ast14update() {
118 return $(has_version "=net-misc/asterisk-1.4*")
119 }
120
121 # update in the asterisk-1.6.x line
122 is_astupdate() {
123 if ! is_ast10update && ! is_ast12update && !is_ast14update; then
124 return $(has_version "<net-misc/asterisk-${PV}")
125 fi
126 return 0
127 }
128
129 get_available_modules() {
130 local modules mod x
131
132 # build list of available modules...
133 for x in app cdr codec format func pbx res; do
134
135 for mod in $(find "${S}" -type f -name "${x}_*.c*" -print)
136 do
137 modules="${modules} $(basename ${mod/%.c*})"
138 done
139 done
140
141 echo "${modules}"
142 }
143
144 pkg_setup() {
145 local checkfailed=0 waitaftermsg=0
146
147 if is_ast12update ; then
148 ewarn "Please note that the configuration style (particularly the dial plan) has changed significantly."
149 ewarn "sip.conf: insecure=very -> insecure=port,invite"
150 ewarn "asterisk.conf: please familiarise yourself with [compat]"
151 ewarn "extensions.conf: use comma instead of pipe as a separator"
152 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!"
153 echo
154 waitaftermsg=1
155 fi
156
157 if [[ $waitaftermsg -eq 1 ]]; then
158 einfo "Press Ctrl+C to abort"
159 echo
160 ebeep 10
161 fi
162
163 #
164 # Regular checks
165 #
166 einfo "Running some pre-flight checks..."
167 echo
168
169 if [[ -n "${ASTERISK_MODULES}" ]] ; then
170 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."
171 fi
172 }
173
174 src_unpack() {
175 unpack ${A}
176 cd "${S}"
177
178 #
179 # put pid file(s) into /var/run/asterisk
180 #
181 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-var_rundir.patch || die "patch failed"
182
183 #
184 # fix gsm codec cflags (e.g. i586 core epias) and disable
185 # assembler optimizations
186 #
187 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-gsm-pic.patch || die "patch failed"
188
189 #
190 # add missing LIBS for uclibc
191 #
192 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-uclibc.patch || die "patch failed"
193
194 #
195 # make sure FXO ports are usable immediately, without requiring an inbound call first
196 # https://issues.asterisk.org/view.php?id=14577
197 #
198 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-fxsks-hookstate.patch || die "patch failed"
199
200 #
201 # do not ignore alarm-cleared event while V23 caller ID detection is in progress
202 # otherwise automated British Telecom line test causes permanent red alarm
203 # https://issues.asterisk.org/view.php?id=14163
204 #
205 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-bt-line-test.patch || die "patch failed"
206
207 #
208 # sprinkle some plus signs in strategic locations for maximum parallel make happiness
209 # https://issues.asterisk.org/view.php?id=16489
210 #
211 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.12-parallel-make-v2.patch || die "patch failed"
212
213 AT_M4DIR=autoconf eautoreconf
214
215 # parse modules list
216 if [[ -n "${ASTERISK_MODULES}" ]]; then
217 local x modules="$(get_available_modules)"
218
219 einfo "Custom list of modules specified, checking..."
220
221 use debug && {
222 einfo "Available modules: ${modules}"
223 einfo " Selected modules: ${ASTERISK_MODULES}"
224 }
225
226 for x in ${ASTERISK_MODULES}; do
227 if [[ "${x}" = "-*" ]]; then
228 MODULES_LIST=""
229 else
230 if has ${x} ${modules}
231 then
232 MODULES_LIST="${MODULES_LIST} ${x}"
233 else
234 eerror "Unknown module: ${x}"
235 fi
236 fi
237 done
238
239 export MODULES_LIST
240 fi
241 }
242
243 src_compile() {
244 #
245 # start with configure
246 #
247 econf \
248 --libdir="/usr/$(get_libdir)" \
249 --localstatedir="/var" \
250 --with-gsm=internal \
251 --with-popt \
252 --with-z \
253 $(use_with alsa asound) \
254 $(use_with caps cap) \
255 $(use_with curl) \
256 $(use_with dahdi pri) \
257 $(use_with dahdi tonezone) \
258 $(use_with dahdi) \
259 $(use_with freetds tds) \
260 $(use_with iconv) \
261 $(use_with jabber iksemel) \
262 $(use_with misdn isdnnet) \
263 $(use_with misdn suppserv) \
264 $(use_with misdn) \
265 $(use_with newt) \
266 $(use_with odbc) \
267 $(use_with oss) \
268 $(use_with postgres) \
269 $(use_with radius) \
270 $(use_with snmp netsnmp) \
271 $(use_with span spandsp) \
272 $(use_with speex) \
273 $(use_with speex speexdsp) \
274 $(use_with sqlite sqlite3) \
275 $(use_with ssl crypto) \
276 $(use_with ssl) \
277 $(use_with vorbis ogg) \
278 $(use_with vorbis) || die "econf failed"
279
280 #
281 # custom module filter
282 # run menuselect to evaluate the list of modules
283 # and rewrite the list afterwards
284 #
285 if [[ -n "${MODULES_LIST}" ]]
286 then
287 local mod category tmp_list failed_list
288
289 ###
290 # run menuselect
291
292 emake menuselect.makeopts || die "emake menuselect.makeopts failed"
293
294 ###
295 # get list of modules with failed dependencies
296
297 failed_list="$(awk -F= '/^MENUSELECT_DEPSFAILED=/{ print $3 }' menuselect.makeopts)"
298
299 ###
300 # traverse our list of modules
301
302 for category in app cdr codec format func pbx res; do
303 tmp_list=""
304
305 # search list of modules for matching ones first...
306 for mod in ${MODULES_LIST}; do
307 # module is from current category?
308 if [[ "${mod/%_*}" = "${category}" ]]
309 then
310 # check menuselect thinks the dependencies are met
311 if has ${mod} ${failed_list}
312 then
313 eerror "${mod}: dependencies required to build this module are not met, NOT BUILDING!"
314 else
315 tmp_list="${tmp_list} ${mod}"
316 fi
317 fi
318 done
319
320 use debug && echo "${category} tmp: ${tmp_list}"
321
322 # replace the module list for $category with our custom one
323 if [[ -n "${tmp_list}" ]]
324 then
325 category="$(echo ${category} | tr '[:lower:]' '[:upper:]')"
326 sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \
327 menuselect.makeopts || die "failed to set list of ${category} applications"
328 fi
329 done
330 fi
331
332 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
333 }
334
335 src_install() {
336 # setup directory structure
337 #
338 mkdir -p "${D}"usr/lib/pkgconfig
339
340 emake DESTDIR="${D}" install || die "emake install failed"
341 emake DESTDIR="${D}" samples || die "emake samples failed"
342
343 # remove installed sample files if nosamples flag is set
344 if use nosamples; then
345 einfo "Skipping installation of sample files..."
346 rm -f "${D}"var/lib/asterisk/mohmp3/*
347 rm -f "${D}"var/lib/asterisk/sounds/demo-*
348 rm -f "${D}"var/lib/asterisk/agi-bin/*
349 else
350 einfo "Sample files have been installed"
351 fi
352 rm -rf "${D}"var/spool/asterisk/voicemail/default
353
354 # move sample configuration files to doc directory
355 if is_ast10update || is_ast12update || is_ast14update; then
356 einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed"
357 einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
358 fi
359
360 einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf"
361 insinto /usr/share/doc/${PF}/conf
362 doins "${D}"etc/asterisk/*.conf*
363
364 cd "${D}"
365 for conffile in etc/asterisk/*.*
366 do
367 fowners asterisk:asterisk $conffile
368 fperms 0660 $conffile
369 done
370 cd "${S}"
371
372 # keep directories
373 diropts -m 0770 -o asterisk -g asterisk
374 keepdir /etc/asterisk
375 keepdir /var/lib/asterisk
376 keepdir /var/run/asterisk
377 keepdir /var/spool/asterisk
378 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
379 diropts -m 0750 -o asterisk -g asterisk
380 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
381
382 newinitd "${FILESDIR}"/1.6.1/asterisk.initd3 asterisk
383 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
384
385 # some people like to keep the sources around for custom patching
386 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
387 if use keepsrc
388 then
389 einfo "keepsrc useflag enabled, copying source..."
390 dodir /usr/src
391
392 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed"
393
394 ebegin "running make clean..."
395 emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed"
396 eend $?
397
398 einfo "Source files have been saved to "${ROOT}"usr/src/${PF}"
399 fi
400
401 # install the upgrade documentation
402 #
403 dodoc README UPGRADE* BUGS CREDITS
404
405 # install snmp mib files
406 #
407 if use snmp
408 then
409 insinto /usr/share/snmp/mibs/
410 doins doc/digium-mib.txt doc/asterisk-mib.txt
411 fi
412 }
413
414 pkg_preinst() {
415 enewgroup asterisk
416 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
417 }
418
419 pkg_postinst() {
420 #
421 # Announcements, warnings, reminders...
422 #
423 einfo "Asterisk has been installed"
424 echo
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 echo
429 elog "http://www.automated.it/guidetoasterisk.htm"
430 echo
431 elog "Gentoo VoIP IRC Channel:"
432 elog "#gentoo-voip @ irc.freenode.net"
433 echo
434 echo
435
436 #
437 # Warning about 1.x -> 1.6 changes...
438 #
439 if is_ast10update || is_ast12update || is_ast14update; then
440 ewarn ""
441 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 before continuing"
442 ewarn ""
443 fi
444 }
445
446 pkg_config() {
447 einfo "Do you want to reset file permissions and ownerships (y/N)?"
448
449 read tmp
450 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
451
452 if [[ "$tmp" = "y" ]] ||\
453 [[ "$tmp" = "yes" ]]
454 then
455 einfo "Resetting permissions to defaults..."
456
457 for x in spool run lib log; do
458 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
459 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
460 done
461
462 chown -R root:asterisk "${ROOT}"etc/asterisk
463 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
464
465 einfo "done"
466 else
467 einfo "skipping"
468 fi
469 }