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