summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Knoblich <stkn@gentoo.org>2006-04-24 17:25:02 +0000
committerStefan Knoblich <stkn@gentoo.org>2006-04-24 17:25:02 +0000
commitcff8a2e0e11e775645bb23aa5e7b91b4a2eb84bf (patch)
treed08171575780e21cf5099cfe7de305812607609d /net-misc
parentMarked stable on mips. (diff)
downloadhistorical-cff8a2e0e11e775645bb23aa5e7b91b4a2eb84bf.tar.gz
historical-cff8a2e0e11e775645bb23aa5e7b91b4a2eb84bf.tar.bz2
historical-cff8a2e0e11e775645bb23aa5e7b91b4a2eb84bf.zip
Security revision bump; asterisk-1.0.x: add fix for CVS-2006-1827: Integer sigendness error in format-jpeg.c (bug #131096); dropping affected asterisk-1.2.x ebuilds.
Package-Manager: portage-2.0.54
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/asterisk/ChangeLog16
-rw-r--r--net-misc/asterisk/Manifest17
-rw-r--r--net-misc/asterisk/asterisk-1.0.10-r2.ebuild505
-rw-r--r--net-misc/asterisk/asterisk-1.0.7-r4.ebuild472
-rw-r--r--net-misc/asterisk/asterisk-1.0.8-r3.ebuild476
-rw-r--r--net-misc/asterisk/asterisk-1.0.9-r4.ebuild478
-rw-r--r--net-misc/asterisk/asterisk-1.2.0.ebuild352
-rw-r--r--net-misc/asterisk/asterisk-1.2.1.ebuild380
-rw-r--r--net-misc/asterisk/asterisk-1.2.4.ebuild385
-rw-r--r--net-misc/asterisk/files/1.0.0/asterisk-1.0-CVE-2006-1827.patch13
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.0.10-r23
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.0.7-r49
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.0.8-r39
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.0.9-r49
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.2.03
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.2.14
-rw-r--r--net-misc/asterisk/files/digest-asterisk-1.2.44
17 files changed, 1999 insertions, 1136 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog
index 30ca7c800bf8..e807c3010993 100644
--- a/net-misc/asterisk/ChangeLog
+++ b/net-misc/asterisk/ChangeLog
@@ -1,6 +1,20 @@
# ChangeLog for net-misc/asterisk
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.110 2006/04/17 00:43:54 stkn Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.111 2006/04/24 17:25:02 stkn Exp $
+
+*asterisk-1.0.10-r2 (24 Apr 2006)
+*asterisk-1.0.9-r4 (24 Apr 2006)
+*asterisk-1.0.8-r3 (24 Apr 2006)
+*asterisk-1.0.7-r4 (24 Apr 2006)
+
+ 24 Apr 2006; Stefan Knoblich <stkn@gentoo.org>
+ +files/1.0.0/asterisk-1.0-CVE-2006-1827.patch, +asterisk-1.0.7-r4.ebuild,
+ +asterisk-1.0.8-r3.ebuild, +asterisk-1.0.9-r4.ebuild,
+ +asterisk-1.0.10-r2.ebuild, -asterisk-1.2.0.ebuild,
+ -asterisk-1.2.1.ebuild, -asterisk-1.2.4.ebuild:
+ Security revision bump; asterisk-1.0.x: add fix for CVS-2006-1827: Integer
+ sigendness error in format-jpeg.c (bug #131096); dropping affected
+ asterisk-1.2.x ebuilds.
17 Apr 2006; Stefan Knoblich <stkn@gentoo.org>
files/1.2.0/asterisk-updater:
diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
index 3e5f0d912e84..f8fd9c7f5620 100644
--- a/net-misc/asterisk/Manifest
+++ b/net-misc/asterisk/Manifest
@@ -1,14 +1,16 @@
-MD5 b1a29d0752946ecb8bc101b2d7b84336 ChangeLog 22354
+MD5 7bab10927cb8fa6b4d2a8d517e2296fd ChangeLog 22946
MD5 5331ab3504762b397113ab2996b7ba61 asterisk-1.0.10-r1.ebuild 14665
+MD5 7f0d81ce552fabb7ef00abbc13b38e29 asterisk-1.0.10-r2.ebuild 14787
MD5 5a641e52c52eded4766e31c8520fe83b asterisk-1.0.7-r2.ebuild 13672
MD5 f47f423dec3c8c0aaca9c4f117a8c5fc asterisk-1.0.7-r3.ebuild 13676
+MD5 d9f95903ad4e6d09a13349e5e0df61c4 asterisk-1.0.7-r4.ebuild 13800
MD5 dab2abf3ef2e4b6f44e833df1ecb0f77 asterisk-1.0.8-r1.ebuild 13808
MD5 3ffe465ae17b176a5324ed45ce59e70a asterisk-1.0.8-r2.ebuild 13815
+MD5 5953e9ae2ec79aa41752aee9d2d75d59 asterisk-1.0.8-r3.ebuild 13938
MD5 d334b99433aa96e3eaf99bc98bc073e8 asterisk-1.0.9-r3.ebuild 13841
-MD5 ccf3f74b0df577c747f8f1c51846f3e2 asterisk-1.2.0.ebuild 8468
-MD5 725495d05db613d568e01624e2bc9736 asterisk-1.2.1.ebuild 9907
-MD5 84defab07755ef90b4693969d1028e24 asterisk-1.2.4.ebuild 10133
+MD5 9a4b789a2035ac22e1af8d08f602e386 asterisk-1.0.9-r4.ebuild 13965
MD5 09d2b6905923ef8beadadb6fc592d62c asterisk-1.2.7_p1.ebuild 13073
+MD5 6e50e3012b488f05338d1ce3694f3082 files/1.0.0/asterisk-1.0-CVE-2006-1827.patch 422
MD5 88e8cfc364e9767f104159b374eb5bea files/1.0.0/asterisk-1.0.10-misdn.patch 607
MD5 e53fcb073e317364213099fe6a00b7b9 files/1.0.0/asterisk-1.0.10-vmail.cgi.patch 9038
MD5 27bf961621fb1f521bc11293df8b5ec9 files/1.0.0/asterisk-1.0.10-weak-references.diff 8579
@@ -39,13 +41,14 @@ MD5 b3b1dced30f74b9475ca7d3a8155385d files/1.2.0/asterisk-updater 3127
MD5 1c243de2cb0b294af772955e7244dbc4 files/1.2.0/asterisk.confd 2200
MD5 f1da7c89617ab1b859b6b87d69f729fc files/1.2.0/asterisk.rc6 5569
MD5 03fb8c17f721175835810032aac80b05 files/digest-asterisk-1.0.10-r1 211
+MD5 03fb8c17f721175835810032aac80b05 files/digest-asterisk-1.0.10-r2 211
MD5 48a3518349e2abfe20fa918a9db5eea2 files/digest-asterisk-1.0.7-r2 210
MD5 225681e768dff47ab88ef2cec2e4bac8 files/digest-asterisk-1.0.7-r3 768
+MD5 225681e768dff47ab88ef2cec2e4bac8 files/digest-asterisk-1.0.7-r4 768
MD5 b3bbedde09faea609a0357b21eafa596 files/digest-asterisk-1.0.8-r1 210
MD5 c3c4ac188c4448a2f681a43f882d50b2 files/digest-asterisk-1.0.8-r2 768
+MD5 c3c4ac188c4448a2f681a43f882d50b2 files/digest-asterisk-1.0.8-r3 768
MD5 e9e9701fad77824bcfdff1f02b9634e3 files/digest-asterisk-1.0.9-r3 768
-MD5 3ac809fbfcd67ea051e13063301d75ca files/digest-asterisk-1.2.0 217
-MD5 1a549af9a9ecd54cb74afbbe7bde9cb3 files/digest-asterisk-1.2.1 306
-MD5 f69ef36e0e37920142654d01e205cf28 files/digest-asterisk-1.2.4 306
+MD5 e9e9701fad77824bcfdff1f02b9634e3 files/digest-asterisk-1.0.9-r4 768
MD5 03e2e55422979c602afee0c184679bba files/digest-asterisk-1.2.7_p1 1421
MD5 488aea6fbdb7537394cc049b0ff9e5d5 metadata.xml 384
diff --git a/net-misc/asterisk/asterisk-1.0.10-r2.ebuild b/net-misc/asterisk/asterisk-1.0.10-r2.ebuild
new file mode 100644
index 000000000000..760b4d13a7e8
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.0.10-r2.ebuild
@@ -0,0 +1,505 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.10-r2.ebuild,v 1.1 2006/04/24 17:25:02 stkn Exp $
+
+inherit eutils perl-app
+
+ADDONS_VERSION="1.0.9"
+BRI_VERSION="0.2.0-RC8q"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="http://ftp1.digium.com/pub/telephony/${PN}/old-releases/${P}.tar.gz
+ http://ftp1.digium.com/pub/telephony/${PN}/old-releases/${PN}-addons-${ADDONS_VERSION}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
+
+S_ADDONS=${WORKDIR}/${PN}-addons-${ADDONS_VERSION}
+S_BRI=${WORKDIR}/bristuff-${BRI_VERSION}
+
+IUSE="alsa bri debug doc gtk hardened mmx mysql mysqlfriends postgres pri resperl speex ukcid vmdbmysql vmdbpostgres zaptel"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
+
+DEPEND="dev-libs/newt
+ dev-libs/openssl
+ media-sound/mpg123
+ media-sound/sox
+ doc? ( app-doc/doxygen )
+ gtk? ( =x11-libs/gtk+-1.2* )
+ pri? ( >=net-libs/libpri-1.0.9 )
+ bri? ( >=net-libs/libpri-1.0.9
+ >=net-misc/zaptel-1.0.10 )
+ alsa? ( media-libs/alsa-lib )
+ mysql? ( dev-db/mysql )
+ speex? ( media-libs/speex )
+ zaptel? ( >=net-misc/zaptel-1.0.10 )
+ postgres? ( dev-db/postgresql )
+ vmdbmysql? ( dev-db/mysql )
+ mysqlfriends? ( dev-db/mysql )
+ vmdbpostgres? ( dev-db/postgresql )
+ resperl? ( dev-lang/perl
+ >=net-misc/zaptel-1.0.10 )"
+
+pkg_setup() {
+ local n
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "****************** Important changes warning! *********************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/asterisk"
+ ewarn
+ ewarn "- More information at the end of this emerge"
+ ewarn
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+ ewarn
+ einfo "Press Ctrl+C to abort"
+ echo
+ ebeep
+
+ n=15
+ while [[ $n -gt 0 ]]; do
+ echo -en " Waiting $n seconds...\r"
+ sleep 1
+ (( n-- ))
+ done
+
+ #
+ # Regular checks
+ #
+ 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 dev-lang/perl ithreads || ! built_with_use sys-devel/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 net-misc/zaptel bri; then
+ eerror "Re-emerge zaptel with bri use-flag enabled!"
+ die "Zaptel without bri support detected"
+ fi
+
+ if ! built_with_use net-libs/libpri bri; then
+ eerror "Re-emerge libpri with bri use-flag enabled!"
+ die "Libpri without bri support detected"
+ fi
+ fi
+
+ # check if zaptel has been built with ukcid
+ if use ukcid && ! built_with_use net-misc/zaptel ukcid; then
+ eerror "Re-emerge zaptel with ukcid useflag enabled!"
+ die "Zaptel missing ukcid support"
+ 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
+
+ # hppa patch for gsm codec
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-hppa.patch
+
+ # mark adsi functions as weak references, things will blow
+ # on hardened otherwise (bug #100697 and #85655)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.10-weak-references.diff
+
+ # 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
+
+ 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 elibc_uclibc; then
+ einfo "Patching asterisk for uclibc..."
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
+ fi
+
+ #
+ # other patches
+ #
+
+ # fix lpc10 Makefile, remove the
+ # CFLAGS+=-march=$(shell uname -m) part
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-lpc10flags.diff
+
+ # 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
+
+ #
+ # MySQL friends support
+ #
+ if use mysqlfriends; then
+ einfo "Enabling MySQL friends support for SIP and IAX"
+ sed -i -e "s:^\(USE_MYSQL_FRIENDS\)=.*:\1=1:" \
+ -e "s:^\(USE_SIP_MYSQL_FRIENDS\)=.*:\1=1:" \
+ channels/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"
+
+ # remove after new patch has been released
+ sed -i -e "s:^\([+-]\)1\.0\.9:\11.0.10:" \
+ ${S_BRI}/patches/asterisk.patch
+
+ epatch ${S_BRI}/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
+
+ # fix contrib scripts for non-root
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.7-scripts.diff
+
+ # add initgroups support to asterisk, this is needed
+ # to support supplementary groups for the asterisk
+ # user (start-stop-daemons --chguid breaks realtime priority support)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-initgroups.diff
+
+ # UK callerid patch, adds support for british-telecoms callerid to x100p cards
+ # see http://www.lusyn.com/asterisk/patches.html for more information
+ use ukcid && \
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.9-ukcid.patch
+
+ # needed for >=freetds-0.63
+ if has_version ">=dev-db/freetds-0.63"; then
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.9-freetds.diff
+ fi
+
+ # security fix, bug #111836
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.10-vmail.cgi.patch
+
+ # patch for mISDN
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.10-misdn.patch
+
+ # CVE-2006-1827: integer signedness error in format_jpeg (#131096)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0-CVE-2006-1827.patch
+}
+
+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() {
+ make DESTDIR=${D} install || die "Make install failed"
+ make DESTDIR=${D} samples || die "Make install samples failed"
+
+ # install astconf.h, a lot of external modules need this
+ insinto /usr/include/asterisk
+ doins astconf.h
+
+ # install addmailbox and astgenkey
+ dosbin contrib/scripts/addmailbox
+ dosbin contrib/scripts/astgenkey
+
+ newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
+ newconfd ${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
+ keepdir /var/run/asterisk
+
+ # 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
+ doins images/*.gif
+
+ #
+ # add-ons
+ #
+
+ # install additional modules...
+ einfo "Installing additional modules..."
+ cd ${S_ADDONS}
+ make INSTALL_PREFIX=${D} install || die "Make install failed"
+
+ if use resperl; then
+ perlinfo
+
+ cd ${S_ADDONS}/res_perl
+ make 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
+}
+
+pkg_preinst() {
+ einfo "Adding asterisk user and group"
+ enewgroup asterisk
+ enewuser asterisk -1 -1 /var/lib/asterisk asterisk
+}
+
+pkg_postinst() {
+ #
+ # Change permissions and ownerships of asterisk
+ # directories and files
+ #
+ einfo "Fixing permissions and ownerships"
+ # fix permissions in /var/...
+ 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
+
+ #
+ # Fix locations for old installations (pre-non-root versions)
+ #
+ 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
+
+ #
+ # Some messages
+ #
+ 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"
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "*********************** Important changes **************************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Make sure the asterisk user is a member of the proper groups if you want it"
+ ewarn " to have access to hardware devices, e.g. \"audio\" for Alsa and OSS sound or"
+ ewarn " \"dialout\" for zaptel!"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 / 640"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
+ ewarn
+ ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
+ ewarn " use something like this to make iptables set them for you:"
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
+ ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
+ ewarn
+ ewarn "For more details:"
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+}
diff --git a/net-misc/asterisk/asterisk-1.0.7-r4.ebuild b/net-misc/asterisk/asterisk-1.0.7-r4.ebuild
new file mode 100644
index 000000000000..8ed85947fd12
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.0.7-r4.ebuild
@@ -0,0 +1,472 @@
+# Copyright 1999-2006 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-r4.ebuild,v 1.1 2006/04/24 17:25:02 stkn Exp $
+
+inherit eutils perl-app
+
+ADDONS_VERSION="1.0.7"
+BRI_VERSION="0.2.0-RC8g"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="ftp://ftp.digium.com/pub/telephony/${PN}/old-releases/${P}.tar.gz
+ ftp://ftp.digium.com/pub/telephony/${PN}/old-releases/${PN}-addons-${ADDONS_VERSION}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
+
+S_ADDONS=${WORKDIR}/${PN}-addons-${ADDONS_VERSION}
+
+IUSE="alsa doc gtk mmx mysql pri zaptel debug postgres vmdbmysql vmdbpostgres bri hardened speex resperl"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
+
+DEPEND="dev-libs/newt
+ dev-libs/openssl
+ 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 )
+ 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() {
+ local n
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "****************** Important changes warning! *********************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/asterisk"
+ ewarn
+ ewarn "- More information at the end of this emerge"
+ ewarn
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+ ewarn
+ einfo "Press Ctrl+C to abort"
+ echo
+ ebeep
+
+ n=15
+ while [[ $n -gt 0 ]]; do
+ echo -en " Waiting $n seconds...\r"
+ sleep 1
+ (( n-- ))
+ done
+
+ #
+ # Regular checks
+ #
+ 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 dev-lang/perl ithreads || ! built_with_use sys-devel/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 net-misc/zaptel bri; then
+ eerror "Re-emerge zaptel with bri use-flag enabled!"
+ die "Zaptel without bri support detected"
+ fi
+
+ if ! built_with_use net-libs/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 elibc_uclibc; then
+ einfo "Patching asterisk for uclibc..."
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
+ fi
+
+ #
+ # other patches
+ #
+
+ # fix lpc10 Makefile, remove the
+ # CFLAGS+=-march=$(shell uname -m) part
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-lpc10flags.diff
+
+ # 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"
+
+ 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
+
+ # fix contrib scripts for non-root
+ epatch ${FILESDIR}/1.0.0/${P}-scripts.diff
+
+ # add initgroups support to asterisk, this is needed
+ # to support supplementary groups for the asterisk
+ # user (start-stop-daemons --chguid breaks realtime priority support)
+ epatch ${FILESDIR}/1.0.0/${P}-initgroups.diff
+
+ # security fix (www.portcullis-security.com/advisory/advisory-05-013.txt)
+ epatch ${FILESDIR}/1.0.0/${P}-manager-cli-segv.patch
+
+ # fix segfault on amd64 and possibly other 64bit systems (#105762)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-ptr64fix.diff
+
+ # security fix, bug #111836
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.10-vmail.cgi.patch
+
+ # CVE-2006-1827: integer signedness error in format_jpeg (#131096)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0-CVE-2006-1827.patch
+}
+
+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() {
+ make DESTDIR=${D} install || die "Make install failed"
+ make DESTDIR=${D} samples || die "Make install samples failed"
+
+ # install astconf.h, a lot of external modules need this
+ insinto /usr/include/asterisk
+ doins astconf.h
+
+ # install addmailbox and astgenkey
+ dosbin contrib/scripts/addmailbox
+ dosbin contrib/scripts/astgenkey
+
+ newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
+ newconfd ${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
+ keepdir /var/run/asterisk
+
+ # 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
+ doins images/*.gif
+
+ #
+ # add-ons
+ #
+
+ # install additional modules...
+ einfo "Installing additional modules..."
+ cd ${S_ADDONS}
+ make INSTALL_PREFIX=${D} install || die "Make install failed"
+
+ if use resperl; then
+ perlinfo
+
+ cd ${S_ADDONS}/res_perl
+ make 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
+}
+
+pkg_preinst() {
+ einfo "Adding asterisk user and group"
+ enewgroup asterisk
+ enewuser asterisk -1 -1 /var/lib/asterisk asterisk
+}
+
+pkg_postinst() {
+ #
+ # Change permissions and ownerships of asterisk
+ # directories and files
+ #
+ einfo "Fixing permissions and ownerships"
+ # fix permissions in /var/...
+ 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
+
+ #
+ # Fix locations of old installations (pre-non-root versions)
+ #
+ 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
+
+ #
+ # Some messages
+ #
+ 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"
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "*********************** Important changes **************************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Make sure the asterisk user is a member of the proper groups if you want it"
+ ewarn " to have access to hardware devices, e.g. \"audio\" for Alsa and OSS sound or"
+ ewarn " \"dialout\" for zaptel!"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 / 640"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
+ ewarn
+ ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
+ ewarn " use something like this to make iptables set them for you:"
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
+ ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
+ ewarn
+ ewarn "For more details:"
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+}
diff --git a/net-misc/asterisk/asterisk-1.0.8-r3.ebuild b/net-misc/asterisk/asterisk-1.0.8-r3.ebuild
new file mode 100644
index 000000000000..416ece295a68
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.0.8-r3.ebuild
@@ -0,0 +1,476 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.8-r3.ebuild,v 1.1 2006/04/24 17:25:02 stkn Exp $
+
+inherit eutils perl-app
+
+ADDONS_VERSION="1.0.8"
+BRI_VERSION="0.2.0-RC8h"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="ftp://ftp.digium.com/pub/telephony/${PN}/old-releases/${P}.tar.gz
+ ftp://ftp.digium.com/pub/telephony/${PN}/old-releases/${PN}-addons-${ADDONS_VERSION}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
+
+S_ADDONS=${WORKDIR}/${PN}-addons-${ADDONS_VERSION}
+
+IUSE="alsa doc gtk mmx mysql pri zaptel debug postgres vmdbmysql vmdbpostgres bri hardened speex resperl"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 "
+
+DEPEND="dev-libs/newt
+ dev-libs/openssl
+ media-sound/mpg123
+ media-sound/sox
+ doc? ( app-doc/doxygen )
+ gtk? ( =x11-libs/gtk+-1.2* )
+ pri? ( >=net-libs/libpri-1.0.8 )
+ bri? ( >=net-libs/libpri-1.0.8
+ >=net-misc/zaptel-1.0.8 )
+ alsa? ( media-libs/alsa-lib )
+ mysql? ( dev-db/mysql )
+ speex? ( media-libs/speex )
+ zaptel? ( >=net-misc/zaptel-1.0.8 )
+ postgres? ( dev-db/postgresql )
+ vmdbmysql? ( dev-db/mysql )
+ vmdbpostgres? ( dev-db/postgresql )
+ resperl? ( dev-lang/perl
+ >=net-misc/zaptel-1.0.8 )"
+
+pkg_setup() {
+ local n
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "****************** Important changes warning! *********************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/asterisk"
+ ewarn
+ ewarn "- More information at the end of this emerge"
+ ewarn
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+ ewarn
+ einfo "Press Ctrl+C to abort"
+ echo
+ ebeep
+
+ n=15
+ while [[ $n -gt 0 ]]; do
+ echo -en " Waiting $n seconds...\r"
+ sleep 1
+ (( n-- ))
+ done
+
+ #
+ # Regular checks
+ #
+ 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 dev-lang/perl ithreads || ! built_with_use sys-devel/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 net-misc/zaptel bri; then
+ eerror "Re-emerge zaptel with bri use-flag enabled!"
+ die "Zaptel without bri support detected"
+ fi
+
+ if ! built_with_use net-libs/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
+
+ # hppa patch for gsm codec
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-hppa.patch
+
+ # mark adsi functions as weak references, things will blow
+ # on hardened otherwise (bug #100697 and possibly #85655)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.9-weak-references.diff
+
+ # 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
+
+ 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 elibc_uclibc; then
+ einfo "Patching asterisk for uclibc..."
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
+ fi
+
+ #
+ # other patches
+ #
+
+ # fix lpc10 Makefile, remove the
+ # CFLAGS+=-march=$(shell uname -m) part
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-lpc10flags.diff
+
+ # 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"
+
+ 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
+
+ # fix contrib scripts for non-root
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.7-scripts.diff
+
+ # add initgroups support to asterisk, this is needed
+ # to support supplementary groups for the asterisk
+ # user (start-stop-daemons --chguid breaks realtime priority support)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-initgroups.diff
+
+ # fix callerid matching bug in dialplan
+ epatch ${FILESDIR}/1.0.0/${P}-callerid.patch
+
+ # fix segfault on amd64 and possibly other 64bit systems (#105762)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-ptr64fix.diff
+
+ # security fix, bug #111836
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.10-vmail.cgi.patch
+
+ # CVE-2006-1827: integer signedness error in format_jpeg (#131096)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0-CVE-2006-1827.patch
+}
+
+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() {
+ make DESTDIR=${D} install || die "Make install failed"
+ make DESTDIR=${D} samples || die "Make install samples failed"
+
+ # install astconf.h, a lot of external modules need this
+ insinto /usr/include/asterisk
+ doins astconf.h
+
+ # install addmailbox and astgenkey
+ dosbin contrib/scripts/addmailbox
+ dosbin contrib/scripts/astgenkey
+
+ newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
+ newconfd ${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
+ keepdir /var/run/asterisk
+
+ # 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
+ doins images/*.gif
+
+ #
+ # add-ons
+ #
+
+ # install additional modules...
+ einfo "Installing additional modules..."
+ cd ${S_ADDONS}
+ make INSTALL_PREFIX=${D} install || die "Make install failed"
+
+ if use resperl; then
+ perlinfo
+
+ cd ${S_ADDONS}/res_perl
+ make 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
+}
+
+pkg_preinst() {
+ einfo "Adding asterisk user and group"
+ enewgroup asterisk
+ enewuser asterisk -1 -1 /var/lib/asterisk asterisk
+}
+
+pkg_postinst() {
+ #
+ # Change permissions and ownerships of asterisk
+ # directories and files
+ #
+ einfo "Fixing permissions and ownerships"
+ # fix permissions in /var/...
+ 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
+
+ #
+ # Fix locations for old installations (pre-non-root versions)
+ #
+ 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
+
+ #
+ # Some messages
+ #
+ 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"
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "*********************** Important changes **************************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Make sure the asterisk user is a member of the proper groups if you want it"
+ ewarn " to have access to hardware devices, e.g. \"audio\" for Alsa and OSS sound or"
+ ewarn " \"dialout\" for zaptel!"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 / 640"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
+ ewarn
+ ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
+ ewarn " use something like this to make iptables set them for you:"
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
+ ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
+ ewarn
+ ewarn "For more details:"
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+}
diff --git a/net-misc/asterisk/asterisk-1.0.9-r4.ebuild b/net-misc/asterisk/asterisk-1.0.9-r4.ebuild
new file mode 100644
index 000000000000..4bc3cae17bf8
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.0.9-r4.ebuild
@@ -0,0 +1,478 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.0.9-r4.ebuild,v 1.1 2006/04/24 17:25:02 stkn Exp $
+
+inherit eutils perl-app
+
+ADDONS_VERSION="1.0.9"
+BRI_VERSION="0.2.0-RC8n"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="ftp://ftp.digium.com/pub/telephony/${PN}/old-releases/${P}.tar.gz
+ ftp://ftp.digium.com/pub/telephony/${PN}/old-releases/${PN}-addons-${ADDONS_VERSION}.tar.gz
+ bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
+
+S_ADDONS=${WORKDIR}/${PN}-addons-${ADDONS_VERSION}
+
+IUSE="alsa doc gtk mmx mysql pri zaptel debug postgres vmdbmysql vmdbpostgres bri hardened speex resperl"
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86"
+
+DEPEND="dev-libs/newt
+ dev-libs/openssl
+ media-sound/mpg123
+ media-sound/sox
+ doc? ( app-doc/doxygen )
+ gtk? ( =x11-libs/gtk+-1.2* )
+ pri? ( >=net-libs/libpri-1.0.9 )
+ bri? ( >=net-libs/libpri-1.0.9
+ >=net-misc/zaptel-1.0.9 )
+ alsa? ( media-libs/alsa-lib )
+ mysql? ( dev-db/mysql )
+ speex? ( media-libs/speex )
+ zaptel? ( >=net-misc/zaptel-1.0.9 )
+ postgres? ( dev-db/postgresql )
+ vmdbmysql? ( dev-db/mysql )
+ vmdbpostgres? ( dev-db/postgresql )
+ resperl? ( dev-lang/perl
+ >=net-misc/zaptel-1.0.9 )"
+
+pkg_setup() {
+ local n
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "****************** Important changes warning! *********************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 (directories) / 640 (files)"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/asterisk"
+ ewarn
+ ewarn "- More information at the end of this emerge"
+ ewarn
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+ ewarn
+ einfo "Press Ctrl+C to abort"
+ echo
+ ebeep
+
+ n=15
+ while [[ $n -gt 0 ]]; do
+ echo -en " Waiting $n seconds...\r"
+ sleep 1
+ (( n-- ))
+ done
+
+ #
+ # Regular checks
+ #
+ 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 dev-lang/perl ithreads || ! built_with_use sys-devel/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 net-misc/zaptel bri; then
+ eerror "Re-emerge zaptel with bri use-flag enabled!"
+ die "Zaptel without bri support detected"
+ fi
+
+ if ! built_with_use net-libs/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
+
+ # hppa patch for gsm codec
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-hppa.patch
+
+ # mark adsi functions as weak references, things will blow
+ # on hardened otherwise (bug #100697 and #85655)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.9-weak-references.diff
+
+ # 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
+
+ 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 elibc_uclibc; then
+ einfo "Patching asterisk for uclibc..."
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
+ fi
+
+ #
+ # other patches
+ #
+
+ # fix lpc10 Makefile, remove the
+ # CFLAGS+=-march=$(shell uname -m) part
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-lpc10flags.diff
+
+ # 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"
+
+ 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
+
+ # fix contrib scripts for non-root
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.7-scripts.diff
+
+ # add initgroups support to asterisk, this is needed
+ # to support supplementary groups for the asterisk
+ # user (start-stop-daemons --chguid breaks realtime priority support)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-initgroups.diff
+
+ # fix segfault on amd64 and possibly other 64bit systems (#105762)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.8-ptr64fix.diff
+
+ # needed for >=freetds-0.63
+ if has_version ">=dev-db/freetds-0.63"; then
+ epatch ${FILESDIR}/1.0.0/${P}-freetds.diff
+ fi
+
+ # security fix, bug #111836
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0.10-vmail.cgi.patch
+
+ # CVE-2006-1827: integer signedness error in format_jpeg (#131096)
+ epatch ${FILESDIR}/1.0.0/${PN}-1.0-CVE-2006-1827.patch
+}
+
+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() {
+ make DESTDIR=${D} install || die "Make install failed"
+ make DESTDIR=${D} samples || die "Make install samples failed"
+
+ # install astconf.h, a lot of external modules need this
+ insinto /usr/include/asterisk
+ doins astconf.h
+
+ # install addmailbox and astgenkey
+ dosbin contrib/scripts/addmailbox
+ dosbin contrib/scripts/astgenkey
+
+ newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
+ newconfd ${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
+ keepdir /var/run/asterisk
+
+ # 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
+ doins images/*.gif
+
+ #
+ # add-ons
+ #
+
+ # install additional modules...
+ einfo "Installing additional modules..."
+ cd ${S_ADDONS}
+ make INSTALL_PREFIX=${D} install || die "Make install failed"
+
+ if use resperl; then
+ perlinfo
+
+ cd ${S_ADDONS}/res_perl
+ make 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
+}
+
+pkg_preinst() {
+ einfo "Adding asterisk user and group"
+ enewgroup asterisk
+ enewuser asterisk -1 -1 /var/lib/asterisk asterisk
+}
+
+pkg_postinst() {
+ #
+ # Change permissions and ownerships of asterisk
+ # directories and files
+ #
+ einfo "Fixing permissions and ownerships"
+ # fix permissions in /var/...
+ 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
+
+ #
+ # Fix locations for old installations (pre-non-root versions)
+ #
+ 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
+
+ #
+ # Some messages
+ #
+ 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"
+
+ #
+ # Warning about security changes...
+ #
+ ewarn "*********************** Important changes **************************"
+ ewarn
+ ewarn "- Asterisk runs as user asterisk, group asterisk by default"
+ ewarn
+ ewarn "- Make sure the asterisk user is a member of the proper groups if you want it"
+ ewarn " to have access to hardware devices, e.g. \"audio\" for Alsa and OSS sound or"
+ ewarn " \"dialout\" for zaptel!"
+ ewarn
+ ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
+ ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
+ ewarn
+ ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
+ ewarn " to asterisk:asterisk 750 / 640"
+ ewarn
+ ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
+ ewarn
+ ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
+ ewarn " use something like this to make iptables set them for you:"
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
+ ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
+ ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
+ ewarn
+ ewarn "For more details:"
+ ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
+ ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
+}
diff --git a/net-misc/asterisk/asterisk-1.2.0.ebuild b/net-misc/asterisk/asterisk-1.2.0.ebuild
deleted file mode 100644
index f785021c6e7d..000000000000
--- a/net-misc/asterisk/asterisk-1.2.0.ebuild
+++ /dev/null
@@ -1,352 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.0.ebuild,v 1.4 2006/01/23 15:12:58 stkn Exp $
-
-inherit eutils
-
-IUSE="alsa bri curl debug doc gtk h323 hardened lowmem mmx mysql \
- nosamples odbc postgres pri speex sqlite ssl ukcid zaptel"
-
-BRI_VERSION="0.3.0-PRE-1"
-AST_PATCHES="1.2.0-patches-1.1"
-
-## TODO:
-#
-# - uclibc patch still needed? (still applies)
-# - test nosamples
-# - add some more use flags...
-# recent additions: osp, lowmem, curl, ukcid
-# - cleanup
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="Asterisk: A Modular Open Source PBX System"
-HOMEPAGE="http://www.asterisk.org/"
-SRC_URI="http://ftp.digium.com/pub/asterisk/old-releases/${MY_P}.tar.gz
- http://www.netdomination.org/pub/asterisk/${PN}-${AST_PATCHES}.tar.bz2
- bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
-
-S="${WORKDIR}/${MY_P}"
-
-S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
-
-RDEPEND="dev-libs/newt
- media-sound/sox
- media-sound/mpg123
- ssl? ( dev-libs/openssl )
- gtk? ( =x11-libs/gtk+-1.2* )
- pri? ( >=net-libs/libpri-1.1.0 )
- h323? ( >=dev-libs/pwlib-1.8.3
- >=net-libs/openh323-1.15.0 )
- alsa? ( media-libs/alsa-lib )
- curl? ( net-misc/curl )
- odbc? ( dev-db/unixODBC )
- mysql? ( dev-db/mysql )
- speex? ( media-libs/speex )
- sqlite? ( <dev-db/sqlite-3.0.0 )
- zaptel? ( >=net-misc/zaptel-1.1.0 )
- postgres? ( dev-db/postgresql )
- bri? ( >=net-libs/libpri-1.1.0
- >=net-misc/zaptel-1.1.0 )"
-
-# osp? ( >=net-libs/osptoolkit-3.3.4 )
-
-
-DEPEND="${RDEPEND}
- sys-devel/flex
- sys-devel/bison
- doc? ( app-doc/doxygen )"
-
-pkg_setup() {
- ewarn " Asterisk UPGRADE Warning"
- ewarn ""
- ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz after installation !!!"
- ewarn ""
- ewarn " Asterisk UPGRADE Warning"
- echo
- einfo "Press Ctrl+C to abort"
- echo
- ebeep
-
- n=10
- while [[ $n -gt 0 ]]; do
- echo -en " Waiting $n seconds...\r"
- sleep 1
- (( n-- ))
- done
-
- #
- # Regular checks
- #
- einfo "Running some pre-flight checks..."
-
- # check if zaptel and libpri have been built with bri enabled
- if use bri; then
- if ! built_with_use net-misc/zaptel bri; then
- eerror "Re-emerge zaptel with bri use-flag enabled!"
- die "Zaptel without bri support detected"
- fi
-
- if ! built_with_use net-libs/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}
-
- #
- # gentoo patchset
- #
- for x in $(grep -v "^#\| \+" ${WORKDIR}/patches/patches.list); do
- epatch ${WORKDIR}/patches/${x}
- done
-
- if use mmx; then
- if ! use hardened; then
- einfo "Enabling mmx optimization"
- sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
- Makefile
- else
- ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
- fi
- fi
-
- if ! use debug; then
- einfo "Disabling debug support"
- sed -i -e "s:^\(DEBUG=\):#\1:" \
- Makefile
- fi
-
- if ! use ssl; then
- einfo "Disabling crypto support"
- sed -i -e "s:^#\(NOCRYPTO=yes\):\1:" \
- Makefile
- fi
-
- #
- # uclibc patch
- #
- if use elibc_uclibc; then
- einfo "Patching asterisk for uclibc..."
- epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
- fi
-
- #
- # ukcid patch from http://www.lusyn.com/asterisk/
- #
- if use ukcid; then
- einfo "Patching asterisk for UK Callerid..."
- epatch ${FILESDIR}/1.2.0/${PN}-1.2.0_beta-ukcid.patch
- fi
-
- #
- # BRI patches
- #
- if use bri; then
- einfo "Patching asterisk w/ BRI stuff"
- epatch ${S_BRI}/patches/asterisk.patch
- fi
-}
-
-src_compile() {
- local myopts
-
- use lowmem && \
- myopts="-DLOW_MEMORY"
-
- if use h323; then
- einfo "Building H.323 wrapper lib..."
- make -C channels/h323 \
- NOTRACE=1 \
- PWLIBDIR=/usr/share/pwlib \
- OPENH323DIR=/usr/share/openh323 \
- libchanh323.a Makefile.ast || die "Make h323 failed"
- fi
-
- einfo "Building Asterisk..."
- make \
- NOTRACE=1 \
- OPTIMIZE="${CFLAGS}" \
- PWLIBDIR=/usr/share/pwlib \
- OPENH323DIR=/usr/share/openh323 \
- OPTIONS="${myopts}" || die "Make failed"
-
- # create api docs
- use doc && \
- make progdocs
-
- # build bristuff's ISDNguard
- use bri && \
- make -C ${S_BRI}/ISDNguard
-}
-
-src_install() {
-
- # install asterisk
- make DESTDIR=${D} install || die "Make install failed"
- make DESTDIR=${D} samples || die "Failed to create sample files"
-
- # remove installed sample files if nosamples flag is set
- if use nosamples; then
- einfo "Skipping installation of sample files..."
- einfo "See ${ROOT}usr/share/doc/${PF}/configs for configuration files"
- insinto /usr/share/doc/${PF}/configs
- newins ${D}etc/asterisk/asterisk.conf asterisk.conf.sample
-
- # skip installation of sample configuration files
- # if asterisk-1.1.0 or later is present
- if has_version ">net-misc/asterisk-1.1.0"
- then
- rm -f ${D}etc/asterisk/*
- else
- einfo "No previous or old (<=1.0.x) installation of ${PN} found,"
- einfo "installing sample configuration files!"
- fi
- rm -rf ${D}var/spool/asterisk/voicemail/default
- rm -f ${D}var/lib/asterisk/mohmp3/*
- rm -f ${D}var/lib/asterisk/sounds/demo-*
- rm -f ${D}var/lib/asterisk/agi-bin/*
- else
- einfo "Sample files have been installed"
- keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
- fi
-
- # don't delete these directories, even if they are empty
- for x in voicemail meetme system dictate tmp; do
- keepdir /var/spool/asterisk/${x}
- done
- keepdir /var/lib/asterisk/sounds/priv-callerintros
- keepdir /var/lib/asterisk/mohmp3
- keepdir /var/lib/asterisk/agi-bin
- keepdir /var/log/asterisk/cdr-csv
- keepdir /var/log/asterisk/cdr-custom
- keepdir /var/run/asterisk
-
- # install asterisk.h, a lot of external modules need this
- insinto /usr/include/asterisk
- doins include/asterisk.h
-
- # install astgenkey, astxs, safe_asterisk and manpages
- dobin contrib/scripts/astxs
- dosbin contrib/scripts/astgenkey
- dosbin contrib/scripts/safe_asterisk
- doman contrib/scripts/safe_asterisk.8
- doman contrib/scripts/astgenkey.8
-
- newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
- newconfd ${FILESDIR}/1.0.0/asterisk.confd.sec asterisk
-
- # install standard docs...
- dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm
- dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
- dodoc doc/README.*
- dodoc doc/*.txt
-
- docinto scripts
- dodoc contrib/scripts/*
-
- docinto utils
- dodoc contrib/utils/*
-
- docinto configs
- dodoc configs/*
-
- # install api docs
- if use doc; then
- insinto /usr/share/doc/${PF}/api/html
- doins doc/api/html/*
- fi
-
- # install ISDNguard
- if use bri; then
- cd ${S_BRI}/ISDNguard
- dosbin ISDNguard
-
- docinto ISDNguard
- dodoc INSTALL.ISDNguard
-
- cd ${S}
- fi
-
- insinto /usr/share/doc/${PF}/cgi
- doins contrib/scripts/vmail.cgi
- doins images/*.gif
-}
-
-pkg_preinst() {
- enewgroup asterisk
- enewuser asterisk -1 -1 /var/lib/asterisk asterisk
-}
-
-pkg_postinst() {
- einfo "Fixing 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
- echo
-
- #
- # Announcements, warnings, reminders...
- #
- einfo "Asterisk has been installed"
- 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
- echo
-
- #
- # Warning about security changes...
- #
- ewarn " Asterisk UPGRADE Warning"
- ewarn ""
- ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz before continuing !!!"
- ewarn ""
- ewarn " Asterisk UPGRADE Warning"
-}
-
-pkg_config() {
- einfo "Do you want to reset file permissions and ownerships (y/N)?"
-
- read tmp
- tmp="$(echo $tmp | tr [:upper:] [:lower:])"
-
- if [[ "$tmp" = "y" ]] ||\
- [[ "$tmp" = "yes" ]]
- then
- einfo "Resetting permissions to defaults..."
-
- 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
-
- einfo "done"
- else
- einfo "skipping"
- fi
-}
diff --git a/net-misc/asterisk/asterisk-1.2.1.ebuild b/net-misc/asterisk/asterisk-1.2.1.ebuild
deleted file mode 100644
index 4ee94ded8dca..000000000000
--- a/net-misc/asterisk/asterisk-1.2.1.ebuild
+++ /dev/null
@@ -1,380 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.1.ebuild,v 1.3 2006/01/23 15:12:58 stkn Exp $
-
-inherit eutils
-
-IUSE="alsa bri curl debug doc gtk h323 hardened lowmem mmx mysql \
- nosamples odbc postgres pri speex sqlite ssl ukcid zaptel"
-
-BRI_VERSION="0.3.0-PRE-1c"
-AST_PATCHES="1.2.1-patches-1.0"
-
-## TODO:
-#
-# - uclibc patch still needed? (still applies)
-# - test nosamples
-# - add some more use flags...
-# recent additions: osp, lowmem, curl, ukcid
-# - cleanup
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="Asterisk: A Modular Open Source PBX System"
-HOMEPAGE="http://www.asterisk.org/"
-SRC_URI="http://ftp.digium.com/pub/asterisk/old-releases/${MY_P}.tar.gz
- http://www.netdomination.org/pub/asterisk/${PN}-${AST_PATCHES}.tar.bz2
- bri? ( http://www.netdomination.org/pub/asterisk/asterisk-${PV}-bristuff-${BRI_VERSION}.diff.gz
- http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
-
-RESTRICT="nomirror"
-
-S="${WORKDIR}/${MY_P}"
-
-S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
-
-RDEPEND="dev-libs/newt
- media-sound/sox
- media-sound/mpg123
- ssl? ( dev-libs/openssl )
- gtk? ( =x11-libs/gtk+-1.2* )
- pri? ( >=net-libs/libpri-1.1.0 )
- h323? ( >=dev-libs/pwlib-1.8.3
- >=net-libs/openh323-1.15.0 )
- alsa? ( media-libs/alsa-lib )
- curl? ( net-misc/curl )
- odbc? ( dev-db/unixODBC )
- mysql? ( dev-db/mysql )
- speex? ( media-libs/speex )
- sqlite? ( <dev-db/sqlite-3.0.0 )
- zaptel? ( >=net-misc/zaptel-1.1.0 )
- postgres? ( dev-db/postgresql )
- bri? ( >=net-libs/libpri-1.1.0
- >=net-misc/zaptel-1.1.0 )"
-
-# osp? ( >=net-libs/osptoolkit-3.3.4 )
-
-DEPEND="${RDEPEND}
- sys-devel/flex
- sys-devel/bison
- doc? ( app-doc/doxygen )"
-
-pkg_setup() {
- ewarn " Asterisk UPGRADE Warning"
- ewarn ""
- ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz after installation !!!"
- ewarn ""
- ewarn " Asterisk UPGRADE Warning"
- echo
- einfo "Press Ctrl+C to abort"
- echo
- ebeep
-
- n=10
- while [[ $n -gt 0 ]]; do
- echo -en " Waiting $n seconds...\r"
- sleep 1
- (( n-- ))
- done
-
- #
- # Regular checks
- #
- einfo "Running some pre-flight checks..."
-
- # check if zaptel and libpri have been built with bri enabled
- if use bri; then
- if ! built_with_use net-misc/zaptel bri; then
- eerror "Re-emerge zaptel with bri use-flag enabled!"
- die "Zaptel without bri support detected"
- fi
-
- if ! built_with_use net-libs/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}
-
- #
- # gentoo patchset
- #
- for x in $(grep -v "^#\| \+" ${WORKDIR}/patches/patches.list); do
- epatch ${WORKDIR}/patches/${x}
- done
-
- if use mmx; then
- if ! use hardened; then
- einfo "Enabling mmx optimization"
- sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
- Makefile
- else
- ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
- fi
- fi
-
- if ! use debug; then
- einfo "Disabling debug support"
- sed -i -e "s:^\(DEBUG=\):#\1:" \
- Makefile
- fi
-
- if ! use ssl; then
- einfo "Disabling crypto support"
- sed -i -e "s:^#\(NOCRYPTO=yes\):\1:" \
- Makefile
- fi
-
- #
- # uclibc patch
- #
- if use elibc_uclibc; then
- einfo "Patching asterisk for uclibc..."
- epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
- epatch ${FILESDIR}/1.2.0/${PN}-1.2.1-uclibc-getloadavg.diff
- fi
-
- #
- # ukcid patch from http://www.lusyn.com/asterisk/
- #
- if use ukcid; then
- einfo "Patching asterisk for UK Callerid..."
- epatch ${FILESDIR}/1.2.0/${PN}-1.2.0_beta-ukcid.patch
- fi
-
- #
- # BRI patches
- #
- if use bri; then
- einfo "Patching asterisk w/ BRI stuff"
-# epatch ${S_BRI}/patches/asterisk.patch
- epatch ${WORKDIR}/asterisk-${PV}-bristuff-${BRI_VERSION}.diff
- fi
-}
-
-src_compile() {
- local myopts
-
- use lowmem && \
- myopts="-DLOW_MEMORY"
-
- if use h323; then
- einfo "Building H.323 wrapper lib..."
- make -C channels/h323 \
- NOTRACE=1 \
- PWLIBDIR=/usr/share/pwlib \
- OPENH323DIR=/usr/share/openh323 \
- libchanh323.a Makefile.ast || die "Make h323 failed"
- fi
-
- einfo "Building Asterisk..."
- make \
- NOTRACE=1 \
- OPTIMIZE="${CFLAGS}" \
- PWLIBDIR=/usr/share/pwlib \
- OPENH323DIR=/usr/share/openh323 \
- OPTIONS="${myopts}" || die "Make failed"
-
- # create api docs
- use doc && \
- make progdocs
-
- # build bristuff's ISDNguard
- use bri && \
- make -C ${S_BRI}/ISDNguard
-}
-
-src_install() {
-
- # install asterisk
- make DESTDIR=${D} install || die "Make install failed"
- make DESTDIR=${D} samples || die "Failed to create sample files"
-
- # remove installed sample files if nosamples flag is set
- if use nosamples; then
- einfo "Skipping installation of sample files..."
- einfo "See ${ROOT}usr/share/doc/${PF}/configs for configuration files"
- insinto /usr/share/doc/${PF}/configs
- newins ${D}etc/asterisk/asterisk.conf asterisk.conf.sample
-
- # skip installation of sample configuration files
- # if asterisk-1.1.0 or later is present
- if has_version ">net-misc/asterisk-1.1.0"
- then
- rm -f ${D}etc/asterisk/*
- else
- einfo "No previous or old (<=1.0.x) installation of ${PN} found,"
- einfo "installing sample configuration files!"
- fi
- rm -rf ${D}var/spool/asterisk/voicemail/default
- rm -f ${D}var/lib/asterisk/mohmp3/*
- rm -f ${D}var/lib/asterisk/sounds/demo-*
- rm -f ${D}var/lib/asterisk/agi-bin/*
- else
- einfo "Sample files have been installed"
- keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
- fi
-
- # don't delete these directories, even if they are empty
- for x in voicemail meetme system dictate tmp; do
- keepdir /var/spool/asterisk/${x}
- done
- keepdir /var/lib/asterisk/sounds/priv-callerintros
- keepdir /var/lib/asterisk/mohmp3
- keepdir /var/lib/asterisk/agi-bin
- keepdir /var/log/asterisk/cdr-csv
- keepdir /var/log/asterisk/cdr-custom
- keepdir /var/run/asterisk
-
- # install asterisk.h, a lot of external modules need this
- insinto /usr/include/asterisk
- doins include/asterisk.h
-
- # install astgenkey, astxs, safe_asterisk and manpages
- dobin contrib/scripts/astxs
- dosbin contrib/scripts/astgenkey
- dosbin contrib/scripts/safe_asterisk
- doman contrib/scripts/safe_asterisk.8
- doman contrib/scripts/astgenkey.8
-
- newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
- newconfd ${FILESDIR}/1.0.0/asterisk.confd.sec asterisk
-
- # install standard docs...
- dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm
- dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
- dodoc doc/README.*
- dodoc doc/*.txt
-
- docinto scripts
- dodoc contrib/scripts/*
-
- docinto utils
- dodoc contrib/utils/*
-
- docinto configs
- dodoc configs/*
-
- # install api docs
- if use doc; then
- insinto /usr/share/doc/${PF}/api/html
- doins doc/api/html/*
- fi
-
- # install ISDNguard
- if use bri; then
- cd ${S_BRI}/ISDNguard
- dosbin ISDNguard
-
- docinto ISDNguard
- dodoc INSTALL.ISDNguard
-
- cd ${S}
- fi
-
- insinto /usr/share/doc/${PF}/cgi
- doins contrib/scripts/vmail.cgi
- doins images/*.gif
-}
-
-pkg_preinst() {
- enewgroup asterisk
- enewuser asterisk -1 -1 /var/lib/asterisk asterisk
-}
-
-pkg_postinst() {
- einfo "Fixing 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
- echo
-
- #
- # Announcements, warnings, reminders...
- #
- einfo "Asterisk has been installed"
- 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 "Gentoo VoIP IRC Channel:"
- einfo "#gentoo-voip @ irc.freenode.net"
- echo
-
- #
- # Permission and non-root warning
- #
- ewarn "*********************** Important information **************************"
- ewarn
- ewarn "- Asterisk runs as user asterisk, group asterisk by default"
- ewarn
- ewarn "- Make sure the asterisk user is a member of the proper groups if you want it"
- ewarn " to have access to hardware devices, e.g. \"audio\" for Alsa and OSS sound or"
- ewarn " \"dialout\" for zaptel!"
- ewarn
- ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
- ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
- ewarn
- ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
- ewarn " to asterisk:asterisk 750 / 640"
- ewarn
- ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
- ewarn
- ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
- ewarn " use something like this to make iptables set them for you:"
- ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
- ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
- ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
- ewarn
- ewarn "For more details:"
- ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
- ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
- echo
-
- #
- # Upgrade 1.2.x warning...
- #
- eerror " Asterisk UPGRADE Warning"
- eerror ""
- eerror "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz before continuing !!!"
- eerror ""
- eerror " Asterisk UPGRADE Warning"
-}
-
-pkg_config() {
- einfo "Do you want to reset file permissions and ownerships (y/N)?"
-
- read tmp
- tmp="$(echo $tmp | tr [:upper:] [:lower:])"
-
- if [[ "$tmp" = "y" ]] ||\
- [[ "$tmp" = "yes" ]]
- then
- einfo "Resetting permissions to defaults..."
-
- 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
-
- einfo "done"
- else
- einfo "skipping"
- fi
-}
diff --git a/net-misc/asterisk/asterisk-1.2.4.ebuild b/net-misc/asterisk/asterisk-1.2.4.ebuild
deleted file mode 100644
index a1c24e02b186..000000000000
--- a/net-misc/asterisk/asterisk-1.2.4.ebuild
+++ /dev/null
@@ -1,385 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.2.4.ebuild,v 1.4 2006/03/13 21:53:22 stkn Exp $
-
-inherit eutils
-
-IUSE="alsa bri curl debug doc gtk h323 hardened lowmem mmx mysql \
- nosamples odbc osp postgres pri speex sqlite ssl ukcid zaptel"
-
-BRI_VERSION="0.3.0-PRE-1h"
-AST_PATCHES="1.2.1-patches-1.0"
-
-## TODO:
-#
-# - uclibc patch still needed? (still applies)
-# - test nosamples
-# - add some more use flags...
-# recent additions: osp, lowmem, curl, ukcid
-# - cleanup
-
-MY_P="${P/_/-}"
-
-DESCRIPTION="Asterisk: A Modular Open Source PBX System"
-HOMEPAGE="http://www.asterisk.org/"
-SRC_URI="http://ftp.digium.com/pub/asterisk/old-releases/${MY_P}.tar.gz
- http://www.netdomination.org/pub/asterisk/${PN}-${AST_PATCHES}.tar.bz2
- bri? ( http://www.netdomination.org/pub/asterisk/asterisk-${PV}-bristuff-${BRI_VERSION}.diff.gz
- http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
-# bri? ( http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )"
-
-RESTRICT="nomirror"
-
-S="${WORKDIR}/${MY_P}"
-S_BRI="${WORKDIR}/bristuff-${BRI_VERSION}"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
-
-RDEPEND="dev-libs/newt
- media-sound/sox
- media-sound/mpg123
- ssl? ( dev-libs/openssl )
- gtk? ( =x11-libs/gtk+-1.2* )
- pri? ( >=net-libs/libpri-1.2.0 )
- h323? ( >=dev-libs/pwlib-1.8.3
- >=net-libs/openh323-1.15.0 )
- alsa? ( media-libs/alsa-lib )
- curl? ( net-misc/curl )
- odbc? ( dev-db/unixODBC )
- mysql? ( dev-db/mysql )
- speex? ( media-libs/speex )
- sqlite? ( <dev-db/sqlite-3.0.0 )
- zaptel? ( >=net-misc/zaptel-1.2.0 )
- postgres? ( dev-db/postgresql )
- osp? ( >=net-libs/osptoolkit-3.3.4 )
- bri? ( >=net-libs/libpri-1.2.2
- >=net-misc/zaptel-1.2.3 )"
-
-DEPEND="${RDEPEND}
- sys-devel/flex
- sys-devel/bison
- doc? ( app-doc/doxygen )"
-
-pkg_setup() {
- ewarn " Asterisk UPGRADE Warning"
- ewarn ""
- ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz after installation !!!"
- ewarn ""
- ewarn " Asterisk UPGRADE Warning"
- echo
- einfo "Press Ctrl+C to abort"
- echo
- ebeep
-
- n=10
- while [[ $n -gt 0 ]]; do
- echo -en " Waiting $n seconds...\r"
- sleep 1
- (( n-- ))
- done
-
- #
- # Regular checks
- #
- einfo "Running some pre-flight checks..."
-
- # check if zaptel and libpri have been built with bri enabled
- if use bri; then
- if ! built_with_use net-misc/zaptel bri; then
- eerror "Re-emerge zaptel with bri use-flag enabled!"
- die "Zaptel without bri support detected"
- fi
-
- if ! built_with_use net-libs/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}
-
- #
- # gentoo patchset
- #
- for x in $(grep -v "^#\| \+" ${WORKDIR}/patches/patches.list); do
- epatch ${WORKDIR}/patches/${x}
- done
-
- if use mmx; then
- if ! use hardened; then
- einfo "Enabling mmx optimization"
- sed -i -e "s:^#\(K6OPT[\t ]\+= -DK6OPT\):\1:" \
- Makefile
- else
- ewarn "Hardened use-flag is set, not enabling mmx optimization for codec_gsm!"
- fi
- fi
-
- if ! use debug; then
- einfo "Disabling debug support"
- sed -i -e "s:^\(DEBUG=\):#\1:" \
- Makefile
- fi
-
- if ! use ssl; then
- einfo "Disabling crypto support"
- sed -i -e "s:^#\(NOCRYPTO=yes\):\1:" \
- Makefile
- fi
-
- #
- # uclibc patch
- #
- if use elibc_uclibc; then
- einfo "Patching asterisk for uclibc..."
- epatch ${FILESDIR}/1.0.0/${PN}-1.0.5-uclibc-dns.diff
- epatch ${FILESDIR}/1.2.0/${PN}-1.2.1-uclibc-getloadavg.diff
- fi
-
- #
- # ukcid patch from http://www.lusyn.com/asterisk/
- #
- if use ukcid; then
- einfo "Patching asterisk for UK Callerid..."
- epatch ${FILESDIR}/1.2.0/${PN}-1.2.0_beta-ukcid.patch
- fi
-
- #
- # BRI patches
- #
- if use bri; then
- einfo "Patching asterisk w/ BRI stuff"
-# epatch ${S_BRI}/patches/asterisk.patch
- epatch ${WORKDIR}/asterisk-${PV}-bristuff-${BRI_VERSION}.diff
- fi
-}
-
-src_compile() {
- local myopts
-
- use lowmem && \
- myopts="-DLOW_MEMORY"
-
- if use h323; then
- einfo "Building H.323 wrapper lib..."
- make -C channels/h323 \
- NOTRACE=1 \
- PWLIBDIR=/usr/share/pwlib \
- OPENH323DIR=/usr/share/openh323 \
- libchanh323.a Makefile.ast || die "Make h323 failed"
- fi
-
- einfo "Building Asterisk..."
- make \
- NOTRACE=1 \
- OPTIMIZE="${CFLAGS}" \
- PWLIBDIR=/usr/share/pwlib \
- OPENH323DIR=/usr/share/openh323 \
- OPTIONS="${myopts}" || die "Make failed"
-
- # create api docs
- use doc && \
- make progdocs
-
- # build bristuff's ISDNguard
- use bri && \
- make -C ${S_BRI}/ISDNguard
-}
-
-src_install() {
-
- # install asterisk
- make DESTDIR=${D} install || die "Make install failed"
- make DESTDIR=${D} samples || die "Failed to create sample files"
-
- # remove installed sample files if nosamples flag is set
- if use nosamples; then
- einfo "Skipping installation of sample files..."
- einfo "See ${ROOT}usr/share/doc/${PF}/configs for configuration files"
- insinto /usr/share/doc/${PF}/configs
- newins ${D}etc/asterisk/asterisk.conf asterisk.conf.sample
-
- # skip installation of sample configuration files
- # if asterisk-1.1.0 or later is present
- if has_version ">net-misc/asterisk-1.1.0"
- then
- rm -f ${D}etc/asterisk/*
- else
- einfo "No previous or old (<=1.0.x) installation of ${PN} found,"
- einfo "installing sample configuration files!"
- fi
- rm -rf ${D}var/spool/asterisk/voicemail/default
- rm -f ${D}var/lib/asterisk/mohmp3/*
- rm -f ${D}var/lib/asterisk/sounds/demo-*
- rm -f ${D}var/lib/asterisk/agi-bin/*
- else
- einfo "Sample files have been installed"
- keepdir /var/spool/asterisk/voicemail/default/1234/INBOX
- fi
-
- # don't delete these directories, even if they are empty
- for x in voicemail meetme system dictate tmp; do
- keepdir /var/spool/asterisk/${x}
- done
- keepdir /var/lib/asterisk/sounds/priv-callerintros
- keepdir /var/lib/asterisk/mohmp3
- keepdir /var/lib/asterisk/agi-bin
- keepdir /var/log/asterisk/cdr-csv
- keepdir /var/log/asterisk/cdr-custom
- keepdir /var/run/asterisk
-
- # install asterisk.h, a lot of external modules need this
- insinto /usr/include/asterisk
- doins include/asterisk.h
-
- # install astgenkey, astxs, safe_asterisk and manpages
- dobin contrib/scripts/astxs
- dosbin contrib/scripts/astgenkey
- dosbin contrib/scripts/safe_asterisk
- doman contrib/scripts/safe_asterisk.8
- doman contrib/scripts/astgenkey.8
-
- newinitd ${FILESDIR}/1.0.0/asterisk.rc6.sec asterisk
- newconfd ${FILESDIR}/1.0.0/asterisk.confd.sec asterisk
-
- # install standard docs...
- dodoc BUGS CREDITS LICENSE ChangeLog HARDWARE README README.fpm
- dodoc SECURITY doc/CODING-GUIDELINES doc/linkedlists.README UPGRADE.txt
- dodoc doc/README.*
- dodoc doc/*.txt
-
- docinto scripts
- dodoc contrib/scripts/*
-
- docinto utils
- dodoc contrib/utils/*
-
- docinto configs
- dodoc configs/*
-
- # install api docs
- if use doc; then
- insinto /usr/share/doc/${PF}/api/html
- doins doc/api/html/*
- fi
-
- # install ISDNguard
- if use bri; then
- cd ${S_BRI}/ISDNguard
- dosbin ISDNguard
-
- docinto ISDNguard
- dodoc INSTALL.ISDNguard
-
- cd ${S}
- fi
-
- insinto /usr/share/doc/${PF}/cgi
- doins contrib/scripts/vmail.cgi
- doins images/*.gif
-}
-
-pkg_preinst() {
- enewgroup asterisk
- enewuser asterisk -1 -1 /var/lib/asterisk asterisk
-}
-
-pkg_postinst() {
- einfo "Fixing 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
- echo
-
- #
- # Announcements, warnings, reminders...
- #
- einfo "Asterisk has been installed"
- 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
- echo
-
- #
- # Permission and non-root warning
- #
- ewarn "*********************** Important information **************************"
- ewarn
- ewarn "- Asterisk runs as user asterisk, group asterisk by default"
- ewarn
- ewarn "- Make sure the asterisk user is a member of the proper groups if you want it"
- ewarn " to have access to hardware devices, e.g. \"audio\" for Alsa and OSS sound or"
- ewarn " \"dialout\" for zaptel!"
- ewarn
- ewarn "- Permissions of /etc/asterisk have been changed to root:asterisk"
- ewarn " 750 (rwxr-x--- directories) / 640 (rw-r----- files)"
- ewarn
- ewarn "- Permissions of /var/{log,lib,run,spool}/asterisk have been changed"
- ewarn " to asterisk:asterisk 750 / 640"
- ewarn
- ewarn "- Asterisk's unix socket and pidfile are now in /var/run/astrisk"
- ewarn
- ewarn "- Asterisk cannot set the IP ToS bits when run as user,"
- ewarn " use something like this to make iptables set them for you:"
- ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --dport 5060 -j DSCP --set-dscp 0x28\""
- ewarn " \"iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp 0x28\""
- ewarn " (taken from voip-info.org comments (see below), thanks andrewid)"
- ewarn
- ewarn "For more details:"
- ewarn " http://bugs.gentoo.org/show_bug.cgi?id=88732"
- ewarn " http://www.voip-info.org/wiki-Asterisk+non-root"
- echo
-
- #
- # Warning about security changes...
- #
- ewarn " Asterisk UPGRADE Warning"
- ewarn ""
- ewarn "!!! Read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz before continuing !!!"
- ewarn ""
- ewarn " Asterisk UPGRADE Warning"
-}
-
-pkg_config() {
- einfo "Do you want to reset file permissions and ownerships (y/N)?"
-
- read tmp
- tmp="$(echo $tmp | tr [:upper:] [:lower:])"
-
- if [[ "$tmp" = "y" ]] ||\
- [[ "$tmp" = "yes" ]]
- then
- einfo "Resetting permissions to defaults..."
-
- 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
-
- einfo "done"
- else
- einfo "skipping"
- fi
-}
diff --git a/net-misc/asterisk/files/1.0.0/asterisk-1.0-CVE-2006-1827.patch b/net-misc/asterisk/files/1.0.0/asterisk-1.0-CVE-2006-1827.patch
new file mode 100644
index 000000000000..41e646725c7a
--- /dev/null
+++ b/net-misc/asterisk/files/1.0.0/asterisk-1.0-CVE-2006-1827.patch
@@ -0,0 +1,13 @@
+Index: formats/format_jpeg.c
+===================================================================
+--- formats/format_jpeg.c (.../1.2.6) (revision 19610)
++++ formats/format_jpeg.c (.../1.2.7) (revision 19610)
+@@ -55,7 +55,7 @@
+ struct ast_frame fr;
+ int res;
+ char buf[65536];
+- if (len > sizeof(buf)) {
++ if (len > sizeof(buf) || len < 0) {
+ ast_log(LOG_WARNING, "JPEG image too large to read\n");
+ return NULL;
+ }
diff --git a/net-misc/asterisk/files/digest-asterisk-1.0.10-r2 b/net-misc/asterisk/files/digest-asterisk-1.0.10-r2
new file mode 100644
index 000000000000..e11d84629b80
--- /dev/null
+++ b/net-misc/asterisk/files/digest-asterisk-1.0.10-r2
@@ -0,0 +1,3 @@
+MD5 f60f4c4edc36fa61dc55a5385fd82e71 asterisk-1.0.10.tar.gz 9609302
+MD5 2b6e1da3ff097f9792d3123e7e5a0059 asterisk-addons-1.0.9.tar.gz 73716
+MD5 4d8cc1e10d94f373e6dfd4cea2928ad2 bristuff-0.2.0-RC8q.tar.gz 152018
diff --git a/net-misc/asterisk/files/digest-asterisk-1.0.7-r4 b/net-misc/asterisk/files/digest-asterisk-1.0.7-r4
new file mode 100644
index 000000000000..6de4491b805b
--- /dev/null
+++ b/net-misc/asterisk/files/digest-asterisk-1.0.7-r4
@@ -0,0 +1,9 @@
+MD5 4cc3c1e4a1b12e0e4c748326ad153291 asterisk-1.0.7.tar.gz 9591705
+RMD160 bb738f0e3d100314fa7497c9ee81f8a022e536bb asterisk-1.0.7.tar.gz 9591705
+SHA256 552dd71917475eaf1866665d091909c2c50865d84c62ab35383f443141e08a74 asterisk-1.0.7.tar.gz 9591705
+MD5 e2a94a7c2e97de18b3cdc4dd42709c11 asterisk-addons-1.0.7.tar.gz 73646
+RMD160 52d73f32bcd1717b5cf057c5930a9aefae1040cf asterisk-addons-1.0.7.tar.gz 73646
+SHA256 22d5839b851ed83590bf670f0c958ec5103178f80706ce4b4b235c837adf0433 asterisk-addons-1.0.7.tar.gz 73646
+MD5 7a5ff01d3befff1fbd3de1c303cb10d1 bristuff-0.2.0-RC8g.tar.gz 139013
+RMD160 c0a037e0819b8985be2df60a010309335527f203 bristuff-0.2.0-RC8g.tar.gz 139013
+SHA256 19a0a7fdbb192fed4ea086251d5653abbe8525232dd5b613f9366400c97b213b bristuff-0.2.0-RC8g.tar.gz 139013
diff --git a/net-misc/asterisk/files/digest-asterisk-1.0.8-r3 b/net-misc/asterisk/files/digest-asterisk-1.0.8-r3
new file mode 100644
index 000000000000..88ae55242b46
--- /dev/null
+++ b/net-misc/asterisk/files/digest-asterisk-1.0.8-r3
@@ -0,0 +1,9 @@
+MD5 8400ebbd46e41cd772c7814b361de05a asterisk-1.0.8.tar.gz 9604563
+RMD160 6f1e63804ce4a2ec90a61571bf946d6b64dcea76 asterisk-1.0.8.tar.gz 9604563
+SHA256 26807ac82aa45758e538276301273c4493e1f4fdb2ba433bd732ab21d2340e9a asterisk-1.0.8.tar.gz 9604563
+MD5 07af0488fde431278fc840f39a9b38f2 asterisk-addons-1.0.8.tar.gz 73702
+RMD160 66c6ab0ab2941cb657828d45ab379ecbfb385a5d asterisk-addons-1.0.8.tar.gz 73702
+SHA256 3f5c9d03fd257781ec6c59189d37c492fbdf457a1d267bb509f3c852693a7dae asterisk-addons-1.0.8.tar.gz 73702
+MD5 3b264a75b1a17735572920655bf1a0f8 bristuff-0.2.0-RC8h.tar.gz 150270
+RMD160 a958bc8418618ca892f0fbdb8d8cf203375d3865 bristuff-0.2.0-RC8h.tar.gz 150270
+SHA256 74c2e40cd665a2a9ac29d5ddd31892c8ca15ca9b55e2a08523e9db5ca75ba207 bristuff-0.2.0-RC8h.tar.gz 150270
diff --git a/net-misc/asterisk/files/digest-asterisk-1.0.9-r4 b/net-misc/asterisk/files/digest-asterisk-1.0.9-r4
new file mode 100644
index 000000000000..a1637fb67395
--- /dev/null
+++ b/net-misc/asterisk/files/digest-asterisk-1.0.9-r4
@@ -0,0 +1,9 @@
+MD5 0d7f1c680ae53a739f26a069ef8b580a asterisk-1.0.9.tar.gz 9604582
+RMD160 2e48dc00a3c290cc6b418ab0aee42feb93d9e76a asterisk-1.0.9.tar.gz 9604582
+SHA256 27e9437b3e6297f1a5e171b96e818c1ffa51dba78afe61277f5c3540809d2653 asterisk-1.0.9.tar.gz 9604582
+MD5 2b6e1da3ff097f9792d3123e7e5a0059 asterisk-addons-1.0.9.tar.gz 73716
+RMD160 98156861f790987fb4bf86b14c902aeca90b380b asterisk-addons-1.0.9.tar.gz 73716
+SHA256 4c878a4e5b5aabbdd93116ccbca5cf6465d55f480f4aa1e6438e9fc49c1f11fe asterisk-addons-1.0.9.tar.gz 73716
+MD5 a6b5c61c16b35f02c616c8abadb9999d bristuff-0.2.0-RC8n.tar.gz 143979
+RMD160 922b6b807bb48aa690412de3916eeb54c1454486 bristuff-0.2.0-RC8n.tar.gz 143979
+SHA256 a92d9d8e9777c0637d2db0375794fe011fd8ecf1461f0b8e6587c74670da637c bristuff-0.2.0-RC8n.tar.gz 143979
diff --git a/net-misc/asterisk/files/digest-asterisk-1.2.0 b/net-misc/asterisk/files/digest-asterisk-1.2.0
deleted file mode 100644
index 341144b91846..000000000000
--- a/net-misc/asterisk/files/digest-asterisk-1.2.0
+++ /dev/null
@@ -1,3 +0,0 @@
-MD5 70d5fcca7edcfa75d1614ed23bf5d07d asterisk-1.2.0-patches-1.1.tar.bz2 7448
-MD5 61d7f29b586ba9b9b5fbb67f952fd3ca asterisk-1.2.0.tar.gz 10464039
-MD5 884979fbfb75e6cdf7d8bdb66841e728 bristuff-0.3.0-PRE-1.tar.gz 159742
diff --git a/net-misc/asterisk/files/digest-asterisk-1.2.1 b/net-misc/asterisk/files/digest-asterisk-1.2.1
deleted file mode 100644
index e206bc9365ec..000000000000
--- a/net-misc/asterisk/files/digest-asterisk-1.2.1
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 7d83974893a1eb757d127935b7e8d543 asterisk-1.2.1-bristuff-0.3.0-PRE-1c.diff.gz 57361
-MD5 a3da220e222c09fcacf346845ca36eeb asterisk-1.2.1-patches-1.0.tar.bz2 7167
-MD5 04657086791e80f319c0d728af705001 asterisk-1.2.1.tar.gz 10517194
-MD5 97b25f6bc1df0a962383b1bc930266b9 bristuff-0.3.0-PRE-1c.tar.gz 167219
diff --git a/net-misc/asterisk/files/digest-asterisk-1.2.4 b/net-misc/asterisk/files/digest-asterisk-1.2.4
deleted file mode 100644
index 9dedba3912a0..000000000000
--- a/net-misc/asterisk/files/digest-asterisk-1.2.4
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 a3da220e222c09fcacf346845ca36eeb asterisk-1.2.1-patches-1.0.tar.bz2 7167
-MD5 35d728455f6d3460c104feafea95c201 asterisk-1.2.4-bristuff-0.3.0-PRE-1h.diff.gz 95536
-MD5 14721abdc85fc3381db275b61dffce2d asterisk-1.2.4.tar.gz 10536366
-MD5 99f82076904be0325029f6f71357eeba bristuff-0.3.0-PRE-1h.tar.gz 207158