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-10.5.0.ebuild ChangeLog asterisk-1.8.13.0.ebuild
Date: Wed, 06 Jun 2012 10:07:58
Message-Id: 20120606100745.26C6F2004B@flycatcher.gentoo.org
1 chainsaw 12/06/06 10:07:45
2
3 Modified: ChangeLog
4 Added: asterisk-10.5.0.ebuild asterisk-1.8.13.0.ebuild
5 Log:
6 Bugfix releases on both the 1.8 & 10 branches, squelches a warning with bind address set to "any", prevents an overflow on 32-bit systems for ast_tvdiff_ms calculation and various rerouting/transfer fixes. Updated helper scripts by Jaco Kroon, closes bug #414585.
7
8 (Portage version: 2.1.10.63/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.398 net-misc/asterisk/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.398&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/ChangeLog?rev=1.398&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/ChangeLog?r1=1.397&r2=1.398
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v
20 retrieving revision 1.397
21 retrieving revision 1.398
22 diff -u -r1.397 -r1.398
23 --- ChangeLog 30 May 2012 10:42:47 -0000 1.397
24 +++ ChangeLog 6 Jun 2012 10:07:45 -0000 1.398
25 @@ -1,6 +1,17 @@
26 # ChangeLog for net-misc/asterisk
27 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.397 2012/05/30 10:42:47 ago Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.398 2012/06/06 10:07:45 chainsaw Exp $
30 +
31 +*asterisk-10.5.0 (06 Jun 2012)
32 +*asterisk-1.8.13.0 (06 Jun 2012)
33 +
34 + 06 Jun 2012; Tony Vroon <chainsaw@g.o> +files/1.8.0/find_call_ids.sh,
35 + +files/1.8.0/find_call_sip_trace.sh, +asterisk-1.8.13.0.ebuild,
36 + +asterisk-10.5.0.ebuild:
37 + Bugfix releases on both the 1.8 & 10 branches, squelches a warning with bind
38 + address set to "any", prevents an overflow on 32-bit systems for
39 + ast_tvdiff_ms calculation and various rerouting/transfer fixes. Updated
40 + helper scripts by Jaco Kroon, closes bug #414585.
41
42 30 May 2012; Agostino Sarubbo <ago@g.o> -asterisk-1.8.11.1.ebuild:
43 Remove old
44
45
46
47 1.1 net-misc/asterisk/asterisk-10.5.0.ebuild
48
49 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/asterisk-10.5.0.ebuild?rev=1.1&view=markup
50 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/asterisk-10.5.0.ebuild?rev=1.1&content-type=text/plain
51
52 Index: asterisk-10.5.0.ebuild
53 ===================================================================
54 # Copyright 1999-2012 Gentoo Foundation
55 # Distributed under the terms of the GNU General Public License v2
56 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-10.5.0.ebuild,v 1.1 2012/06/06 10:07:45 chainsaw Exp $
57
58 EAPI=4
59 inherit autotools base eutils linux-info multilib
60
61 MY_P="${PN}-${PV/_/-}"
62
63 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
64 HOMEPAGE="http://www.asterisk.org/"
65 SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/${MY_P}.tar.gz
66 mirror://gentoo/gentoo-asterisk-patchset-2.5.tar.bz2"
67 LICENSE="GPL-2"
68 SLOT="0"
69 KEYWORDS="~amd64 ~x86"
70
71 IUSE="ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex srtp static syslog usb vorbis"
72 REQUIRED_USE="gtalk? ( jabber )"
73
74 EPATCH_SUFFIX="patch"
75 PATCHES=( "${WORKDIR}/asterisk-patchset" )
76
77 RDEPEND="dev-db/sqlite:3
78 dev-libs/popt
79 dev-libs/libxml2
80 dev-libs/openssl
81 sys-libs/ncurses
82 sys-libs/zlib
83 ais? ( sys-cluster/openais )
84 alsa? ( media-libs/alsa-lib )
85 bluetooth? ( net-wireless/bluez )
86 calendar? ( net-libs/neon
87 dev-libs/libical
88 dev-libs/iksemel )
89 caps? ( sys-libs/libcap )
90 curl? ( net-misc/curl )
91 dahdi? ( >=net-libs/libpri-1.4.12_beta2
92 net-misc/dahdi-tools )
93 freetds? ( dev-db/freetds )
94 gtalk? ( dev-libs/iksemel )
95 http? ( dev-libs/gmime:2.4 )
96 iconv? ( virtual/libiconv )
97 jabber? ( dev-libs/iksemel )
98 jingle? ( dev-libs/iksemel )
99 ldap? ( net-nds/openldap )
100 lua? ( dev-lang/lua )
101 mysql? ( virtual/mysql )
102 newt? ( dev-libs/newt )
103 odbc? ( dev-db/unixODBC )
104 osplookup? ( net-libs/osptoolkit )
105 portaudio? ( media-libs/portaudio )
106 postgres? ( dev-db/postgresql-base )
107 radius? ( net-dialup/radiusclient-ng )
108 snmp? ( net-analyzer/net-snmp )
109 span? ( media-libs/spandsp )
110 speex? ( media-libs/speex )
111 srtp? ( net-libs/libsrtp )
112 usb? ( virtual/libusb:0
113 media-libs/alsa-lib )
114 vorbis? ( media-libs/libvorbis )"
115
116 DEPEND="${RDEPEND}
117 !net-libs/openh323"
118
119 RDEPEND="${RDEPEND}
120 syslog? ( virtual/logger )"
121
122 PDEPEND="net-misc/asterisk-core-sounds
123 net-misc/asterisk-extra-sounds
124 net-misc/asterisk-moh-opsound"
125
126 S="${WORKDIR}/${MY_P}"
127
128 pkg_setup() {
129 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
130 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
131 have reported that this module dropped critical SIP packets in their deployments. You
132 may want to disable it if you see such problems."
133 check_extra_config
134
135 enewgroup asterisk
136 enewgroup dialout 20
137 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
138 }
139
140 src_prepare() {
141 base_src_prepare
142 AT_M4DIR=autoconf eautoreconf
143 }
144
145 src_configure() {
146 econf \
147 --libdir="/usr/$(get_libdir)" \
148 --localstatedir="/var" \
149 --with-crypto \
150 --with-gsm=internal \
151 --with-popt \
152 --with-ssl \
153 --with-z \
154 $(use_with caps cap) \
155 $(use_with http gmime) \
156 $(use_with newt) \
157 $(use_with portaudio)
158
159 # Blank out sounds/sounds.xml file to prevent
160 # asterisk from installing sounds files (we pull them in via
161 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
162 >"${S}"/sounds/sounds.xml
163
164 # Compile menuselect binary for optional components
165 emake menuselect.makeopts
166
167 # Broken functionality is forcibly disabled (bug #360143)
168 menuselect/menuselect --disable chan_misdn menuselect.makeopts
169 menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
170
171 # Utility set is forcibly enabled (bug #358001)
172 menuselect/menuselect --enable smsq menuselect.makeopts
173 menuselect/menuselect --enable streamplayer menuselect.makeopts
174 menuselect/menuselect --enable aelparse menuselect.makeopts
175 menuselect/menuselect --enable astman menuselect.makeopts
176
177 # this is connected, otherwise it would not find
178 # ast_pktccops_gate_alloc symbol
179 menuselect/menuselect --enable chan_mgcp menuselect.makeopts
180 menuselect/menuselect --enable res_pktccops menuselect.makeopts
181
182 # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
183 menuselect/menuselect --enable pbx_dundi menuselect.makeopts
184 menuselect/menuselect --enable func_aes menuselect.makeopts
185 menuselect/menuselect --enable chan_iax2 menuselect.makeopts
186
187 # SQlite3 is now the main database backend, enable related features
188 menuselect/menuselect --enable cdr_sqlite3_custom menuselect.makeopts
189 menuselect/menuselect --enable cel_sqlite3_custom menuselect.makeopts
190
191 # The others are based on USE-flag settings
192 use_select() {
193 local state=$(use "$1" && echo enable || echo disable)
194 shift # remove use from parameters
195
196 while [[ -n $1 ]]; do
197 menuselect/menuselect --${state} "$1" menuselect.makeopts
198 shift
199 done
200 }
201
202 use_select ais res_ais
203 use_select alsa chan_alsa
204 use_select bluetooth chan_mobile
205 use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
206 use_select curl func_curl res_config_curl res_curl
207 use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi
208 use_select freetds {cdr,cel}_tds
209 use_select gtalk chan_gtalk
210 use_select http res_http_post
211 use_select iconv func_iconv
212 use_select jabber res_jabber
213 use_select jingle chan_jingle
214 use_select ldap res_config_ldap
215 use_select lua pbx_lua
216 use_select mysql app_mysql cdr_mysql res_config_mysql
217 use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
218 use_select osplookup app_osplookup
219 use_select oss chan_oss
220 use_select postgres {cdr,cel}_pgsql res_config_pgsql
221 use_select radius {cdr,cel}_radius
222 use_select snmp res_snmp
223 use_select span res_fax_spandsp
224 use_select speex {codec,func}_speex
225 use_select srtp res_srtp
226 use_select syslog cdr_syslog
227 use_select usb chan_usbradio
228 use_select vorbis format_ogg_vorbis
229 }
230
231 src_compile() {
232 ASTLDFLAGS="${LDFLAGS}" emake
233 }
234
235 src_install() {
236 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die
237 emake DESTDIR="${D}" installdirs
238 emake DESTDIR="${D}" install
239
240 if use radius; then
241 insinto /etc/radiusclient-ng/
242 doins contrib/dictionary.digium
243 fi
244 if use samples; then
245 emake DESTDIR="${D}" samples
246 for conffile in "${D}"etc/asterisk/*.*
247 do
248 chown asterisk:asterisk $conffile
249 chmod 0660 $conffile
250 done
251 einfo "Sample files have been installed"
252 else
253 einfo "Skipping installation of sample files..."
254 rm -f "${D}"var/lib/asterisk/mohmp3/* || die
255 rm -f "${D}"var/lib/asterisk/sounds/demo-* || die
256 rm -f "${D}"var/lib/asterisk/agi-bin/* || die
257 rm -f "${D}"etc/asterisk/* || die
258 fi
259 rm -rf "${D}"var/spool/asterisk/voicemail/default || die
260
261 # keep directories
262 diropts -m 0770 -o asterisk -g asterisk
263 keepdir /etc/asterisk
264 keepdir /var/lib/asterisk
265 keepdir /var/run/asterisk
266 keepdir /var/spool/asterisk
267 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
268 diropts -m 0750 -o asterisk -g asterisk
269 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
270
271 newinitd "${FILESDIR}"/1.8.0/asterisk.initd2 asterisk
272 newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk
273
274 # install the upgrade documentation
275 #
276 dodoc README UPGRADE* BUGS CREDITS
277
278 # install extra documentation
279 #
280 if use doc
281 then
282 dodoc doc/*.txt
283 dodoc doc/*.pdf
284 fi
285
286 # install SIP scripts; bug #300832
287 #
288 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
289 dodoc "${FILESDIR}/1.8.0/find_call_sip_trace.sh"
290 dodoc "${FILESDIR}/1.8.0/find_call_ids.sh"
291 dodoc "${FILESDIR}/1.6.2/call_data.txt"
292
293 # install logrotate snippet; bug #329281
294 #
295 insinto /etc/logrotate.d
296 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
297 }
298
299 pkg_postinst() {
300 #
301 # Announcements, warnings, reminders...
302 #
303 einfo "Asterisk has been installed"
304 echo
305 elog "If you want to know more about asterisk, visit these sites:"
306 elog "http://www.asteriskdocs.org/"
307 elog "http://www.voip-info.org/wiki-Asterisk"
308 echo
309 elog "http://www.automated.it/guidetoasterisk.htm"
310 echo
311 elog "Gentoo VoIP IRC Channel:"
312 elog "#gentoo-voip @ irc.freenode.net"
313 echo
314 echo
315 elog "1.6 -> 1.8 changes that you may care about:"
316 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
317 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
318 }
319
320 pkg_config() {
321 einfo "Do you want to reset file permissions and ownerships (y/N)?"
322
323 read tmp
324 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
325
326 if [[ "$tmp" = "y" ]] ||\
327 [[ "$tmp" = "yes" ]]
328 then
329 einfo "Resetting permissions to defaults..."
330
331 for x in spool run lib log; do
332 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
333 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
334 done
335
336 chown -R root:asterisk "${ROOT}"etc/asterisk
337 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
338
339 einfo "done"
340 else
341 einfo "skipping"
342 fi
343 }
344
345
346
347 1.1 net-misc/asterisk/asterisk-1.8.13.0.ebuild
348
349 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/asterisk-1.8.13.0.ebuild?rev=1.1&view=markup
350 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/asterisk/asterisk-1.8.13.0.ebuild?rev=1.1&content-type=text/plain
351
352 Index: asterisk-1.8.13.0.ebuild
353 ===================================================================
354 # Copyright 1999-2012 Gentoo Foundation
355 # Distributed under the terms of the GNU General Public License v2
356 # $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.8.13.0.ebuild,v 1.1 2012/06/06 10:07:45 chainsaw Exp $
357
358 EAPI=4
359 inherit autotools base eutils linux-info multilib
360
361 MY_P="${PN}-${PV/_/-}"
362
363 DESCRIPTION="Asterisk: A Modular Open Source PBX System"
364 HOMEPAGE="http://www.asterisk.org/"
365 SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/${MY_P}.tar.gz
366 mirror://gentoo/gentoo-asterisk-patchset-1.13.tar.bz2"
367 LICENSE="GPL-2"
368 SLOT="0"
369 KEYWORDS="~amd64 ~x86"
370
371 IUSE="ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex sqlite sqlite3 srtp static syslog usb vorbis"
372 REQUIRED_USE="gtalk? ( jabber )"
373
374 EPATCH_SUFFIX="patch"
375 PATCHES=( "${WORKDIR}/asterisk-patchset" )
376
377 RDEPEND="dev-libs/popt
378 dev-libs/libxml2
379 dev-libs/openssl
380 sys-libs/ncurses
381 sys-libs/zlib
382 ais? ( sys-cluster/openais )
383 alsa? ( media-libs/alsa-lib )
384 bluetooth? ( net-wireless/bluez )
385 calendar? ( net-libs/neon
386 dev-libs/libical
387 dev-libs/iksemel )
388 caps? ( sys-libs/libcap )
389 curl? ( net-misc/curl )
390 dahdi? ( >=net-libs/libpri-1.4.12_beta2
391 net-misc/dahdi-tools )
392 freetds? ( dev-db/freetds )
393 gtalk? ( dev-libs/iksemel )
394 http? ( dev-libs/gmime:2.4 )
395 iconv? ( virtual/libiconv )
396 jabber? ( dev-libs/iksemel )
397 jingle? ( dev-libs/iksemel )
398 ldap? ( net-nds/openldap )
399 lua? ( dev-lang/lua )
400 mysql? ( virtual/mysql )
401 newt? ( dev-libs/newt )
402 odbc? ( dev-db/unixODBC )
403 osplookup? ( net-libs/osptoolkit )
404 portaudio? ( media-libs/portaudio )
405 postgres? ( dev-db/postgresql-base )
406 radius? ( net-dialup/radiusclient-ng )
407 snmp? ( net-analyzer/net-snmp )
408 span? ( media-libs/spandsp )
409 speex? ( media-libs/speex )
410 sqlite? ( dev-db/sqlite:0 )
411 sqlite3? ( dev-db/sqlite:3 )
412 srtp? ( net-libs/libsrtp )
413 usb? ( virtual/libusb:0
414 media-libs/alsa-lib )
415 vorbis? ( media-libs/libvorbis )"
416
417 DEPEND="${RDEPEND}
418 !net-libs/openh323"
419
420 RDEPEND="${RDEPEND}
421 syslog? ( virtual/logger )"
422
423 PDEPEND="net-misc/asterisk-core-sounds
424 net-misc/asterisk-extra-sounds
425 net-misc/asterisk-moh-opsound"
426
427 S="${WORKDIR}/${MY_P}"
428
429 pkg_setup() {
430 CONFIG_CHECK="~!NF_CONNTRACK_SIP"
431 local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users
432 have reported that this module dropped critical SIP packets in their deployments. You
433 may want to disable it if you see such problems."
434 check_extra_config
435
436 enewgroup asterisk
437 enewgroup dialout 20
438 enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
439 }
440
441 src_prepare() {
442 base_src_prepare
443 AT_M4DIR=autoconf eautoreconf
444 }
445
446 src_configure() {
447 econf \
448 --libdir="/usr/$(get_libdir)" \
449 --localstatedir="/var" \
450 --with-crypto \
451 --with-gsm=internal \
452 --with-popt \
453 --with-ssl \
454 --with-z \
455 $(use_with caps cap) \
456 $(use_with http gmime) \
457 $(use_with newt) \
458 $(use_with portaudio)
459
460 # Blank out sounds/sounds.xml file to prevent
461 # asterisk from installing sounds files (we pull them in via
462 # asterisk-{core,extra}-sounds and asterisk-moh-opsound.
463 >"${S}"/sounds/sounds.xml
464
465 # Compile menuselect binary for optional components
466 emake menuselect.makeopts
467
468 # Broken functionality is forcibly disabled (bug #360143)
469 menuselect/menuselect --disable chan_misdn menuselect.makeopts
470 menuselect/menuselect --disable chan_ooh323 menuselect.makeopts
471
472 # Utility set is forcibly enabled (bug #358001)
473 menuselect/menuselect --enable smsq menuselect.makeopts
474 menuselect/menuselect --enable streamplayer menuselect.makeopts
475 menuselect/menuselect --enable aelparse menuselect.makeopts
476 menuselect/menuselect --enable astman menuselect.makeopts
477
478 # this is connected, otherwise it would not find
479 # ast_pktccops_gate_alloc symbol
480 menuselect/menuselect --enable chan_mgcp menuselect.makeopts
481 menuselect/menuselect --enable res_pktccops menuselect.makeopts
482
483 # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available
484 menuselect/menuselect --enable pbx_dundi menuselect.makeopts
485 menuselect/menuselect --enable func_aes menuselect.makeopts
486 menuselect/menuselect --enable chan_iax2 menuselect.makeopts
487
488 # The others are based on USE-flag settings
489 use_select() {
490 local state=$(use "$1" && echo enable || echo disable)
491 shift # remove use from parameters
492
493 while [[ -n $1 ]]; do
494 menuselect/menuselect --${state} "$1" menuselect.makeopts
495 shift
496 done
497 }
498
499 use_select ais res_ais
500 use_select alsa chan_alsa
501 use_select bluetooth chan_mobile
502 use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
503 use_select curl func_curl res_config_curl res_curl
504 use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi
505 use_select freetds {cdr,cel}_tds
506 use_select gtalk chan_gtalk
507 use_select http res_http_post
508 use_select iconv func_iconv
509 use_select jabber res_jabber
510 use_select jingle chan_jingle
511 use_select ldap res_config_ldap
512 use_select lua pbx_lua
513 use_select mysql app_mysql cdr_mysql res_config_mysql
514 use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc
515 use_select osplookup app_osplookup
516 use_select oss chan_oss
517 use_select postgres {cdr,cel}_pgsql res_config_pgsql
518 use_select radius {cdr,cel}_radius
519 use_select snmp res_snmp
520 use_select span res_fax_spandsp
521 use_select speex {codec,func}_speex
522 use_select sqlite cdr_sqlite
523 use_select sqlite3 {cdr,cel}_sqlite3_custom
524 use_select srtp res_srtp
525 use_select syslog cdr_syslog
526 use_select usb chan_usbradio
527 use_select vorbis format_ogg_vorbis
528 }
529
530 src_compile() {
531 ASTLDFLAGS="${LDFLAGS}" emake
532 }
533
534 src_install() {
535 mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die
536 emake DESTDIR="${D}" installdirs
537 emake DESTDIR="${D}" install
538
539 if use radius; then
540 insinto /etc/radiusclient-ng/
541 doins contrib/dictionary.digium
542 fi
543 if use samples; then
544 emake DESTDIR="${D}" samples
545 for conffile in "${D}"etc/asterisk/*.*
546 do
547 chown asterisk:asterisk $conffile
548 chmod 0660 $conffile
549 done
550 einfo "Sample files have been installed"
551 else
552 einfo "Skipping installation of sample files..."
553 rm -f "${D}"var/lib/asterisk/mohmp3/* || die
554 rm -f "${D}"var/lib/asterisk/sounds/demo-* || die
555 rm -f "${D}"var/lib/asterisk/agi-bin/* || die
556 rm -f "${D}"etc/asterisk/* || die
557 fi
558 rm -rf "${D}"var/spool/asterisk/voicemail/default || die
559
560 # keep directories
561 diropts -m 0770 -o asterisk -g asterisk
562 keepdir /etc/asterisk
563 keepdir /var/lib/asterisk
564 keepdir /var/run/asterisk
565 keepdir /var/spool/asterisk
566 keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
567 diropts -m 0750 -o asterisk -g asterisk
568 keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
569
570 newinitd "${FILESDIR}"/1.8.0/asterisk.initd2 asterisk
571 newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk
572
573 # install the upgrade documentation
574 #
575 dodoc README UPGRADE* BUGS CREDITS
576
577 # install extra documentation
578 #
579 if use doc
580 then
581 dodoc doc/*.txt
582 dodoc doc/*.pdf
583 fi
584
585 # install SIP scripts; bugs #300832 & #414585
586 #
587 dodoc "${FILESDIR}/1.6.2/sip_calc_auth"
588 dodoc "${FILESDIR}/1.8.0/find_call_sip_trace.sh"
589 dodoc "${FILESDIR}/1.8.0/find_call_ids.sh"
590 dodoc "${FILESDIR}/1.6.2/call_data.txt"
591
592 # install logrotate snippet; bug #329281
593 #
594 insinto /etc/logrotate.d
595 newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk
596 }
597
598 pkg_postinst() {
599 #
600 # Announcements, warnings, reminders...
601 #
602 einfo "Asterisk has been installed"
603 echo
604 elog "If you want to know more about asterisk, visit these sites:"
605 elog "http://www.asteriskdocs.org/"
606 elog "http://www.voip-info.org/wiki-Asterisk"
607 echo
608 elog "http://www.automated.it/guidetoasterisk.htm"
609 echo
610 elog "Gentoo VoIP IRC Channel:"
611 elog "#gentoo-voip @ irc.freenode.net"
612 echo
613 echo
614 elog "1.6 -> 1.8 changes that you may care about:"
615 elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt"
616 elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2"
617 }
618
619 pkg_config() {
620 einfo "Do you want to reset file permissions and ownerships (y/N)?"
621
622 read tmp
623 tmp="$(echo $tmp | tr '[:upper:]' '[:lower:]')"
624
625 if [[ "$tmp" = "y" ]] ||\
626 [[ "$tmp" = "yes" ]]
627 then
628 einfo "Resetting permissions to defaults..."
629
630 for x in spool run lib log; do
631 chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
632 chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
633 done
634
635 chown -R root:asterisk "${ROOT}"etc/asterisk
636 chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
637
638 einfo "done"
639 else
640 einfo "skipping"
641 fi
642 }