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