summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-misc/asterisk/ChangeLog12
-rw-r--r--net-misc/asterisk/Manifest46
-rw-r--r--net-misc/asterisk/asterisk-1.0.7-r1.ebuild423
-rw-r--r--net-misc/asterisk/files/1.0.0/asterisk.confd.sec28
-rw-r--r--net-misc/asterisk/files/1.0.0/asterisk.rc6.sec28
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.0.7-r13
6 files changed, 513 insertions, 27 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog
index b2534ea5e631..4deea7d0ef46 100644
--- a/net-misc/asterisk/ChangeLog
+++ b/net-misc/asterisk/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-misc/asterisk
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.47 2005/05/05 15:52:23 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.48 2005/05/07 18:35:35 stkn Exp $
+
+*asterisk-1.0.7-r1 (07 May 2005)
+
+ 07 May 2005; Stefan Knoblich <stkn@gentoo.org>
+ +files/1.0.0/asterisk.confd.sec, +files/1.0.0/asterisk.rc6.sec,
+ +asterisk-1.0.7-r1.ebuild:
+ Fixes bug #88732, adding asterisk user and group, changing
+ permissions of files in /var/{lib,spool,run,log}/asterisk
+ to asterisk:asterisk rwxr-x---. Updated to bristuff-0.2.0-RC8a.
+ Masked for testing.
05 May 2005; Sven Wegener <swegener@gentoo.org> asterisk-1.0.6.ebuild,
asterisk-1.0.7.ebuild:
diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
index 85ce65703442..86ccfa118d65 100644
--- a/net-misc/asterisk/Manifest
+++ b/net-misc/asterisk/Manifest
@@ -1,43 +1,37 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 ff5a5be2f2ba9554d1757b150d63b4a1 asterisk-1.0.7.ebuild 9723
-MD5 465f444622b40abb34bbb311b571ed24 asterisk-1.0.2.ebuild 5585
-MD5 867bae5d74f56337feec21310c14ecca asterisk-1.0.5-r1.ebuild 7170
-MD5 1f0cf9681436a84a7be9a324e8375ef3 asterisk-1.0.6.ebuild 8622
+MD5 8388fc9efdadba3415b014dfa993964d ChangeLog 8873
+MD5 b551ce4bb8eb4a03cb0e551c279ab02c asterisk-0.9.0.ebuild 3161
+MD5 6201814863e121c6cae9a8209b0b9a27 asterisk-1.0.0.ebuild 3394
MD5 c870e11d5cfc72f46a1290e769a491cc asterisk-1.0.1.ebuild 5576
-MD5 9af7f719e9db949d2d7870e01cd6faa1 asterisk-1.0.3.ebuild 5845
+MD5 465f444622b40abb34bbb311b571ed24 asterisk-1.0.2.ebuild 5585
MD5 0a9506b97103f05fdd15df48db9b3506 asterisk-1.0.3-r1.ebuild 5865
+MD5 9af7f719e9db949d2d7870e01cd6faa1 asterisk-1.0.3.ebuild 5845
+MD5 867bae5d74f56337feec21310c14ecca asterisk-1.0.5-r1.ebuild 7170
MD5 c7b911a01a3bd822055a9ec010dfbae1 asterisk-1.0.5.ebuild 6314
-MD5 6201814863e121c6cae9a8209b0b9a27 asterisk-1.0.0.ebuild 3394
-MD5 7640d43346ce6dbb9f07236b60c5630f ChangeLog 8489
MD5 44cf247f04cc83413fcb40ed59d0847a metadata.xml 248
-MD5 b551ce4bb8eb4a03cb0e551c279ab02c asterisk-0.9.0.ebuild 3161
+MD5 1f0cf9681436a84a7be9a324e8375ef3 asterisk-1.0.6.ebuild 8622
+MD5 ff5a5be2f2ba9554d1757b150d63b4a1 asterisk-1.0.7.ebuild 9723
+MD5 8d2efae32c44d33c70c3448180e8c15e asterisk-1.0.7-r1.ebuild 11853
MD5 0243bdde80a5b8433cf93c306458dfd8 files/digest-asterisk-0.9.0 67
MD5 1bb1cf45f134eeae6adcc7dc17b6b5db files/digest-asterisk-1.0.0 141
MD5 b97c969a083704e6f8c8c9b07d56db3b files/digest-asterisk-1.0.1 213
MD5 5474694f8ec88752718f88d84e587468 files/digest-asterisk-1.0.2 213
MD5 4fa7ca8f47238dee3484dae5fb8f294c files/digest-asterisk-1.0.3 213
+MD5 4fa7ca8f47238dee3484dae5fb8f294c files/digest-asterisk-1.0.3-r1 213
MD5 08f910cf85384f1d08c01a439cb3634e files/digest-asterisk-1.0.5 213
+MD5 bfa11ecbbe1f5f9ecc73e121855fcf48 files/digest-asterisk-1.0.5-r1 213
MD5 f399592939cd5b43b7851e20744a108e files/digest-asterisk-1.0.6 210
MD5 d7a0d59fff2e991e7b091341893ec554 files/digest-asterisk-1.0.7 210
-MD5 4fa7ca8f47238dee3484dae5fb8f294c files/digest-asterisk-1.0.3-r1 213
-MD5 bfa11ecbbe1f5f9ecc73e121855fcf48 files/digest-asterisk-1.0.5-r1 213
+MD5 398bd79a853afb7d0c82f85961ec3a4f files/digest-asterisk-1.0.7-r1 210
MD5 5b7ebf09c4c7988bd16cadaaad08d8f6 files/0.9.0/asterisk.confd 290
MD5 da4846c3843d6f94b278c687d3b2ad21 files/0.9.0/asterisk.rc6 465
-MD5 ab552fbbe803766b5291d61942dbcd9f files/1.0.0/res_perl-1.0.7-bristuff-0.2.0.diff 860
-MD5 93d2e0533a32a38e21f99f278f635266 files/1.0.0/asterisk-1.0.5-speex.diff 1214
-MD5 f20e5b869d5e221194187dd7f504d38b files/1.0.0/asterisk-1.0.5-astcfg-0.0.2.diff 5829
+MD5 edf12407ea851d46ced85276149aedf1 files/1.0.0/asterisk.rc6.sec 760
MD5 f0fe0308b464c71f83cf2483388c8058 files/1.0.0/asterisk-1.0.1-linux26.diff 474
-MD5 85e291d6eb70a24fdc82469ed53bfe54 files/1.0.0/asterisk.confd 283
+MD5 f20e5b869d5e221194187dd7f504d38b files/1.0.0/asterisk-1.0.5-astcfg-0.0.2.diff 5829
MD5 a839d8b6b55e3b6ad17b9a7f4be2e6ba files/1.0.0/asterisk-1.0.5-hppa.patch 909
-MD5 920f8ae54f895cfa46a8a037c865e59a files/1.0.0/asterisk.rc6 517
-MD5 6a50db2ee46d4139128d0c4225ac071f files/1.0.0/asterisk-uclibc-dns.diff 433
+MD5 93d2e0533a32a38e21f99f278f635266 files/1.0.0/asterisk-1.0.5-speex.diff 1214
MD5 08d718c04e911f465f867577d649d204 files/1.0.0/asterisk-1.0.5-uclibc-dns.diff 304
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.1 (GNU/Linux)
-
-iD8DBQFCekFLI1lqEGTUzyQRAlBYAKDL7WYYBVO4AWavPzLBIvPJpVVgUgCeJ62E
-uaiATki1zZ639Gd3EJG+L14=
-=uG6h
------END PGP SIGNATURE-----
+MD5 6a50db2ee46d4139128d0c4225ac071f files/1.0.0/asterisk-uclibc-dns.diff 433
+MD5 85e291d6eb70a24fdc82469ed53bfe54 files/1.0.0/asterisk.confd 283
+MD5 920f8ae54f895cfa46a8a037c865e59a files/1.0.0/asterisk.rc6 517
+MD5 ab552fbbe803766b5291d61942dbcd9f files/1.0.0/res_perl-1.0.7-bristuff-0.2.0.diff 860
+MD5 266ffa04819c5fa35b157b23d29a8ca2 files/1.0.0/asterisk.confd.sec 762
diff --git a/net-misc/asterisk/asterisk-1.0.7-r1.ebuild b/net-misc/asterisk/asterisk-1.0.7-r1.ebuild
new file mode 100644
index 000000000000..ee5145b450fd
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.0.7-r1.ebuild
@@ -0,0 +1,423 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.7-r1.ebuild,v 1.1 2005/05/07 18:35:35 stkn Exp $
+
+IUSE="alsa doc gtk mmx mysql pri zaptel uclibc debug postgres vmdbmysql vmdbpostgres bri hardened speex resperl"
+
+inherit eutils perl-module
+
+ADDONS_VERSION="1.0.7"
+BRI_VERSION="0.2.0-RC8a"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="ftp://ftp.asterisk.org/pub/telephony/${PN}/${P}.tar.gz
+ ftp://ftp.asterisk.org/pub/telephony/${PN}/${PN}-addons-${ADDONS_VERSION}.tar.gz
+ bri? ( http://www.junghanns.net/${PN}/downloads/bristuff-${BRI_VERSION}.tar.gz )"
+
+S=${WORKDIR}/${P}
+S_ADDONS=${WORKDIR}/${PN}-addons-${ADDONS_VERSION}
+
+SLOT="0"
+LICENSE="GPL-2"
+#KEYWORDS="~x86 ~sparc ~hppa ~amd64"
+KEYWORDS="-*"
+
+DEPEND="dev-libs/newt
+ media-sound/mpg123
+ media-sound/sox
+ doc? ( app-doc/doxygen )
+ gtk? ( =x11-libs/gtk+-1.2* )
+ pri? ( >=net-libs/libpri-1.0.7-r1 )
+ bri? ( >=net-libs/libpri-1.0.7-r1
+ >=net-misc/zaptel-1.0.7-r1 )
+ alsa? ( media-libs/alsa-lib )
+ mysql? ( dev-db/mysql )
+ speex? ( media-libs/speex )
+ uclibc? ( sys-libs/uclibc )
+ zaptel? ( >=net-misc/zaptel-1.0.7-r1 )
+ postgres? ( dev-db/postgresql )
+ vmdbmysql? ( dev-db/mysql )
+ vmdbpostgres? ( dev-db/postgresql )
+ resperl? ( dev-lang/perl
+ >=net-misc/zaptel-1.0.7-r1 )"
+
+pkg_setup() {
+ einfo "Running some pre-flight checks..."
+ if use resperl; then
+ # res_perl pre-flight check...
+ if ! $(perl -V | grep -q "usemultiplicity=define") ||\
+ ! built_with_use perl ithreads || ! built_with_use libperl ithreads
+ then
+ eerror "Embedded perl add-on needs Perl and libperl with built-in threads support"
+ eerror "(rebuild perl and libperl with ithreads use-flag enabled)"
+ die "Perl w/o threads support..."
+ fi
+ einfo "Perl with ithreads support found"
+ fi
+
+
+ # mysql and postgres voicemail support are mutually exclusive..
+ if use vmdbmysql && use vmdbpostgres; then
+ eerror "MySQL and PostgreSQL Voicemail support are mutually exclusive... choose one!"
+ die "Conflicting use-flags"
+ fi
+
+ # check if zaptel and libpri have been built with bri enabled
+ if use bri; then
+ if ! built_with_use zaptel bri; then
+ eerror "Re-emerge zaptel with bri use-flag enabled!"
+ die "Zaptel without bri support detected"
+ fi
+
+ if ! built_with_use libpri bri; then
+ eerror "Re-emerge libpri with bri use-flag enabled!"
+ die "Libpri without bri support detected"
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ # set cflags & mmx optimization
+ sed -i -e "s:^\(OPTIMIZE+=\).*:\1 ${CFLAGS}:" \
+ -e "s:^\(CFLAGS+=\$(shell if \$(CC)\):#\1:" \
+ Makefile
+
+ # gsm codec still uses -fomit-frame-pointer, and other codecs have their
+ # own flags. We only change the arch.
+ sed -i -e "s:^OPTIMIZE+=.*:OPTIMIZE=${CFLAGS}:" \
+ -e "s:^CFLAGS[\t ]\++=:CFLAGS =:" \
+ codecs/gsm/Makefile
+
+ # hppa patch for gsm codec
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-hppa.patch
+
+ if use mmx; then
+ if ! use hardened; then
+ einfo "Enabling mmx optimization"
+ sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
+ codecs/gsm/Makefile
+ else
+ ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
+
+ fi
+ fi
+ if ! use mmx || use hardened; then
+ # don't build + link asm mmx object file
+ # without this codec_gsm.so will include text relocations
+ sed -i -e "/k6opt\.\(s\|o\)/ d" \
+ codecs/gsm/Makefile
+ fi
+
+ if ! use debug; then
+ einfo "Disabling debugging"
+ sed -i -e "s:^\(DEBUG=\):#\1:" Makefile
+ fi
+
+ # change image path in voicemail cgi
+ sed -i -e "s:^\(\$astpath = \).*:\1 \"/asterisk\";:" contrib/scripts/vmail.cgi
+
+ #
+ # embedded perl
+ #
+ if use resperl; then
+ einfo "Patching asterisk for embedded perl support..."
+ epatch ${S_ADDONS}/res_perl/astmake.diff
+
+ # create necessary .c file
+ /usr/bin/perl -MExtUtils::Embed -e xsinit || die "Could not create perlxsi.c"
+
+ cd ${S_ADDONS}
+
+ # fix perl path, source location and remove res_musiconhold
+ sed -i -e "s:/usr/local/bin/perl:/usr/bin/perl:" \
+ res_perl/Makefile \
+ ${S}/Makefile \
+ res_perl/INC/*.pm
+ sed -i -e "s:^ASTSRC.*:ASTSRC = ${S}:" \
+ -e "s:\$(ASTLIBDIR)/modules/res_musiconhold.so::" \
+ res_perl/Makefile
+
+ if use bri; then
+ epatch ${FILESDIR}/1.0.0/res_perl-1.0.7-bristuff-0.2.0.diff
+ fi
+
+ cd ${S}
+ fi
+
+ #
+ # uclibc patch
+ #
+ if use uclibc; then
+ einfo "Patching asterisk for uclibc..."
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
+ fi
+
+ #
+ # other patches
+ #
+
+ # asterisk-config
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-astcfg-0.0.2.diff
+
+ #
+ # database voicemail support
+ #
+ if use postgres; then
+ sed -i -e "s:^#\(APPS+=app_sql_postgres.so\):\1:" \
+ -e "s:/usr/local/pgsql/include:/usr/include/postgresql/pgsql:" \
+ -e "s:/usr/local/pgsql/lib:/usr/lib/postgresql:" \
+ apps/Makefile
+ fi
+
+ if use vmdbpostgres; then
+ einfo "Enabling PostgreSQL voicemail support"
+ sed -i -e "s:^\(USE_POSTGRES_VM_INTERFACE\).*:\1=1:" \
+ -e "s:/usr/local/pgsql/include:/usr/include/postgresql/pgsql:" \
+ -e "s:/usr/local/pgsql/lib:/usr/lib/postgresql:" \
+ apps/Makefile
+
+ # patch app_voicemail.c
+ sed -i -e "s:^#include <postgresql/libpq-fe\.h>:#include \"libpq-fe\.h\":" \
+ apps/app_voicemail.c
+
+ elif use vmdbmysql; then
+ einfo "Enabling MySQL voicemail support"
+ sed -i -e "s:^\(USE_MYSQL_VM_INTERFACE\).*:\1=1:" \
+ -e "s:^\(CFLAGS+=-DUSEMYSQLVM\):\1 -I${S_ADDONS}:" \
+ apps/Makefile
+ fi
+
+ #
+ # asterisk add-ons
+ #
+ cd ${S_ADDONS}
+ sed -i -e "s:-I../asterisk:-I${S} -I${S}/include:" Makefile
+ sed -i -e "s:^OPTIMIZE+=.*:OPTIMIZE+=${CFLAGS}:" \
+ -e "s:^\(CFLAGS=\)\(.*\):\1-I${S}/include -fPIC \2:" \
+ format_mp3/Makefile
+
+
+ #
+ # BRI patches
+ #
+ if use bri; then
+ cd ${S}
+ einfo "Patching asterisk w/ BRI stuff"
+
+ # fix patch for new asterisk version...
+ # and fix a watchdog bug
+ sed -i -e "s:^\([+-]\)1.0.6:\1${PV}:" \
+ -e "s:woof->fd, \"+\", 1);:woof->fd, \"PING\\\\n\", 1);:" \
+ ${WORKDIR}/bristuff-${BRI_VERSION}/patches/asterisk.patch
+
+ epatch ${WORKDIR}/bristuff-${BRI_VERSION}/patches/asterisk.patch
+ fi
+
+ #
+ # Revived snmp plugin support
+ #
+# if use snmp; then
+# cd ${S}
+# einfo "Patching snmp plugin helper functions"
+# epatch ${FILESDIR}/1.0.0/ast-ax-snmp-1.0.6.diff
+# fi
+
+ # fix path for non-root
+ cd ${S}
+ sed -i -e "s:^\(ASTVARRUNDIR=\).*:\1\$(INSTALL_PREFIX)/var/run/asterisk:" \
+ Makefile
+}
+
+src_compile() {
+ # build asterisk first...
+ einfo "Building Asterisk..."
+ cd ${S}
+ emake -j1 || die "Make failed"
+
+ # create api docs
+ use doc && \
+ emake -j1 progdocs
+
+ #
+ # add-ons
+ #
+ einfo "Building additional stuff..."
+ cd ${S_ADDONS}
+ emake -j1 || die "Make failed"
+
+ if use resperl; then
+ cd ${S_ADDONS}/res_perl
+ emake -j1 || die "Building embedded perl failed"
+ fi
+}
+
+src_install() {
+ emake -j1 DESTDIR=${D} install || die "Make install failed"
+ emake -j1 DESTDIR=${D} samples || die "Make install samples failed"
+
+ # install addmailbox and astgenkey
+ dosbin contrib/scripts/addmailbox
+ dosbin contrib/scripts/astgenkey
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
+
+ insinto /etc/conf.d
+ newins ${FILESDIR}/1.0.0/asterisk.confd.sec asterisk
+
+ # don't delete these, even if they are empty
+ keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
+ keepdir /var/spool/asterisk/tmp
+ keepdir /var/log/asterisk/cdr-csv
+
+ # install standard docs...
+ dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm
+ dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README
+ dodoc doc/README.*
+ dodoc doc/*.txt
+
+ docinto scripts
+ dodoc contrib/scripts/*
+ docinto firmware/iax
+ dodoc contrib/firmware/iax/*
+
+ # install api docs
+ if use doc; then
+ insinto /usr/share/doc/${PF}/api/html
+ doins doc/api/html/*
+ fi
+
+ insinto /usr/share/doc/${PF}/cgi
+ doins contrib/scripts/vmail.cgi
+ for i in "images/*.gif"; do
+ doins $i
+ done
+
+ #
+ # add-ons
+ #
+
+ # install additional modules...
+ einfo "Installing additional modules..."
+ cd ${S_ADDONS}
+ emake -j1 INSTALL_PREFIX=${D} install || die "Make install failed"
+
+ if use resperl; then
+ perlinfo
+
+ cd ${S_ADDONS}/res_perl
+ emake -j1 INSTALL_PREFIX=${D} install || die "Installation of perl AST_API failed"
+
+ # move AstApiBase.so to a proper place
+ dodir ${VENDOR_LIB}/auto/AstAPIBase
+ mv ${D}/etc/asterisk/perl/AstAPIBase.so ${D}${VENDOR_LIB}/auto/AstAPIBase
+
+ # move *.pm files to other location
+ dodir ${VENDOR_LIB}/AstAPI
+ dodir ${VENDOR_LIB}/AstAPIBase
+ for x in AstAPI.pm AstConfig.pm LoadFile.pm PerlSwitch.pm WebServer.pm; do
+ mv ${D}/etc/asterisk/perl/${x} ${D}${VENDOR_LIB}/AstAPI
+ dosed "s/^use[\t ]\+${x/.pm/};/use AstAPI::${x/.pm/};/" /etc/asterisk/perl/asterisk_init.pm
+ done
+ mv ${D}/etc/asterisk/perl/AstAPIBase.pm ${D}${VENDOR_LIB}/AstAPIBase
+ dosed "s/^use[\t ]\+AstAPI;/use AstAPI::AstAPI;/" /etc/asterisk/perl/asterisk_init.pm
+ dosed "s/^use[\t ]\+AstAPIBase;/use AstAPIBase::AstAPIBase;/" ${VENDOR_LIB}/AstAPI/AstAPI.pm
+
+ # move apps + htdocs to a proper place
+ dodir /var/lib/asterisk/perl
+ mv ${D}/etc/asterisk/perl/{apps,htdocs} ${D}/var/lib/asterisk/perl
+
+ # fix locations
+ sed -i -e "s:/etc/asterisk/perl:/var/lib/asterisk/perl:" \
+ ${D}${VENDOR_LIB}/AstAPI/LoadFile.pm ${D}${VENDOR_LIB}/AstAPI/WebServer.pm
+ fi
+
+ # add asterisk user
+ enewgroup asterisk
+ enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk
+
+ # fix permissions
+ for x in spool run lib log; do
+ chown -R asterisk:asterisk ${D}/var/${x}/asterisk
+ chmod -R u=rwX,g=rX,o= ${D}/var/${x}/asterisk
+ done
+
+ chown -R root:asterisk ${D}/etc/asterisk
+ chmod -R u=rwX,g=rX,o= ${D}/etc/asterisk
+}
+
+pkg_postinst() {
+ einfo "Asterisk has been installed"
+ einfo ""
+ einfo "to add new Mailboxes use: /usr/sbin/addmailbox"
+ einfo ""
+ einfo "If you want to know more about asterisk, visit these sites:"
+ einfo "http://www.asteriskdocs.org/"
+ einfo "http://www.voip-info.org/wiki-Asterisk"
+ echo
+ einfo "http://asterisk.xvoip.com/"
+ einfo "http://junghanns.net/asterisk/"
+ einfo "http://www.automated.it/guidetoasterisk.htm"
+ echo
+ einfo "Gentoo VoIP IRC Channel:"
+ einfo "#gentoo-voip @ irc.freenode.net"
+ echo
+ ewarn "Additional sounds have been split-out into"
+ ewarn "net-misc/asterisk-sounds"
+}
+
+pkg_config() {
+ einfo "Bla... [y/N]"
+
+ read x
+
+ if [[ "$x" = "y" ]] || [[ "$x" = "Y" ]]; then
+ if [[ ! -d ${ROOT}/var/run/asterisk ]]; then
+ mkdir -p ${ROOT}/var/run/asterisk
+ fi
+ if [[ -z "$(egetent passwd asterisk)" ]]; then
+ einfo "Adding asterisk user and group"
+ enewgroup asterisk
+ enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk
+ fi
+
+ einfo "Fixing permissions and ownerships"
+ # fix permissions
+ for x in spool run lib log; do
+ chown -R asterisk:asterisk ${ROOT}/var/${x}/asterisk
+ chmod -R u=rwX,g=rX,o= ${ROOT}/var/${x}/asterisk
+ done
+
+ chown -R root:asterisk ${ROOT}/etc/asterisk
+ chmod -R u=rwX,g=rX,o= ${ROOT}/etc/asterisk
+
+ if [[ -z "$(grep "/var/run/asterisk" ${ROOT}/etc/asterisk/asterisk.conf)" ]]
+ then
+ einfo "Fixing astrundir in ${ROOT}/etc/asterisk/asterisk.conf"
+ mv -f ${ROOT}/etc/asterisk/asterisk.conf \
+ ${ROOT}/etc/asterisk/asterisk.conf.bak
+ sed -e "s:^\(astrundir[\t ]=>\).*:\1 /var/run/asterisk:" \
+ ${ROOT}/etc/asterisk/asterisk.conf.bak >\
+ ${ROOT}/etc/asterisk/asterisk.conf
+ einfo "Backup has been saved as ${ROOT}/etc/asterisk/asterisk.conf.bak"
+ fi
+
+ if [[ -f ${ROOT}/usr/bin/asterisk-config ]] && \
+ [[ -z "$(grep "/var/run/asterisk" ${ROOT}/usr/bin/asterisk-config)" ]]
+ then
+ einfo "Fixing ASTVARRUNDIR in ${ROOT}/usr/bin/asterisk-config"
+ mv -f ${ROOT}/usr/bin/asterisk-config \
+ ${ROOT}/usr/bin/asterisk-config.bak
+ sed -e "s:/var/run:/var/run/asterisk:" \
+ ${ROOT}/usr/bin/asterisk-config.bak >\
+ ${ROOT}/usr/bin/asterisk-config
+ einfo "Backup has been saved as ${ROOT}/usr/bin/asterisk-config.bak"
+ fi
+ else
+ einfo "Aborted"
+ fi
+}
diff --git a/net-misc/asterisk/files/1.0.0/asterisk.confd.sec b/net-misc/asterisk/files/1.0.0/asterisk.confd.sec
new file mode 100644
index 000000000000..7fc2a3413b85
--- /dev/null
+++ b/net-misc/asterisk/files/1.0.0/asterisk.confd.sec
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.0.0/asterisk.confd.sec,v 1.1 2005/05/07 18:35:35 stkn Exp $
+
+depend() {
+ need net logger
+ after zaptel
+}
+
+start() {
+ if [[ -n "${ASTERISK_USER}" ]]; then
+ ebegin "Starting asterisk PBX (as ${ASTERISK_USER})"
+ start-stop-daemon --start --exec /usr/sbin/asterisk \
+ --chuid ${ASTERISK_USER} -- ${ASTERISK_OPTS}
+ else
+ ebegin "Starting asterisk PBX (as root)"
+ start-stop-daemon --start --exec /usr/sbin/asterisk -- \
+ ${ASTERISK_OPTS}
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping asterisk PBX"
+ start-stop-daemon --stop --pidfile /var/run/asterisk/asterisk.pid
+ eend $?
+}
diff --git a/net-misc/asterisk/files/1.0.0/asterisk.rc6.sec b/net-misc/asterisk/files/1.0.0/asterisk.rc6.sec
new file mode 100644
index 000000000000..6ab451443ac9
--- /dev/null
+++ b/net-misc/asterisk/files/1.0.0/asterisk.rc6.sec
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.0.0/asterisk.rc6.sec,v 1.1 2005/05/07 18:35:35 stkn Exp $
+
+depend() {
+ need net logger
+ after zaptel
+}
+
+start() {
+ if [[ -n "${ASTERISK_USER}" ]]; then
+ ebegin "Starting asterisk PBX (as ${ASTERISK_USER})"
+ start-stop-daemon --start --exec /usr/sbin/asterisk \
+ --chuid ${ASTERISK_USER} -- ${ASTERISK_OPTS}
+ else
+ ebegin "Starting asterisk PBX (as root)"
+ start-stop-daemon --start --exec /usr/sbin/asterisk -- \
+ ${ASTERISK_OPTS}
+ fi
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping asterisk PBX"
+ start-stop-daemon --stop --pidfile /var/run/asterisk/asterisk.pid
+ eend $?
+}
diff --git a/net-misc/asterisk/files/digest-asterisk-1.0.7-r1 b/net-misc/asterisk/files/digest-asterisk-1.0.7-r1
new file mode 100644
index 000000000000..ac1f0a860719
--- /dev/null
+++ b/net-misc/asterisk/files/digest-asterisk-1.0.7-r1
@@ -0,0 +1,3 @@
+MD5 4cc3c1e4a1b12e0e4c748326ad153291 asterisk-1.0.7.tar.gz 9591705
+MD5 e2a94a7c2e97de18b3cdc4dd42709c11 asterisk-addons-1.0.7.tar.gz 73646
+MD5 8029d465ffc1ae8fb076a6b7198da03c bristuff-0.2.0-RC8a.tar.gz 133171