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