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.5.ebuild ChangeLog
Date: Sat, 29 Aug 2009 17:44:20
Message-Id: E1MhWnQ-00012a-OF@stork.gentoo.org
1 chainsaw 09/08/29 22:53:20
2
3 Modified: ChangeLog
4 Added: asterisk-1.6.1.5.ebuild
5 Log:
6 Version bump. The first full non-security release since 1.6.1.2; two of our patches now appear to be upstream.
7 (Portage version: 2.1.6.13/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.207 net-misc/asterisk/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.207&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.207&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.206&r2=1.207
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
19 retrieving revision 1.206
20 retrieving revision 1.207
21 diff -u -r1.206 -r1.207
22 --- ChangeLog 27 Aug 2009 14:02:17 -0000 1.206
23 +++ ChangeLog 29 Aug 2009 22:53:20 -0000 1.207
24 @@ -1,6 +1,12 @@
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.206 2009/08/27 14:02:17 chainsaw Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.207 2009/08/29 22:53:20 chainsaw Exp $
29 +
30 +*asterisk-1.6.1.5 (29 Aug 2009)
31 +
32 + 29 Aug 2009; <chainsaw@g.o> +asterisk-1.6.1.5.ebuild:
33 + Version bump. The first full non-security release since 1.6.1.2; two of
34 + our patches now appear to be upstream.
35
36 *asterisk-1.6.1.4 (27 Aug 2009)
37
38
39
40
41 1.1 net-misc/asterisk/asterisk-1.6.1.5.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.5.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.5.ebuild?rev=1.1&content-type=text/plain
45
46 Index: asterisk-1.6.1.5.ebuild
47 ===================================================================
48 # Copyright 1999-2009 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.1.5.ebuild,v 1.1 2009/08/29 22:53:20 chainsaw Exp $
51
52 EAPI=1
53 inherit eutils autotools
54
55 MY_P="${PN}-${PV/_/-}"
56
57 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
58 HOMEPAGE="http://www.asterisk.org/"
59 SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz"
60 LICENSE="GPL-2"
61 SLOT="0"
62 KEYWORDS="~amd64 ~x86"
63
64 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"
65
66 RDEPEND="virtual/libc
67 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 h323? ( dev-libs/pwlib
77 net-libs/openh323 )
78 iconv? ( virtual/libiconv )
79 imap? ( virtual/imap-c-client )
80 jabber? ( dev-libs/iksemel )
81 ldap? ( net-nds/openldap )
82 misdn? ( net-dialup/misdnuser )
83 newt? ( dev-libs/newt )
84 odbc? ( dev-db/unixODBC )
85 postgres? ( virtual/postgresql-base )
86 radius? ( net-dialup/radiusclient-ng )
87 snmp? ( net-analyzer/net-snmp )
88 span? ( media-libs/spandsp )
89 speex? ( media-libs/speex )
90 sqlite? ( dev-db/sqlite )
91 ssl? ( dev-libs/openssl )
92 vorbis? ( media-libs/libvorbis )"
93
94 DEPEND="${RDEPEND}
95 !<net-misc/asterisk-addons-1.6"
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_ast10update || is_ast12update || is_ast14update ; then
145 ewarn " Asterisk UPGRADE Warning"
146 ewarn ""
147 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!"
148 ewarn ""
149 ewarn " Asterisk UPGRADE Warning"
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 # imap requires ssl if imap-c-client was built with ssl,
167 # conversely if ssl and imap are both on then imap-c-client needs ssl
168 if use imap; then
169 if use ssl && ! built_with_use virtual/imap-c-client ssl; then
170 eerror
171 eerror "IMAP with SSL requested, but your IMAP C-Client libraries"
172 eerror "are built without SSL!"
173 eerror
174 die "Please recompile the IMAP C-Client libraries with SSL support enabled"
175 elif ! use ssl && built_with_use virtual/imap-c-client ssl; then
176 eerror
177 eerror "IMAP without SSL requested, but your IMAP C-Client"
178 eerror "libraries are built with SSL!"
179 eerror
180 die "Please recompile the IMAP C-Client libraries without SSL support enabled"
181 fi
182 fi
183
184 if [[ -n "${ASTERISK_MODULES}" ]] ; then
185 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."
186 fi
187 }
188
189 src_unpack() {
190 unpack ${A}
191 cd "${S}"
192
193 #
194 # comment about h323 issues
195 #
196 if use h323 ; then
197 ewarn "h323 useflag: It is known that the h323 module doesn't compile
198 the \"normal\" way: For a workaround, asterisk will be built two times
199 without cleaning the build dir."
200 fi
201
202 #
203 # put pid file(s) into /var/run/asterisk
204 #
205 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-var_rundir.patch || die "patch failed"
206
207 #
208 # fix gsm codec cflags (e.g. i586 core epias) and disable
209 # assembler optimizations
210 #
211 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-gsm-pic.patch || die "patch failed"
212
213 #
214 # add missing LIBS for uclibc
215 #
216 epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-uclibc.patch || die "patch failed"
217
218 #
219 # link UW-IMAP with Kerberos5 if necessary
220 #
221 epatch "${FILESDIR}"/1.6.1/asterisk-1.6.1-imap-kerberos.patch || die "patch failed"
222
223 AT_M4DIR=autoconf eautoreconf
224
225 # parse modules list
226 if [[ -n "${ASTERISK_MODULES}" ]]; then
227 local x modules="$(get_available_modules)"
228
229 einfo "Custom list of modules specified, checking..."
230
231 use debug && {
232 einfo "Available modules: ${modules}"
233 einfo " Selected modules: ${ASTERISK_MODULES}"
234 }
235
236 for x in ${ASTERISK_MODULES}; do
237 if [[ "${x}" = "-*" ]]; then
238 MODULES_LIST=""
239 else
240 if has ${x} ${modules}
241 then
242 MODULES_LIST="${MODULES_LIST} ${x}"
243 else
244 eerror "Unknown module: ${x}"
245 fi
246 fi
247 done
248
249 export MODULES_LIST
250 fi
251 }
252
253 src_compile() {
254 #
255 # start with configure
256 #
257 econf \
258 --libdir="/usr/$(get_libdir)" \
259 --localstatedir="/var" \
260 --with-gsm=internal \
261 --with-popt \
262 --with-z \
263 $(use_with alsa asound) \
264 $(use_with caps cap) \
265 $(use_with curl) \
266 $(use_with dahdi pri) \
267 $(use_with dahdi tonezone) \
268 $(use_with dahdi) \
269 $(use_with freetds tds) \
270 $(use_with h323 h323 "/usr/share/openh323") \
271 $(use_with h323 pwlib "/usr/share/pwlib") \
272 $(use_with iconv) \
273 $(use_with imap) \
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 #
346 # fasten your seatbelts (and start praying)
347 #
348 if use h323 ; then
349 # emake one time to get h323 to make.... yea not "clean" but works
350 emake
351 fi
352
353 emake || die "emake failed"
354 }
355
356 src_install() {
357 # setup directory structure
358 #
359 mkdir -p "${D}"usr/lib/pkgconfig
360
361 emake DESTDIR="${D}" install || die "emake install failed"
362 emake DESTDIR="${D}" samples || die "emake samples failed"
363
364 # remove installed sample files if nosamples flag is set
365 if use nosamples; then
366 einfo "Skipping installation of sample files..."
367 rm -f "${D}"var/lib/asterisk/mohmp3/*
368 rm -f "${D}"var/lib/asterisk/sounds/demo-*
369 rm -f "${D}"var/lib/asterisk/agi-bin/*
370 else
371 einfo "Sample files have been installed"
372 fi
373 rm -rf "${D}"var/spool/asterisk/voicemail/default
374
375 # move sample configuration files to doc directory
376 if is_ast10update || is_ast12update || is_ast14update; then
377 einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed"
378 einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
379 fi
380
381 einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf"
382 insinto /usr/share/doc/${PF}/conf
383 doins "${D}"etc/asterisk/*.conf*
384
385 # keep directories
386 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
387 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
388
389 newinitd "${FILESDIR}"/1.6.1/asterisk.rc6 asterisk
390 newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
391
392 # some people like to keep the sources around for custom patching
393 # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
394 if use keepsrc
395 then
396 einfo "keepsrc useflag enabled, copying source..."
397 dodir /usr/src
398
399 cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed"
400
401 ebegin "running make clean..."
402 emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed"
403 eend $?
404
405 einfo "Source files have been saved to "${ROOT}"usr/src/${PF}"
406 fi
407
408 # install the upgrade documentation
409 #
410 dodoc README UPGRADE* BUGS CREDITS
411
412 # install snmp mib files
413 #
414 if use snmp
415 then
416 insinto /usr/share/snmp/mibs/
417 doins doc/digium-mib.txt doc/asterisk-mib.txt
418 fi
419 }
420
421 pkg_preinst() {
422 enewgroup asterisk
423 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
424 }
425
426 pkg_postinst() {
427 ebegin "Fixing up permissions"
428 chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
429 chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
430
431 for x in lib run spool; do
432 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
433 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
434 done
435
436 chown asterisk:asterisk "${ROOT}"etc/asterisk/
437 chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
438 chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
439 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
440 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
441 chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
442 eend $?
443
444 #
445 # Announcements, warnings, reminders...
446 #
447 einfo "Asterisk has been installed"
448 echo
449 elog "If you want to know more about asterisk, visit these sites:"
450 elog "http://www.asteriskdocs.org/"
451 elog "http://www.voip-info.org/wiki-Asterisk"
452 echo
453 elog "http://www.automated.it/guidetoasterisk.htm"
454 echo
455 elog "Gentoo VoIP IRC Channel:"
456 elog "#gentoo-voip @ irc.freenode.net"
457 echo
458 echo
459
460 #
461 # Warning about 1.x -> 1.6 changes...
462 #
463 if is_ast10update || is_ast12update || is_ast14update; then
464 ewarn ""
465 ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 before continuing"
466 ewarn ""
467 fi
468 }
469
470 pkg_config() {
471 einfo "Do you want to reset file permissions and ownerships (y/N)?"
472
473 read tmp
474 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
475
476 if [[ "$tmp" = "y" ]] ||\
477 [[ "$tmp" = "yes" ]]
478 then
479 einfo "Resetting permissions to defaults..."
480
481 for x in spool run lib log; do
482 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
483 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
484 done
485
486 chown -R root:asterisk "${ROOT}"etc/asterisk
487 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
488
489 einfo "done"
490 else
491 einfo "skipping"
492 fi
493 }