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