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.12-r1.ebuild ChangeLog asterisk-1.6.1.11.ebuild asterisk-1.6.1.12.ebuild
Date: Mon, 04 Jan 2010 12:56:19
Message-Id: E1NRmTo-00072w-UR@stork.gentoo.org
1 chainsaw 10/01/04 12:56:16
2
3 Modified: ChangeLog
4 Added: asterisk-1.6.1.12-r1.ebuild
5 Removed: asterisk-1.6.1.11.ebuild asterisk-1.6.1.12.ebuild
6 Log:
7 Update parallel make patchset as it broke for USE=keepsrc with make clean. An anonymous source on IRC pointed this out.
8 (Portage version: 2.1.7.16/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.238 net-misc/asterisk/ChangeLog
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.238&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.238&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.237&r2=1.238
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
20 retrieving revision 1.237
21 retrieving revision 1.238
22 diff -u -r1.237 -r1.238
23 --- ChangeLog 27 Dec 2009 09:41:51 -0000 1.237
24 +++ ChangeLog 4 Jan 2010 12:56:16 -0000 1.238
25 @@ -1,6 +1,15 @@
26 # ChangeLog for net-misc/asterisk
27 -# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.237 2009/12/27 09:41:51 josejx Exp $
29 +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
30 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.238 2010/01/04 12:56:16 chainsaw Exp $
31 +
32 +*asterisk-1.6.1.12-r1 (04 Jan 2010)
33 +
34 + 04 Jan 2010; <chainsaw@g.o> -asterisk-1.6.1.11.ebuild,
35 + -asterisk-1.6.1.12.ebuild, +asterisk-1.6.1.12-r1.ebuild,
36 + -files/1.6.1/asterisk-1.6.1.12-parallel-make.patch,
37 + +files/1.6.1/asterisk-1.6.1.12-parallel-make-v2.patch:
38 + Update parallel make patchset as it broke for USE=keepsrc with make clean.
39 + An anonymous source on IRC pointed this out.
40
41 27 Dec 2009; Joseph Jezak <josejx@g.o> asterisk-1.2.36.ebuild:
42 Marked ppc stable for bug #284892.
43
44
45
46 1.1 net-misc/asterisk/asterisk-1.6.1.12-r1.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.12-r1.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.12-r1.ebuild?rev=1.1&content-type=text/plain
50
51 Index: asterisk-1.6.1.12-r1.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.12-r1.ebuild,v 1.1 2010/01/04 12:56:16 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 # allow longer CID field so European phone numbers (which are often longer then USA
209 # numbers) have a better chance of avoiding truncation
210 # https://issues.asterisk.org/view.php?id=16459
211 #
212
213 epatch "${FILESDIR}"/1.6.1/${P}-longer-sip-cid.patch || die "patch failed"
214
215 #
216 # sprinkle some plus signs in strategic locations for maximum parallel make happiness
217 # https://issues.asterisk.org/view.php?id=16489
218 #
219 epatch "${FILESDIR}"/1.6.1/${P}-parallel-make-v2.patch || die "patch failed"
220
221 AT_M4DIR=autoconf eautoreconf
222
223 # parse modules list
224 if [[ -n "${ASTERISK_MODULES}" ]]; then
225 local x modules="$(get_available_modules)"
226
227 einfo "Custom list of modules specified, checking..."
228
229 use debug && {
230 einfo "Available modules: ${modules}"
231 einfo " Selected modules: ${ASTERISK_MODULES}"
232 }
233
234 for x in ${ASTERISK_MODULES}; do
235 if [[ "${x}" = "-*" ]]; then
236 MODULES_LIST=""
237 else
238 if has ${x} ${modules}
239 then
240 MODULES_LIST="${MODULES_LIST} ${x}"
241 else
242 eerror "Unknown module: ${x}"
243 fi
244 fi
245 done
246
247 export MODULES_LIST
248 fi
249 }
250
251 src_compile() {
252 #
253 # start with configure
254 #
255 econf \
256 --libdir="/usr/$(get_libdir)" \
257 --localstatedir="/var" \
258 --with-gsm=internal \
259 --with-popt \
260 --with-z \
261 $(use_with alsa asound) \
262 $(use_with caps cap) \
263 $(use_with curl) \
264 $(use_with dahdi pri) \
265 $(use_with dahdi tonezone) \
266 $(use_with dahdi) \
267 $(use_with freetds tds) \
268 $(use_with iconv) \
269 $(use_with jabber iksemel) \
270 $(use_with misdn isdnnet) \
271 $(use_with misdn suppserv) \
272 $(use_with misdn) \
273 $(use_with newt) \
274 $(use_with odbc) \
275 $(use_with oss) \
276 $(use_with postgres) \
277 $(use_with radius) \
278 $(use_with snmp netsnmp) \
279 $(use_with span spandsp) \
280 $(use_with speex) \
281 $(use_with speex speexdsp) \
282 $(use_with sqlite sqlite3) \
283 $(use_with ssl crypto) \
284 $(use_with ssl) \
285 $(use_with vorbis ogg) \
286 $(use_with vorbis) || die "econf failed"
287
288 #
289 # custom module filter
290 # run menuselect to evaluate the list of modules
291 # and rewrite the list afterwards
292 #
293 if [[ -n "${MODULES_LIST}" ]]
294 then
295 local mod category tmp_list failed_list
296
297 ###
298 # run menuselect
299
300 emake menuselect.makeopts || die "emake menuselect.makeopts failed"
301
302 ###
303 # get list of modules with failed dependencies
304
305 failed_list="$(awk -F= '/^MENUSELECT_DEPSFAILED=/{ print $3 }' menuselect.makeopts)"
306
307 ###
308 # traverse our list of modules
309
310 for category in app cdr codec format func pbx res; do
311 tmp_list=""
312
313 # search list of modules for matching ones first...
314 for mod in ${MODULES_LIST}; do
315 # module is from current category?
316 if [[ "${mod/%_*}" = "${category}" ]]
317 then
318 # check menuselect thinks the dependencies are met
319 if has ${mod} ${failed_list}
320 then
321 eerror "${mod}: dependencies required to build this module are not met, NOT BUILDING!"
322 else
323 tmp_list="${tmp_list} ${mod}"
324 fi
325 fi
326 done
327
328 use debug && echo "${category} tmp: ${tmp_list}"
329
330 # replace the module list for $category with our custom one
331 if [[ -n "${tmp_list}" ]]
332 then
333 category="$(echo ${category} | tr '[:lower:]' '[:upper:]')"
334 sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \
335 menuselect.makeopts || die "failed to set list of ${category} applications"
336 fi
337 done
338 fi
339
340 ASTLDFLAGS="${LDFLAGS}" emake || die "emake failed"
341 }
342
343 src_install() {
344 # setup directory structure
345 #
346 mkdir -p "${D}"usr/lib/pkgconfig
347
348 emake DESTDIR="${D}" install || die "emake install failed"
349 emake DESTDIR="${D}" samples || die "emake samples failed"
350
351 # remove installed sample files if nosamples flag is set
352 if use nosamples; then
353 einfo "Skipping installation of sample files..."
354 rm -f "${D}"var/lib/asterisk/mohmp3/*
355 rm -f "${D}"var/lib/asterisk/sounds/demo-*
356 rm -f "${D}"var/lib/asterisk/agi-bin/*
357 else
358 einfo "Sample files have been installed"
359 fi
360 rm -rf "${D}"var/spool/asterisk/voicemail/default
361
362 # move sample configuration files to doc directory
363 if is_ast10update || is_ast12update || is_ast14update; then
364 einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed"
365 einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
366 fi
367
368 einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf"
369 insinto /usr/share/doc/${PF}/conf
370 doins "${D}"etc/asterisk/*.conf*
371
372 cd "${D}"
373 for conffile in etc/asterisk/*.*
374 do
375 fowners asterisk:asterisk $conffile
376 fperms 0660 $conffile
377 done
378 cd "${S}"
379
380 # keep directories
381 diropts -m 0770 -o asterisk -g asterisk
382 keepdir /etc/asterisk
383 keepdir /var/lib/asterisk
384 keepdir /var/run/asterisk
385 keepdir /var/spool/asterisk
386 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
387 diropts -m 0750 -o asterisk -g asterisk
388 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
389
390 newinitd "${FILESDIR}"/1.6.1/asterisk.initd2 asterisk
391 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
392
393 # some people like to keep the sources around for custom patching
394 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
395 if use keepsrc
396 then
397 einfo "keepsrc useflag enabled, copying source..."
398 dodir /usr/src
399
400 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed"
401
402 ebegin "running make clean..."
403 emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed"
404 eend $?
405
406 einfo "Source files have been saved to "${ROOT}"usr/src/${PF}"
407 fi
408
409 # install the upgrade documentation
410 #
411 dodoc README UPGRADE* BUGS CREDITS
412
413 # install snmp mib files
414 #
415 if use snmp
416 then
417 insinto /usr/share/snmp/mibs/
418 doins doc/digium-mib.txt doc/asterisk-mib.txt
419 fi
420 }
421
422 pkg_preinst() {
423 enewgroup asterisk
424 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
425 }
426
427 pkg_postinst() {
428 #
429 # Announcements, warnings, reminders...
430 #
431 einfo "Asterisk has been installed"
432 echo
433 elog "If you want to know more about asterisk, visit these sites:"
434 elog "http://www.asteriskdocs.org/"
435 elog "http://www.voip-info.org/wiki-Asterisk"
436 echo
437 elog "http://www.automated.it/guidetoasterisk.htm"
438 echo
439 elog "Gentoo VoIP IRC Channel:"
440 elog "#gentoo-voip @ irc.freenode.net"
441 echo
442 echo
443
444 #
445 # Warning about 1.x -> 1.6 changes...
446 #
447 if is_ast10update || is_ast12update || is_ast14update; then
448 ewarn ""
449 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 before continuing"
450 ewarn ""
451 fi
452 }
453
454 pkg_config() {
455 einfo "Do you want to reset file permissions and ownerships (y/N)?"
456
457 read tmp
458 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
459
460 if [[ "$tmp" = "y" ]] ||\
461 [[ "$tmp" = "yes" ]]
462 then
463 einfo "Resetting permissions to defaults..."
464
465 for x in spool run lib log; do
466 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
467 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
468 done
469
470 chown -R root:asterisk "${ROOT}"etc/asterisk
471 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
472
473 einfo "done"
474 else
475 einfo "skipping"
476 fi
477 }