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.8-r1.ebuild ChangeLog
Date: Wed, 28 Oct 2009 12:50:34
Message-Id: E1N37yx-00075C-QQ@stork.gentoo.org
1 chainsaw 09/10/28 12:50:31
2
3 Modified: ChangeLog
4 Added: asterisk-1.6.1.8-r1.ebuild
5 Log:
6 Revision bump. An incoming SIP invite with no session-expiry header ended up with a -1 second expiry time, resulting in an immediate disconnect. From an upstream bug report. Updated 1.2 -> 1.6 instructions, ready for unmasking.
7 (Portage version: 2.1.7.1/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.222 net-misc/asterisk/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.222&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.222&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.221&r2=1.222
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
19 retrieving revision 1.221
20 retrieving revision 1.222
21 diff -u -r1.221 -r1.222
22 --- ChangeLog 28 Oct 2009 12:26:04 -0000 1.221
23 +++ ChangeLog 28 Oct 2009 12:50:31 -0000 1.222
24 @@ -1,6 +1,15 @@
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.221 2009/10/28 12:26:04 chainsaw Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.222 2009/10/28 12:50:31 chainsaw Exp $
29 +
30 +*asterisk-1.6.1.8-r1 (28 Oct 2009)
31 +
32 + 28 Oct 2009; <chainsaw@g.o> +asterisk-1.6.1.8-r1.ebuild,
33 + +files/1.6.1/asterisk-1.6.1.8-session_expiry.patch:
34 + Revision bump. An incoming SIP invite with no session-expiry header ended
35 + up with a -1 second expiry time, resulting in an immediate disconnect.
36 + From an upstream bug report. Updated 1.2 -> 1.6 instructions, ready for
37 + unmasking.
38
39 *asterisk-1.2.35-r1 (28 Oct 2009)
40
41
42
43
44 1.1 net-misc/asterisk/asterisk-1.6.1.8-r1.ebuild
45
46 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.8-r1.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.8-r1.ebuild?rev=1.1&content-type=text/plain
48
49 Index: asterisk-1.6.1.8-r1.ebuild
50 ===================================================================
51 # Copyright 1999-2009 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.8-r1.ebuild,v 1.1 2009/10/28 12:50: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/zaptel"
96
97 S="${WORKDIR}/${MY_P}"
98
99 #
100 # shortcuts
101 #
102
103 # update from asterisk-1.0.x
104 is_ast10update() {
105 return $(has_version "=net-misc/asterisk-1.0*")
106 }
107
108 # update from asterisk-1.2.x
109 is_ast12update() {
110 return $(has_version "=net-misc/asterisk-1.2*")
111 }
112
113 # update from asterisk 1.4.x
114 is_ast14update() {
115 return $(has_version "=net-misc/asterisk-1.4*")
116 }
117
118 # update in the asterisk-1.6.x line
119 is_astupdate() {
120 if ! is_ast10update && ! is_ast12update && !is_ast14update; then
121 return $(has_version "<net-misc/asterisk-${PV}")
122 fi
123 return 0
124 }
125
126 get_available_modules() {
127 local modules mod x
128
129 # build list of available modules...
130 for x in app cdr codec format func pbx res; do
131
132 for mod in $(find "${S}" -type f -name "${x}_*.c*" -print)
133 do
134 modules="${modules} $(basename ${mod/%.c*})"
135 done
136 done
137
138 echo "${modules}"
139 }
140
141 pkg_setup() {
142 local checkfailed=0 waitaftermsg=0
143
144 if is_ast12update ; then
145 ewarn "Please note that the configuration style (particularly the dial plan) has changed significantly."
146 ewarn "sip.conf: insecure=very -> insecure=port,invite"
147 ewarn "asterisk.conf: please familiarise yourself with [compat]"
148 ewarn "extensions.conf: use comma instead of pipe as a separator"
149 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!"
150 echo
151 waitaftermsg=1
152 fi
153
154 if [[ $waitaftermsg -eq 1 ]]; then
155 einfo "Press Ctrl+C to abort"
156 echo
157 ebeep 10
158 fi
159
160 #
161 # Regular checks
162 #
163 einfo "Running some pre-flight checks..."
164 echo
165
166 if [[ -n "${ASTERISK_MODULES}" ]] ; then
167 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."
168 fi
169 }
170
171 src_unpack() {
172 unpack ${A}
173 cd "${S}"
174
175 #
176 # put pid file(s) into /var/run/asterisk
177 #
178 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-var_rundir.patch || die "patch failed"
179
180 #
181 # fix gsm codec cflags (e.g. i586 core epias) and disable
182 # assembler optimizations
183 #
184 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-gsm-pic.patch || die "patch failed"
185
186 #
187 # add missing LIBS for uclibc
188 #
189 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-uclibc.patch || die "patch failed"
190
191 #
192 # compensate for non-standard LUA header paths in Gentoo
193 #
194 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-lua-includes.patch || die "patch failed"
195
196 #
197 # make sure FXO ports are usable immediately, without requiring an inbound call first
198 # https://issues.asterisk.org/view.php?id=14577
199 #
200 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-fxsks-hookstate.patch || die "patch failed"
201
202 #
203 # avoid segmentation fault when transferring a queue call
204 # https://issues.asterisk.org/view.php?id=15848
205 #
206 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-transfer-segfault.patch || die "patch failed"
207
208 #
209 # do not ignore alarm-cleared event while V23 caller ID detection is in progress
210 # otherwise automated British Telecom line test causes permanent red alarm
211 # https://issues.asterisk.org/view.php?id=14163
212 #
213 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-bt-line-test.patch || die "patch failed"
214
215 #
216 # SIP invites without a session-expires header end up with an expiry time of -1 seconds
217 # causing immediate hangup.
218 # https://issues.asterisk.org/view.php?id=15621
219 #
220 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.8-session_expiry.patch || die "patch failed"
221
222 AT_M4DIR=autoconf eautoreconf
223
224 # parse modules list
225 if [[ -n "${ASTERISK_MODULES}" ]]; then
226 local x modules="$(get_available_modules)"
227
228 einfo "Custom list of modules specified, checking..."
229
230 use debug && {
231 einfo "Available modules: ${modules}"
232 einfo " Selected modules: ${ASTERISK_MODULES}"
233 }
234
235 for x in ${ASTERISK_MODULES}; do
236 if [[ "${x}" = "-*" ]]; then
237 MODULES_LIST=""
238 else
239 if has ${x} ${modules}
240 then
241 MODULES_LIST="${MODULES_LIST} ${x}"
242 else
243 eerror "Unknown module: ${x}"
244 fi
245 fi
246 done
247
248 export MODULES_LIST
249 fi
250 }
251
252 src_compile() {
253 #
254 # start with configure
255 #
256 econf \
257 --libdir="/usr/$(get_libdir)" \
258 --localstatedir="/var" \
259 --with-gsm=internal \
260 --with-popt \
261 --with-z \
262 $(use_with alsa asound) \
263 $(use_with caps cap) \
264 $(use_with curl) \
265 $(use_with dahdi pri) \
266 $(use_with dahdi tonezone) \
267 $(use_with dahdi) \
268 $(use_with freetds tds) \
269 $(use_with iconv) \
270 $(use_with jabber iksemel) \
271 $(use_with misdn isdnnet) \
272 $(use_with misdn suppserv) \
273 $(use_with misdn) \
274 $(use_with newt) \
275 $(use_with odbc) \
276 $(use_with oss) \
277 $(use_with postgres) \
278 $(use_with radius) \
279 $(use_with snmp netsnmp) \
280 $(use_with span spandsp) \
281 $(use_with speex) \
282 $(use_with speex speexdsp) \
283 $(use_with sqlite sqlite3) \
284 $(use_with ssl crypto) \
285 $(use_with ssl) \
286 $(use_with vorbis ogg) \
287 $(use_with vorbis) || die "econf failed"
288
289 #
290 # custom module filter
291 # run menuselect to evaluate the list of modules
292 # and rewrite the list afterwards
293 #
294 if [[ -n "${MODULES_LIST}" ]]
295 then
296 local mod category tmp_list failed_list
297
298 ###
299 # run menuselect
300
301 emake menuselect.makeopts || die "emake menuselect.makeopts failed"
302
303 ###
304 # get list of modules with failed dependencies
305
306 failed_list="$(awk -F= '/^MENUSELECT_DEPSFAILED=/{ print $3 }' menuselect.makeopts)"
307
308 ###
309 # traverse our list of modules
310
311 for category in app cdr codec format func pbx res; do
312 tmp_list=""
313
314 # search list of modules for matching ones first...
315 for mod in ${MODULES_LIST}; do
316 # module is from current category?
317 if [[ "${mod/%_*}" = "${category}" ]]
318 then
319 # check menuselect thinks the dependencies are met
320 if has ${mod} ${failed_list}
321 then
322 eerror "${mod}: dependencies required to build this module are not met, NOT BUILDING!"
323 else
324 tmp_list="${tmp_list} ${mod}"
325 fi
326 fi
327 done
328
329 use debug && echo "${category} tmp: ${tmp_list}"
330
331 # replace the module list for $category with our custom one
332 if [[ -n "${tmp_list}" ]]
333 then
334 category="$(echo ${category} | tr '[:lower:]' '[:upper:]')"
335 sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \
336 menuselect.makeopts || die "failed to set list of ${category} applications"
337 fi
338 done
339 fi
340
341 emake || die "emake failed"
342 }
343
344 src_install() {
345 # setup directory structure
346 #
347 mkdir -p "${D}"usr/lib/pkgconfig
348
349 emake DESTDIR="${D}" install || die "emake install failed"
350 emake DESTDIR="${D}" samples || die "emake samples failed"
351
352 # remove installed sample files if nosamples flag is set
353 if use nosamples; then
354 einfo "Skipping installation of sample files..."
355 rm -f "${D}"var/lib/asterisk/mohmp3/*
356 rm -f "${D}"var/lib/asterisk/sounds/demo-*
357 rm -f "${D}"var/lib/asterisk/agi-bin/*
358 else
359 einfo "Sample files have been installed"
360 fi
361 rm -rf "${D}"var/spool/asterisk/voicemail/default
362
363 # move sample configuration files to doc directory
364 if is_ast10update || is_ast12update || is_ast14update; then
365 einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed"
366 einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
367 fi
368
369 einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf"
370 insinto /usr/share/doc/${PF}/conf
371 doins "${D}"etc/asterisk/*.conf*
372
373 # keep directories
374 diropts -m 0770 -o asterisk -g asterisk
375 keepdir /etc/asterisk
376 keepdir /var/lib/asterisk
377 keepdir /var/run/asterisk
378 keepdir /var/spool/asterisk
379 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
380 diropts -m 0750 -o asterisk -g asterisk
381 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
382
383 newinitd "${FILESDIR}"/1.6.1/asterisk.initd asterisk
384 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
385
386 # some people like to keep the sources around for custom patching
387 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
388 if use keepsrc
389 then
390 einfo "keepsrc useflag enabled, copying source..."
391 dodir /usr/src
392
393 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed"
394
395 ebegin "running make clean..."
396 emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed"
397 eend $?
398
399 einfo "Source files have been saved to "${ROOT}"usr/src/${PF}"
400 fi
401
402 # install the upgrade documentation
403 #
404 dodoc README UPGRADE* BUGS CREDITS
405
406 # install snmp mib files
407 #
408 if use snmp
409 then
410 insinto /usr/share/snmp/mibs/
411 doins doc/digium-mib.txt doc/asterisk-mib.txt
412 fi
413 }
414
415 pkg_preinst() {
416 enewgroup asterisk
417 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
418 }
419
420 pkg_postinst() {
421 ebegin "Fixing up permissions"
422 chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
423 chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
424
425 chown asterisk:asterisk "${ROOT}"etc/asterisk/
426 chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
427 chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
428 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
429 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
430 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
431 eend $?
432
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 }