summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2009-03-10 23:33:28 +0000
committerTony Vroon <chainsaw@gentoo.org>2009-03-10 23:33:28 +0000
commit45ed46a37dcf34f880e34d424c0c0017cef653bd (patch)
tree0130ca23454905ee3c1889a4caf17324051f5e0d /net-misc/asterisk
parentUpdate cmake-utils.eclass new targest, etc. see mail to dev for moar. (diff)
downloadgentoo-2-45ed46a37dcf34f880e34d424c0c0017cef653bd.tar.gz
gentoo-2-45ed46a37dcf34f880e34d424c0c0017cef653bd.tar.bz2
gentoo-2-45ed46a37dcf34f880e34d424c0c0017cef653bd.zip
Version bump, with a warm thank you to all VoIP overlay contributors, including but not limited to Rambaldi & Volkmar. This is 1.6.0.6 from upstream including the post-release upstream fixes for Digium bugs #14480, #14516, #14620 & #14626. Also thanks to Digium developer Qwell for SVN revision 180946 containing autoconf fixes. Closes bug #215593 by Natanael Copa.
(Portage version: 2.1.6.7/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/asterisk')
-rw-r--r--net-misc/asterisk/ChangeLog23
-rw-r--r--net-misc/asterisk/asterisk-1.6.0.6.ebuild482
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0-gsm-pic.patch54
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0-uclibc.patch13
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0-var_rundir.patch11
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-autoconf-263.patch56
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-dahdiras.patch19
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-imap-kerberos.patch17
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-parallelmake.patch113
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-sip-use-specified-port.patch14
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-socket-details.patch69
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-spandsp-api-change.patch42
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk.confd98
-rw-r--r--net-misc/asterisk/files/1.6.0/asterisk.rc6253
-rw-r--r--net-misc/asterisk/metadata.xml13
15 files changed, 1272 insertions, 5 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog
index f92b558b5021..c95c51467705 100644
--- a/net-misc/asterisk/ChangeLog
+++ b/net-misc/asterisk/ChangeLog
@@ -1,6 +1,27 @@
# ChangeLog for net-misc/asterisk
# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.182 2009/02/25 23:17:19 rajiv Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.183 2009/03/10 23:33:28 chainsaw Exp $
+
+*asterisk-1.6.0.6 (10 Mar 2009)
+
+ 10 Mar 2009; <chainsaw@gentoo.org>
+ +files/1.6.0/asterisk-1.6.0.6-autoconf-263.patch,
+ +files/1.6.0/asterisk-1.6.0.6-dahdiras.patch,
+ +files/1.6.0/asterisk-1.6.0.6-imap-kerberos.patch,
+ +files/1.6.0/asterisk-1.6.0.6-parallelmake.patch,
+ +files/1.6.0/asterisk-1.6.0-gsm-pic.patch, +files/1.6.0/asterisk.confd,
+ +files/1.6.0/asterisk-1.6.0.6-sip-use-specified-port.patch,
+ +files/1.6.0/asterisk-1.6.0-uclibc.patch,
+ +files/1.6.0/asterisk-1.6.0-var_rundir.patch, +files/1.6.0/asterisk.rc6,
+ +files/1.6.0/asterisk-1.6.0.6-socket-details.patch,
+ +files/1.6.0/asterisk-1.6.0.6-spandsp-api-change.patch, metadata.xml,
+ +asterisk-1.6.0.6.ebuild:
+ Version bump, with a warm thank you to all VoIP overlay contributors,
+ including but not limited to Rambaldi & Volkmar. This is 1.6.0.6 from
+ upstream including the post-release upstream fixes for Digium bugs #14480,
+ #14516, #14620 & #14626. Also thanks to Digium developer Qwell for SVN
+ revision 180946 containing autoconf fixes. Closes bug #215593 by Natanael
+ Copa.
25 Feb 2009; Rajiv Aaron Manglani <rajiv@gentoo.org>
-files/1.2.0/asterisk-1.2.0_beta-ukcid.patch,
diff --git a/net-misc/asterisk/asterisk-1.6.0.6.ebuild b/net-misc/asterisk/asterisk-1.6.0.6.ebuild
new file mode 100644
index 000000000000..d81b0949af76
--- /dev/null
+++ b/net-misc/asterisk/asterisk-1.6.0.6.ebuild
@@ -0,0 +1,482 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.0.6.ebuild,v 1.1 2009/03/10 23:33:28 chainsaw Exp $
+
+EAPI=1
+inherit eutils autotools
+
+MY_P="${PN}-${PV/_/-}"
+
+DESCRIPTION="Asterisk: A Modular Open Source PBX System"
+HOMEPAGE="http://www.asterisk.org/"
+SRC_URI="http://downloads.digium.com/pub/asterisk/releases/${MY_P}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="alsa +caps curl dahdi debug freetds h323 iconv imap jabber ldap keepsrc misdn newt nosamples odbc oss postgres radius snmp span speex ssl sqlite static vorbis"
+
+RDEPEND="virtual/libc
+ sys-libs/ncurses
+ dev-libs/popt
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ caps? ( sys-libs/libcap )
+ curl? ( net-misc/curl )
+ dahdi? ( >=net-libs/libpri-1.4.7
+ net-misc/dahdi-tools )
+ freetds? ( dev-db/freetds )
+ h323? ( dev-libs/pwlib
+ net-libs/openh323 )
+ iconv? ( virtual/libiconv )
+ imap? ( virtual/imap-c-client )
+ jabber? ( dev-libs/iksemel )
+ ldap? ( net-nds/openldap )
+ misdn? ( net-dialup/misdnuser )
+ newt? ( dev-libs/newt )
+ odbc? ( dev-db/unixODBC )
+ postgres? ( virtual/postgresql-base )
+ radius? ( net-dialup/radiusclient-ng )
+ snmp? ( net-analyzer/net-snmp )
+ span? ( media-libs/spandsp )
+ speex? ( media-libs/speex )
+ sqlite? ( dev-db/sqlite )
+ ssl? ( dev-libs/openssl )
+ vorbis? ( media-libs/libvorbis )"
+
+DEPEND="${RDEPEND}
+ !<net-misc/asterisk-addons-1.6"
+
+S="${WORKDIR}/${MY_P}"
+
+#
+# shortcuts
+#
+
+# update from asterisk-1.0.x
+is_ast10update() {
+ return $(has_version "=net-misc/asterisk-1.0*")
+}
+
+# update from asterisk-1.2.x
+is_ast12update() {
+ return $(has_version "=net-misc/asterisk-1.2*")
+}
+
+# update from asterisk 1.4.x
+is_ast14update() {
+ return $(has_version "=net-misc/asterisk-1.4*")
+}
+
+# update in the asterisk-1.6.x line
+is_astupdate() {
+ if ! is_ast10update && ! is_ast12update && !is_ast14update; then
+ return $(has_version "<net-misc/asterisk-${PV}")
+ fi
+ return 0
+}
+
+get_available_modules() {
+ local modules mod x
+
+ # build list of available modules...
+ for x in app cdr codec format func pbx res; do
+
+ for mod in $(find "${S}" -type f -name "${x}_*.c*" -print)
+ do
+ modules="${modules} $(basename ${mod/%.c*})"
+ done
+ done
+
+ echo "${modules}"
+}
+
+pkg_setup() {
+ local checkfailed=0 waitaftermsg=0
+
+ if is_ast10update || is_ast12update || is_ast14update ; then
+ ewarn " Asterisk UPGRADE Warning"
+ ewarn ""
+ ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!"
+ ewarn ""
+ ewarn " Asterisk UPGRADE Warning"
+ echo
+ waitaftermsg=1
+ fi
+
+ if [[ $waitaftermsg -eq 1 ]]; then
+ einfo "Press Ctrl+C to abort"
+ echo
+ ebeep 10
+ fi
+
+ #
+ # Regular checks
+ #
+ einfo "Running some pre-flight checks..."
+ echo
+
+ # imap requires ssl if imap-c-client was built with ssl,
+ # conversely if ssl and imap are both on then imap-c-client needs ssl
+ if use imap; then
+ if use ssl && ! built_with_use virtual/imap-c-client ssl; then
+ eerror
+ eerror "IMAP with SSL requested, but your IMAP C-Client libraries"
+ eerror "are built without SSL!"
+ eerror
+ die "Please recompile the IMAP C-Client libraries with SSL support enabled"
+ elif ! use ssl && built_with_use virtual/imap-c-client ssl; then
+ eerror
+ eerror "IMAP without SSL requested, but your IMAP C-Client"
+ eerror "libraries are built with SSL!"
+ eerror
+ die "Please recompile the IMAP C-Client libraries without SSL support enabled"
+ fi
+ fi
+
+ if [[ -n "${ASTERISK_MODULES}" ]] ; then
+ ewarn "You are overriding ASTERISK_MODULES. We will assume you know what you are doing. There is no support for this option, try without if you see breakage."
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ #
+ # comment about h323 issues
+ #
+ if use h323 ; then
+ ewarn "h323 useflag: It is known that the h323 module doesn't compile
+ the \"normal\" way: For a workaround, asterisk will be built two times
+ without cleaning the build dir."
+ fi
+
+ #
+ # put pid file(s) into /var/run/asterisk
+ #
+ epatch "${FILESDIR}"/1.6.0/${PN}-1.6.0-var_rundir.patch || die "patch failed"
+
+ #
+ # fix gsm codec cflags (e.g. i586 core epias) and disable
+ # assembler optimizations
+ #
+ epatch "${FILESDIR}"/1.6.0/${PN}-1.6.0-gsm-pic.patch || die "patch failed"
+
+ #
+ # add missing LIBS for uclibc
+ #
+ epatch "${FILESDIR}"/1.6.0/${PN}-1.6.0-uclibc.patch || die "patch failed"
+
+ #
+ # do not ignore TCP transport setting for SIP, remove for 1.6.0.7 as it is upstream
+ # http://bugs.digium.com/view.php?id=14480
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-socket-details.patch || die "patch failed"
+
+ #
+ # allow dahdiras application to actually build, remove for 1.6.0.7 as it is upstream
+ # http://bugs.digium.com/view.php?id=14516
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-dahdiras.patch || die "patch failed"
+
+ #
+ # allow fax application to build against new spandsp, remove for 1.6.0.7 as it is upstream
+ # http://bugs.digium.com/view.php?id=14620
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-spandsp-api-change.patch || die "patch failed"
+
+ #
+ # do not ignore TCP port setting for SIP, remove for 1.6.0.7 as it is upstream
+ # http://bugs.digium.com/view.php?id=14626
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-sip-use-specified-port.patch || die "patch failed"
+
+ #
+ # try to tame the custom build system a little so make likes it better
+ # patch credit: Diego E. 'Flameeyes' Pettenò <flameeyes@entoo.org>
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-parallelmake.patch || die "patch failed"
+
+ #
+ # the build system didn't handle >= autoconf-2.62 before
+ # from upstream SVN commit rev 180946 by qwell
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-autoconf-263.patch || die "patch failed"
+
+ #
+ # link UW-IMAP with Kerberos5 if necessary
+ #
+ epatch "${FILESDIR}"/1.6.0/${P}-imap-kerberos.patch || die "patch failed"
+
+ AT_M4DIR=autoconf eautoreconf
+
+ # parse modules list
+ if [[ -n "${ASTERISK_MODULES}" ]]; then
+ local x modules="$(get_available_modules)"
+
+ einfo "Custom list of modules specified, checking..."
+
+ use debug && {
+ einfo "Available modules: ${modules}"
+ einfo " Selected modules: ${ASTERISK_MODULES}"
+ }
+
+ for x in ${ASTERISK_MODULES}; do
+ if [[ "${x}" = "-*" ]]; then
+ MODULES_LIST=""
+ else
+ if has ${x} ${modules}
+ then
+ MODULES_LIST="${MODULES_LIST} ${x}"
+ else
+ eerror "Unknown module: ${x}"
+ fi
+ fi
+ done
+
+ export MODULES_LIST
+ fi
+}
+
+src_compile() {
+ #
+ # start with configure
+ #
+ econf \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir="/var" \
+ --with-gsm=internal \
+ --with-popt \
+ --with-z \
+ $(use_with alsa asound) \
+ $(use_with caps cap) \
+ $(use_with curl) \
+ $(use_with dahdi pri) \
+ $(use_with dahdi tonezone) \
+ $(use_with dahdi) \
+ $(use_with freetds tds) \
+ $(use_with h323 h323 "/usr/share/openh323") \
+ $(use_with h323 pwlib "/usr/share/pwlib") \
+ $(use_with iconv) \
+ $(use_with imap) \
+ $(use_with jabber iksemel) \
+ $(use_with misdn isdnnet) \
+ $(use_with misdn suppserv) \
+ $(use_with misdn) \
+ $(use_with newt) \
+ $(use_with odbc) \
+ $(use_with oss) \
+ $(use_with postgres) \
+ $(use_with radius) \
+ $(use_with snmp netsnmp) \
+ $(use_with span spandsp) \
+ $(use_with speex) \
+ $(use_with speex speexdsp) \
+ $(use_with sqlite sqlite3) \
+ $(use_with ssl crypto) \
+ $(use_with ssl) \
+ $(use_with vorbis ogg) \
+ $(use_with vorbis) || die "econf failed"
+
+ #
+ # custom module filter
+ # run menuselect to evaluate the list of modules
+ # and rewrite the list afterwards
+ #
+ if [[ -n "${MODULES_LIST}" ]]
+ then
+ local mod category tmp_list failed_list
+
+ ###
+ # run menuselect
+
+ emake menuselect.makeopts || die "emake menuselect.makeopts failed"
+
+ ###
+ # get list of modules with failed dependencies
+
+ failed_list="$(awk -F= '/^MENUSELECT_DEPSFAILED=/{ print $3 }' menuselect.makeopts)"
+
+ ###
+ # traverse our list of modules
+
+ for category in app cdr codec format func pbx res; do
+ tmp_list=""
+
+ # search list of modules for matching ones first...
+ for mod in ${MODULES_LIST}; do
+ # module is from current category?
+ if [[ "${mod/%_*}" = "${category}" ]]
+ then
+ # check menuselect thinks the dependencies are met
+ if has ${mod} ${failed_list}
+ then
+ eerror "${mod}: dependencies required to build this module are not met, NOT BUILDING!"
+ else
+ tmp_list="${tmp_list} ${mod}"
+ fi
+ fi
+ done
+
+ use debug && echo "${category} tmp: ${tmp_list}"
+
+ # replace the module list for $category with our custom one
+ if [[ -n "${tmp_list}" ]]
+ then
+ category="$(echo ${category} | tr '[:lower:]' '[:upper:]')"
+ sed -i -e "s:^\(MENUSELECT_${category}S?\):\1=${tmp_list}:" \
+ menuselect.makeopts || die "failed to set list of ${category} applications"
+ fi
+ done
+ fi
+
+ #
+ # fasten your seatbelts (and start praying)
+ #
+ if use h323 ; then
+ # emake one time to get h323 to make.... yea not "clean" but works
+ emake
+ fi
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ # setup directory structure
+ #
+ mkdir -p "${D}"usr/lib/pkgconfig
+
+ emake DESTDIR="${D}" install || die "emake install failed"
+ emake DESTDIR="${D}" samples || die "emake samples failed"
+
+ # remove installed sample files if nosamples flag is set
+ if use nosamples; then
+ einfo "Skipping installation of sample files..."
+ 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"
+ fi
+ rm -rf "${D}"var/spool/asterisk/voicemail/default
+
+ # move sample configuration files to doc directory
+ if is_ast10update || is_ast12update || is_ast14update; then
+ einfo "Updating from old (pre-1.6) asterisk version, new configuration files have been installed"
+ einfo "into "${ROOT}"etc/asterisk, use etc-update or dispatch-conf to update them"
+ fi
+
+ einfo "Configuration samples have been moved to: "${ROOT}"/usr/share/doc/${PF}/conf"
+ insinto /usr/share/doc/${PF}/conf
+ doins "${D}"etc/asterisk/*.conf*
+
+ # keep directories
+ keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail}
+ keepdir /var/log/asterisk/{cdr-csv,cdr-custom}
+
+ newinitd "${FILESDIR}"/1.6.0/asterisk.rc6 asterisk
+ newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk
+
+ # some people like to keep the sources around for custom patching
+ # copy the whole source tree to /usr/src/asterisk-${PVF} and run make clean there
+ if use keepsrc
+ then
+ einfo "keepsrc useflag enabled, copying source..."
+ dodir /usr/src
+
+ cp -dPR "${S}" "${D}"/usr/src/${PF} || die "copying source tree failed"
+
+ ebegin "running make clean..."
+ emake -C "${D}"/usr/src/${PF} clean >/dev/null || die "make clean failed"
+ eend $?
+
+ einfo "Source files have been saved to "${ROOT}"usr/src/${PF}"
+ fi
+
+ # install the upgrade documentation
+ #
+ dodoc README UPGRADE* BUGS CREDITS
+
+ # install snmp mib files
+ #
+ if use snmp
+ then
+ insinto /usr/share/snmp/mibs/
+ doins doc/digium-mib.txt doc/asterisk-mib.txt
+ fi
+}
+
+pkg_preinst() {
+ enewgroup asterisk
+ enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout"
+}
+
+pkg_postinst() {
+ ebegin "Fixing up permissions"
+ chown -R asterisk:asterisk "${ROOT}"var/log/asterisk
+ chmod -R u=rwX,g=rX,o= "${ROOT}"var/log/asterisk
+
+ for x in lib run spool; do
+ chown -R asterisk:asterisk "${ROOT}"var/${x}/asterisk
+ chmod -R u=rwX,g=rwX,o= "${ROOT}"var/${x}/asterisk
+ done
+
+ chown asterisk:asterisk "${ROOT}"etc/asterisk/
+ chown asterisk:asterisk "${ROOT}"etc/asterisk/*.adsi
+ chown asterisk:asterisk "${ROOT}"etc/asterisk/extensions.ael
+ chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/
+ chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/*.adsi
+ chmod u=rwX,g=rwX,o= "${ROOT}"etc/asterisk/extensions.ael
+ eend $?
+
+ #
+ # Announcements, warnings, reminders...
+ #
+ einfo "Asterisk has been installed"
+ echo
+ elog "If you want to know more about asterisk, visit these sites:"
+ elog "http://www.asteriskdocs.org/"
+ elog "http://www.voip-info.org/wiki-Asterisk"
+ echo
+ elog "http://www.automated.it/guidetoasterisk.htm"
+ echo
+ elog "Gentoo VoIP IRC Channel:"
+ elog "#gentoo-voip @ irc.freenode.net"
+ echo
+ echo
+
+ #
+ # Warning about 1.x -> 1.6 changes...
+ #
+ if is_ast10update || is_ast12update || is_ast14update; then
+ ewarn ""
+ ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 before continuing"
+ ewarn ""
+ fi
+}
+
+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=rwX,o= "${ROOT}"var/${x}/asterisk
+ done
+
+ chown -R root:asterisk "${ROOT}"etc/asterisk
+ chmod -R u=rwX,g=rwX,o= "${ROOT}"etc/asterisk
+
+ einfo "done"
+ else
+ einfo "skipping"
+ fi
+}
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-gsm-pic.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-gsm-pic.patch
new file mode 100644
index 000000000000..1acca70b3a47
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-gsm-pic.patch
@@ -0,0 +1,54 @@
+--- codecs/gsm/Makefile.org 2008-03-29 11:33:09.000000000 +0100
++++ codecs/gsm/Makefile 2008-03-29 11:44:40.000000000 +0100
+@@ -37,23 +37,6 @@
+ ######### ppro's, etc, as well as the AMD K6 and K7. The compile will
+ ######### probably require gcc.
+
+-ifeq (, $(findstring $(OSARCH) , Darwin SunOS ))
+-ifeq (, $(findstring $(PROC) , x86_64 amd64 ultrasparc sparc64 arm armv5b armeb ppc powerpc ppc64 ia64 s390 bfin mipsel mips))
+-ifeq (, $(findstring $(shell uname -m) , ppc ppc64 alpha armv4l s390 ))
+-OPTIMIZE+=-march=$(PROC)
+-endif
+-endif
+-endif
+-
+-#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
+-#This works for even old (2.96) versions of gcc and provides a small boost either way.
+-#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesn't support it.
+-#So we go lowest common available by gcc and go a step down, still a step up from
+-#the default as we now have a better instruction set to work with. - Belgarath
+-ifeq ($(PROC),ultrasparc)
+-OPTIMIZE+=-mcpu=v8 -mtune=$(PROC) -O3
+-endif
+-
+ PG =
+ #PG = -g -pg
+ ######### Profiling flags. If you don't know what that means, leave it blank.
+@@ -208,12 +191,10 @@
+ # XXX Keep a space after each findstring argument
+ # XXX should merge with GSM_OBJECTS
+ ifeq ($(OSARCH),linux-gnu)
+-ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc s390 ))
+-ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 s390 bfin mipsel mips ))
++ifneq ($(K6OPT),)
+ GSM_SOURCES+= $(SRC)/k6opt.s
+ endif
+ endif
+-endif
+
+ TOAST_SOURCES = $(SRC)/toast.c \
+ $(SRC)/toast_lin.c \
+@@ -260,12 +241,10 @@
+ $(SRC)/table.o
+
+ ifeq ($(OSARCH),linux-gnu)
+-ifeq (,$(findstring $(shell uname -m) , x86_64 amd64 ppc ppc64 alpha armv4l sparc64 parisc ))
+-ifeq (,$(findstring $(PROC) , arm armv5b armeb powerpc ia64 bfin mipsel mips ))
++ifneq ($(K6OPT),)
+ GSM_OBJECTS+= $(SRC)/k6opt.o
+ endif
+ endif
+-endif
+
+ TOAST_OBJECTS = $(SRC)/toast.o \
+ $(SRC)/toast_lin.o \
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-uclibc.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-uclibc.patch
new file mode 100644
index 000000000000..36b49e60b19e
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-uclibc.patch
@@ -0,0 +1,13 @@
+--- Makefile.old 2008-03-22 11:51:39.000000000 +0100
++++ Makefile 2008-03-22 11:51:49.000000000 +0100
+@@ -259,6 +259,10 @@
+ ASTCFLAGS+=-pthread
+ endif
+
++ifeq ($(OSARCH),linux-uclibc)
++ AST_LIBS+=-lpthread -ldl
++endif
++
+ ifeq ($(OSARCH),SunOS)
+ ASTCFLAGS+=-Wcast-align -DSOLARIS -I../include/solaris-compat -I/opt/ssl/include -I/usr/local/ssl/include -D_XPG4_2
+ endif
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-var_rundir.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-var_rundir.patch
new file mode 100644
index 000000000000..367dc7163f54
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0-var_rundir.patch
@@ -0,0 +1,11 @@
+--- asterisk-1.4.0/Makefile.orig 2006-12-24 03:07:19.000000000 +0000
++++ asterisk-1.4.0/Makefile 2006-12-24 03:07:57.000000000 +0000
+@@ -109,7 +109,7 @@
+ ASTSBINDIR=$(sbindir)
+ ASTSPOOLDIR=$(localstatedir)/spool/asterisk
+ ASTLOGDIR=$(localstatedir)/log/asterisk
+- ASTVARRUNDIR=$(localstatedir)/run
++ ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTMANDIR=$(mandir)
+ ifeq ($(OSARCH),FreeBSD)
+ ASTVARLIBDIR=$(prefix)/share/asterisk
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-autoconf-263.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-autoconf-263.patch
new file mode 100644
index 000000000000..7e91cb12b1d4
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-autoconf-263.patch
@@ -0,0 +1,56 @@
+diff -uNr asterisk-1.6.0.6.ORIG/autoconf/ast_check_gnu_make.m4 asterisk-1.6.0.6/autoconf/ast_check_gnu_make.m4
+--- asterisk-1.6.0.6.ORIG/autoconf/ast_check_gnu_make.m4 2009-03-10 22:45:49.000000000 +0000
++++ asterisk-1.6.0.6/autoconf/ast_check_gnu_make.m4 2009-03-10 22:43:07.000000000 +0000
+@@ -1,20 +1,20 @@
+-AC_DEFUN([AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
+- GNU_MAKE='Not Found' ;
+- GNU_MAKE_VERSION_MAJOR=0 ;
+- GNU_MAKE_VERSION_MINOR=0 ;
++AC_DEFUN([AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK([for GNU make], [ac_cv_GNU_MAKE],
++ ac_cv_GNU_MAKE='Not Found' ;
++ ac_cv_GNU_MAKE_VERSION_MAJOR=0 ;
++ ac_cv_GNU_MAKE_VERSION_MINOR=0 ;
+ for a in make gmake gnumake ; do
+ if test -z "$a" ; then continue ; fi ;
+ if ( sh -c "$a --version" 2> /dev/null | grep GNU 2>&1 > /dev/null ) ; then
+- GNU_MAKE=$a ;
+- GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
+- GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
++ ac_cv_GNU_MAKE=$a ;
++ ac_cv_GNU_MAKE_VERSION_MAJOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
++ ac_cv_GNU_MAKE_VERSION_MINOR=`$ac_cv_GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.' | cut -c1-2`
+ break;
+ fi
+ done ;
+ ) ;
+-if test "x$GNU_MAKE" = "xNot Found" ; then
++if test "x$ac_cv_GNU_MAKE" = "xNot Found" ; then
+ AC_MSG_ERROR( *** Please install GNU make. It is required to build Asterisk!)
+ exit 1
+ fi
+-AC_SUBST([GNU_MAKE])
++AC_SUBST([GNU_MAKE], [$ac_cv_GNU_MAKE])
+ ])
+diff -uNr asterisk-1.6.0.6.ORIG/autoconf/ast_prog_sed.m4 asterisk-1.6.0.6/autoconf/ast_prog_sed.m4
+--- asterisk-1.6.0.6.ORIG/autoconf/ast_prog_sed.m4 2009-03-10 22:45:49.000000000 +0000
++++ asterisk-1.6.0.6/autoconf/ast_prog_sed.m4 2009-03-10 22:44:17.000000000 +0000
+@@ -12,7 +12,7 @@
+ done
+ echo "$ac_script" | sed 99q >conftest.sed
+ $as_unset ac_script || ac_script=
+- _AC_PATH_PROG_FEATURE_CHECK(SED, [sed gsed],
++ ifdef([_AC_PATH_PROGS_FEATURE_CHECK], [_AC_PATH_PROGS_FEATURE_CHECK], [_AC_PATH_PROG_FEATURE_CHECK])(SED, [sed gsed],
+ [_AC_FEATURE_CHECK_LENGTH([ac_path_SED], [ac_cv_path_SED],
+ ["$ac_path_SED" -f conftest.sed])])])
+ SED="$ac_cv_path_SED"
+diff -uNr asterisk-1.6.0.6.ORIG/configure.ac asterisk-1.6.0.6/configure.ac
+--- asterisk-1.6.0.6.ORIG/configure.ac 2009-03-10 22:45:52.000000000 +0000
++++ asterisk-1.6.0.6/configure.ac 2009-03-10 22:43:07.000000000 +0000
+@@ -23,7 +23,6 @@
+ AC_COPYRIGHT("Asterisk")
+ AC_REVISION($Revision: 1.1 $)
+
+-AC_GNU_SOURCE
+ AC_USE_SYSTEM_EXTENSIONS # note- does not work on FreeBSD
+
+ case "${host_os}" in
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-dahdiras.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-dahdiras.patch
new file mode 100644
index 000000000000..74f35394909c
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-dahdiras.patch
@@ -0,0 +1,19 @@
+diff -uNr asterisk-1.6.0.6.ORIG/apps/app_dahdiras.c asterisk-1.6.0.6/apps/app_dahdiras.c
+--- asterisk-1.6.0.6.ORIG/apps/app_dahdiras.c 2009-03-03 15:20:24.000000000 +0000
++++ asterisk-1.6.0.6/apps/app_dahdiras.c 2009-02-24 18:05:03.000000000 +0000
+@@ -42,13 +42,13 @@
+ #include <signal.h>
+ #endif /* __linux__ */
+
++#include <dahdi/user.h>
++
+ #include <fcntl.h>
+ #ifdef HAVE_CAP
+ #include <sys/capability.h>
+ #endif /* HAVE_CAP */
+
+-#include <dahdi/user.h>
+-
+ #include "asterisk/lock.h"
+ #include "asterisk/file.h"
+ #include "asterisk/channel.h"
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-imap-kerberos.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-imap-kerberos.patch
new file mode 100644
index 000000000000..74fc91b9dd22
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-imap-kerberos.patch
@@ -0,0 +1,17 @@
+diff -uNr asterisk-1.6.0.6.ORIG/configure.ac asterisk-1.6.0.6/configure.ac
+--- asterisk-1.6.0.6.ORIG/configure.ac 2009-03-10 23:00:03.000000000 +0000
++++ asterisk-1.6.0.6/configure.ac 2009-03-10 22:58:59.000000000 +0000
+@@ -720,8 +720,11 @@
+ fi
+ imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
+ imap_include="-I${IMAP_TK_DIR}/c-client"
+- CPPFLAGS="${CPPFLAGS} ${imap_include}"
+- LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
++ CPPFLAGS="${CPPFLAGS} -I/usr/include/imap"
++ LIBS="${LIBS} /usr/lib/c-client.a -lssl -lpam"
++ if test -f /usr/bin/krb5-config; then
++ LIBS="${LIBS} "`/usr/bin/krb5-config --libs krb5 gssapi kadm-client kadm-server`
++ fi
+ AC_LINK_IFELSE(
+ AC_LANG_PROGRAM(
+ [#include "c-client.h"
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-parallelmake.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-parallelmake.patch
new file mode 100644
index 000000000000..761fb1fcdc2c
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-parallelmake.patch
@@ -0,0 +1,113 @@
+Index: asterisk-1.6.0.6/Makefile
+===================================================================
+--- asterisk-1.6.0.6.orig/Makefile
++++ asterisk-1.6.0.6/Makefile
+@@ -369,15 +369,15 @@ $(MOD_SUBDIRS_EMBED_LIBS):
+ @echo "EMBED_LIBS+="`$(SILENTMAKE) -C $(@:-embed-libs=) SUBDIR=$(@:-embed-libs=) __embed_libs` >> makeopts.embed_rules
+
+ $(MOD_SUBDIRS_MENUSELECT_TREE):
+- @$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
+- @$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
++ +@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) moduleinfo
++ +@$(SUBMAKE) -C $(@:-menuselect-tree=) SUBDIR=$(@:-menuselect-tree=) makeopts
+
+ makeopts.embed_rules: menuselect.makeopts
+ @echo "Generating embedded module rules ..."
+ @rm -f $@
+- @$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDSCRIPT)
+- @$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDFLAGS)
+- @$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LIBS)
++ +@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDSCRIPT)
++ +@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LDFLAGS)
++ +@$(SUBMAKE) $(MOD_SUBDIRS_EMBED_LIBS)
+
+ $(SUBDIRS): main/version.c include/asterisk/version.h include/asterisk/build.h include/asterisk/buildopts.h defaults.h makeopts.embed_rules
+
+@@ -400,10 +400,10 @@ res: main
+ endif
+
+ $(MOD_SUBDIRS):
+- @ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
++ +@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
+
+ $(OTHER_SUBDIRS):
+- @ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
++ +@ASTCFLAGS="$(OTHER_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" $(SUBMAKE) --no-builtin-rules -C $@ SUBDIR=$@ all
+
+ defaults.h: makeopts
+ @build_tools/make_defaults_h > $@.tmp
+@@ -431,10 +431,10 @@ include/asterisk/build.h:
+ @rm -f $@.tmp
+
+ $(SUBDIRS_CLEAN):
+- @$(SUBMAKE) -C $(@:-clean=) clean
++ +@$(SUBMAKE) -C $(@:-clean=) clean
+
+ $(SUBDIRS_DIST_CLEAN):
+- @$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
++ +@$(SUBMAKE) -C $(@:-dist-clean=) dist-clean
+
+ clean: $(SUBDIRS_CLEAN) _clean
+
+@@ -547,7 +547,7 @@ bininstall: _all installdirs $(SUBDIRS_I
+ fi
+
+ $(SUBDIRS_INSTALL):
+- @DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
++ +@DESTDIR="$(DESTDIR)" ASTSBINDIR="$(ASTSBINDIR)" $(SUBMAKE) -C $(@:-install=) install
+
+ NEWMODS:=$(foreach d,$(MOD_SUBDIRS),$(notdir $(wildcard $(d)/*.so)))
+ OLDMODS=$(filter-out $(NEWMODS),$(notdir $(wildcard $(DESTDIR)$(MODULES_DIR)/*.so)))
+@@ -796,7 +796,7 @@ cleantest:
+ @cmp -s .cleancount .lastclean || $(MAKE) clean
+
+ $(SUBDIRS_UNINSTALL):
+- @$(SUBMAKE) -C $(@:-uninstall=) uninstall
++ +@$(SUBMAKE) -C $(@:-uninstall=) uninstall
+
+ _uninstall: $(SUBDIRS_UNINSTALL)
+ rm -f $(DESTDIR)$(MODULES_DIR)/*
+@@ -842,7 +842,7 @@ gmenuconfig: gmenuselect
+ nmenuconfig: nmenuselect
+
+ menuselect: menuselect/cmenuselect menuselect/nmenuselect menuselect/gmenuselect
+- @if [ -x menuselect/nmenuselect ]; then \
++ +@if [ -x menuselect/nmenuselect ]; then \
+ $(MAKE) nmenuselect; \
+ elif [ -x menuselect/cmenuselect ]; then \
+ $(MAKE) cmenuselect; \
+@@ -867,27 +867,27 @@ nmenuselect: menuselect/nmenuselect menu
+ MAKE_MENUSELECT=CC="$(HOST_CC)" CXX="$(CXX)" LD="" AR="" RANLIB="" CFLAGS="" $(MAKE) -C menuselect CONFIGURE_SILENT="--silent"
+
+ menuselect/menuselect: menuselect/makeopts
+- $(MAKE_MENUSELECT) menuselect
++ +$(MAKE_MENUSELECT) menuselect
+
+ menuselect/cmenuselect: menuselect/makeopts
+- $(MAKE_MENUSELECT) cmenuselect
++ +$(MAKE_MENUSELECT) cmenuselect
+
+ menuselect/gmenuselect: menuselect/makeopts
+- $(MAKE_MENUSELECT) gmenuselect
++ +$(MAKE_MENUSELECT) gmenuselect
+
+ menuselect/nmenuselect: menuselect/makeopts
+- $(MAKE_MENUSELECT) nmenuselect
++ +$(MAKE_MENUSELECT) nmenuselect
+
+ menuselect/makeopts: makeopts
+- $(MAKE_MENUSELECT) makeopts
++ +$(MAKE_MENUSELECT) makeopts
+
+ menuselect-tree: $(foreach dir,$(filter-out main,$(MOD_SUBDIRS)),$(wildcard $(dir)/*.c) $(wildcard $(dir)/*.cc)) build_tools/cflags.xml build_tools/cflags-devmode.xml sounds/sounds.xml build_tools/embed_modules.xml configure
+ @echo "Generating input for menuselect ..."
+ @echo "<?xml version=\"1.0\"?>" > $@
+ @echo >> $@
+ @echo "<menu name=\"Asterisk Module and Build Option Selection\">" >> $@
+- @for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
+- @for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
++ +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} moduleinfo >> $@; done
++ +@for dir in $(sort $(filter-out main,$(MOD_SUBDIRS))); do $(SILENTMAKE) -C $${dir} SUBDIR=$${dir} makeopts >> $@; done
+ @cat build_tools/cflags.xml >> $@
+ @if [ "${AST_DEVMODE}" = "yes" ]; then \
+ cat build_tools/cflags-devmode.xml >> $@; \
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-sip-use-specified-port.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-sip-use-specified-port.patch
new file mode 100644
index 000000000000..bd55fe00656d
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-sip-use-specified-port.patch
@@ -0,0 +1,14 @@
+--- branches/1.6.0/channels/chan_sip.c 2009/03/09 20:14:05 180718
++++ branches/1.6.0/channels/chan_sip.c 2009/03/10 13:32:58 180799
+@@ -4175,6 +4175,11 @@
+ }
+ res = create_addr_from_peer(dialog, peer);
+ unref_peer(peer);
++ if (!ast_strlen_zero(port)) {
++ if ((portno = atoi(port))) {
++ dialog->sa.sin_port = dialog->recv.sin_port = htons(portno);
++ }
++ }
+ return res;
+ }
+
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-socket-details.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-socket-details.patch
new file mode 100644
index 000000000000..edbd6bf81f05
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-socket-details.patch
@@ -0,0 +1,69 @@
+--- branches/1.6.0/channels/chan_sip.c 2009/03/02 23:15:51 179473
++++ branches/1.6.0/channels/chan_sip.c 2009/03/09 20:14:05 180718
+@@ -2020,7 +2020,7 @@
+ static const struct sockaddr_in *sip_real_dst(const struct sip_pvt *p);
+ static void build_via(struct sip_pvt *p);
+ static int create_addr_from_peer(struct sip_pvt *r, struct sip_peer *peer);
+-static int create_addr(struct sip_pvt *dialog, const char *opeer);
++static int create_addr(struct sip_pvt *dialog, const char *opeer, int newdialog);
+ static char *generate_random_string(char *buf, size_t size);
+ static void build_callid_pvt(struct sip_pvt *pvt);
+ static void build_callid_registry(struct sip_registry *reg, struct in_addr ourip, const char *fromdomain);
+@@ -4149,7 +4149,7 @@
+ /*! \brief create address structure from peer name
+ * Or, if peer not found, find it in the global DNS
+ * returns TRUE (-1) on failure, FALSE on success */
+-static int create_addr(struct sip_pvt *dialog, const char *opeer)
++static int create_addr(struct sip_pvt *dialog, const char *opeer, int newdialog)
+ {
+ struct hostent *hp;
+ struct ast_hostent ahp;
+@@ -4169,7 +4169,11 @@
+ peer = find_peer(peername, NULL, 1, 0);
+
+ if (peer) {
+- int res = create_addr_from_peer(dialog, peer);
++ int res;
++ if (newdialog) {
++ dialog->socket.type = 0;
++ }
++ res = create_addr_from_peer(dialog, peer);
+ unref_peer(peer);
+ return res;
+ }
+@@ -9549,7 +9553,7 @@
+ p->outboundproxy = obproxy_get(p, NULL);
+
+ /* Find address to hostname */
+- if (create_addr(p, r->hostname)) {
++ if (create_addr(p, r->hostname, 0)) {
+ /* we have what we hope is a temporary network error,
+ * probably DNS. We need to reschedule a registration try */
+ sip_destroy(p);
+@@ -14236,7 +14240,7 @@
+ return CLI_FAILURE;
+ }
+
+- if (create_addr(p, a->argv[i])) {
++ if (create_addr(p, a->argv[i], 0)) {
+ /* Maybe they're not registered, etc. */
+ sip_destroy(p);
+ ast_cli(a->fd, "Could not create address for '%s'\n", a->argv[i]);
+@@ -16941,7 +16945,7 @@
+ if ((peerorhost = strchr(uri, ':'))) {
+ *peerorhost++ = '\0';
+ }
+- create_addr(p, peerorhost);
++ create_addr(p, peerorhost, 0);
+ ast_string_field_set(p, theirtag, NULL);
+ for (pkt = p->packets; pkt; pkt = pkt->next) {
+ if (pkt->seqno == p->icseq && pkt->method == SIP_INVITE) {
+@@ -20072,7 +20076,7 @@
+ ext = extension (user part of URI)
+ dnid = destination of the call (applies to the To: header)
+ */
+- if (create_addr(p, host)) {
++ if (create_addr(p, host, 1)) {
+ *cause = AST_CAUSE_UNREGISTERED;
+ ast_debug(3, "Cant create SIP call - target device not registered\n");
+ sip_destroy(p);
diff --git a/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-spandsp-api-change.patch b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-spandsp-api-change.patch
new file mode 100644
index 000000000000..8f05aab56a9b
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk-1.6.0.6-spandsp-api-change.patch
@@ -0,0 +1,42 @@
+--- branches/1.6.0/apps/app_fax.c 2009/02/20 21:41:54 177762
++++ branches/1.6.0/apps/app_fax.c 2009/02/20 21:56:39 177763
+@@ -161,6 +161,7 @@
+ char buf[20];
+ fax_session *s = (fax_session *) user_data;
+ t30_stats_t stat;
++ int pages_transferred;
+
+ ast_debug(1, "Fax phase E handler. result=%d\n", result);
+
+@@ -186,7 +187,12 @@
+ pbx_builtin_setvar_helper(s->chan, "FAXSTATUS", "SUCCESS");
+ pbx_builtin_setvar_helper(s->chan, "FAXERROR", NULL);
+ pbx_builtin_setvar_helper(s->chan, "REMOTESTATIONID", far_ident);
+- snprintf(buf, sizeof(buf), "%d", stat.pages_transferred);
++#if SPANDSP_RELEASE_DATE >= 20090220
++ pages_transferred = (s->direction) ? stat.pages_tx : stat.pages_rx;
++#else
++ pages_transferred = stat.pages_transferred;
++#endif
++ snprintf(buf, sizeof(buf), "%d", pages_transferred);
+ pbx_builtin_setvar_helper(s->chan, "FAXPAGES", buf);
+ snprintf(buf, sizeof(buf), "%d", stat.y_resolution);
+ pbx_builtin_setvar_helper(s->chan, "FAXRESOLUTION", buf);
+@@ -195,7 +201,7 @@
+
+ ast_debug(1, "Fax transmitted successfully.\n");
+ ast_debug(1, " Remote station ID: %s\n", far_ident);
+- ast_debug(1, " Pages transferred: %d\n", stat.pages_transferred);
++ ast_debug(1, " Pages transferred: %d\n", pages_transferred);
+ ast_debug(1, " Image resolution: %d x %d\n", stat.x_resolution, stat.y_resolution);
+ ast_debug(1, " Transfer Rate: %d\n", stat.bit_rate);
+
+@@ -215,7 +221,7 @@
+ S_OR(s->chan->cid.cid_num, ""),
+ far_ident,
+ local_ident,
+- stat.pages_transferred,
++ pages_transferred,
+ stat.y_resolution,
+ stat.bit_rate,
+ s->file_name);
diff --git a/net-misc/asterisk/files/1.6.0/asterisk.confd b/net-misc/asterisk/files/1.6.0/asterisk.confd
new file mode 100644
index 000000000000..576c32218d4e
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk.confd
@@ -0,0 +1,98 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.6.0/asterisk.confd,v 1.1 2009/03/10 23:33:27 chainsaw Exp $
+
+#
+# Additional options for asterisk
+#
+# see "asterisk -h" for a list of options
+#
+ASTERISK_OPTS=""
+
+#
+# User and group to run asterisk as
+#
+# Value: double-colon separated list of user and group, or empty to run as root:
+#
+#
+# "asterisk:asterisk" to run as user "asterisk" and group "asterisk"
+#
+# "asterisk" to run as user "asterisk" and all groups that user "asterisk" is a member of
+#
+# ":asterisk" to run as user "root" and group "asterisk"
+#
+# "" to run as user "root" and group "root"
+#
+ASTERISK_USER="asterisk"
+
+#
+# Nicelevel
+#
+# Set the priority of the asterisk process
+#
+# Value: (highest) -20..19 (lowest)
+#
+#ASTERISK_NICE="19"
+
+#
+# Wrapper script
+#
+# Value: yes or no/empty
+#
+ASTERISK_WRAPPER="no"
+
+############# Wrapper script settings #############
+
+#
+# Send crash notifications emails to this address
+# (needs a working mail service and /usr/sbin/sendmail to do so (e.g. ssmtp))
+#
+# Value: Email address or empty to disable
+#
+#ASTERISK_NOTIFY_EMAIL="root"
+
+#
+# Send asterisk's output to this terminal
+#
+# Value: Full path to device node or a number
+#
+#ASTERISK_TTY="/dev/tty9"
+
+#
+# Start an asterisk console on the terminal specified by ASTERISK_TTY
+#
+# Warning! Use only for debugging, this is a potential security issue!
+#
+# Value: yes or no/empty
+#
+ASTERISK_CONSOLE="no"
+
+#
+# Maximum size of core files.
+#
+# Value: Size in bytes, unlimited for no limit or empty to disable.
+#
+#ASTERISK_CORE_SIZE="unlimited"
+
+#
+# ASTERISK_CORE_DIR
+#
+# Value: Directory (will be created if non-existant), default is /tmp
+#
+ASTERISK_CORE_DIR="/var/lib/asterisk/coredump"
+
+#
+# Max number of filedescriptors
+#
+# Value: Number of descriptors
+#
+#ASTERISK_MAX_FD="1024"
+
+#
+# Kill these tasks after asterisk crashed (ASTERISK_WRAPPER=yes only!)
+#
+# Warning! This will kill _ALL_ tasks with the specified names!
+#
+# Value: Space separated list of names in double quotes (e.g. "mpg123 mad")
+#
+#ASTERISK_CLEANUP_ON_CRASH="mpg123 asterisk-mpg123 mad"
diff --git a/net-misc/asterisk/files/1.6.0/asterisk.rc6 b/net-misc/asterisk/files/1.6.0/asterisk.rc6
new file mode 100644
index 000000000000..e807706af506
--- /dev/null
+++ b/net-misc/asterisk/files/1.6.0/asterisk.rc6
@@ -0,0 +1,253 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.6.0/asterisk.rc6,v 1.1 2009/03/10 23:33:27 chainsaw Exp $
+
+opts="${opts} forcestop reload"
+
+depend() {
+ need net
+ use nscd dns zaptel mysql postgresql slapd capi
+}
+
+is_running() {
+ if [ -z "$(pidof asterisk)" ]; then
+ return 1
+ else
+ PID="$(cat /var/run/asterisk/asterisk.pid)"
+ for x in $(pidof asterisk); do
+ if [ "${x}" = "${PID}" ]; then
+ return 0
+ fi
+ done
+ fi
+
+ return 1
+}
+
+asterisk_run_loop() {
+ local OPTS ARGS MSG NICE=""
+ local result=0 signal=0
+
+ # default options
+ OPTS="-f" # don't fork / detach breaks wrapper script...
+
+ # filter (redundant) arguments
+ ARGS="$(echo "${@}" | sed -e "s:-c\|-f::g")"
+
+ # mangle yes/no options
+ ASTERISK_CONSOLE="$(echo ${ASTERISK_CONSOLE} | tr '[:lower:]' '[:upper:]')"
+
+ if [ -n "${ASTERISK_CORE_SIZE}" ] &&
+ [ "${ASTERISK_CORE_SIZE}" != "0" ]; then
+ ulimit -c ${ASTERISK_CORE_SIZE}
+
+ if [ -n "${ASTERISK_CORE_DIR}" ] && \
+ [ ! -d "${ASTERISK_CORE_DIR}" ]
+ then
+ mkdir -m750 -p "${ASTERISK_CORE_DIR}"
+
+ if [ -n "${ASTERISK_USER}" ]; then
+ chown -R "${ASTERISK_USER}" "${ASTERISK_CORE_DIR}"
+ fi
+ fi
+ ASTERISK_CORE_DIR="${ASTERISK_CORE_DIR:-/tmp}"
+
+ cd "${ASTERISK_CORE_DIR}"
+ echo " Core dump size : ${ASTERISK_CORE_SIZE}"
+ echo " Core dump location : ${ASTERISK_CORE_DIR}"
+ fi
+
+ if [ -n "${ASTERISK_MAX_FD}" ]; then
+ ulimit -n ${ASTERISK_MAX_FD}
+ echo " Max open filedescriptors : ${ASTERISK_MAX_FD}"
+ fi
+
+ if [ -n "${ASTERISK_NICE}" ]; then
+ echo " Nice level : ${ASTERISK_NICE}"
+ NICE="nice -n ${ASTERISK_NICE} --"
+ fi
+
+ if [ -n "${ASTERISK_NOTIFY_EMAIL}" ]; then
+ if [ -x /usr/sbin/sendmail ]; then
+ echo " Email notifications go to : ${ASTERISK_NOTIFY_EMAIL}"
+ else
+ echo " Notifications disabled, /usr/sbin/sendmail doesn't exist or is not executable!"
+ unset ASTERISK_NOTIFY_EMAIL
+ fi
+ fi
+
+ if [ -n "${ASTERISK_TTY}" ]; then
+ for x in ${ASTERISK_TTY} \
+ /dev/tty${ASTERISK_TTY} \
+ /dev/vc/${ASTERISK_TTY}
+ do
+ if [ -c "${x}" ]; then
+ TTY="${x}"
+ fi
+ done
+ [ -n "${TTY}" ] && \
+ echo " Messages are sent to : ${TTY}"
+ fi
+
+ if [ "${ASTERISK_CONSOLE}" = "YES" ] && [ -n "${TTY}" ]; then
+ echo " Starting Asterisk console : ${ASTERISK_CONSOLE}"
+ OPTS="${OPTS} -c"
+ fi
+
+ OPTS="${OPTS} ${ARGS}"
+
+ while :; do
+
+ if [ -n "${TTY}" ]; then
+ /usr/bin/stty -F ${TTY} sane
+ ${NICE} /usr/sbin/asterisk ${OPTS} >${TTY} 2>&1 <${TTY}
+ result=$?
+ else
+ ${NICE} /usr/sbin/asterisk ${OPTS} &>/dev/null
+ result=$?
+ fi
+
+ if [ $result -eq 0 ]; then
+ echo "Asterisk terminated normally"
+ break
+ else
+ if [ $result -gt 128 ]; then
+ signal=$((result - 128))
+ MSG="Asterisk terminated with Signal: $signal"
+
+ CORE_TARGET="core-$(date "+%Y%m%d-%h%M%s")"
+
+ local CORE_DUMPED=0
+ if [ -f "${ASTERISK_CORE_DIR}/core" ]; then
+ mv "${ASTERISK_CORE_DIR}/core" \
+ "${ASTERISK_CORE_DIR}/${CORE_TARGET}"
+ CORE_DUMPED=1
+
+ elif [ -f "${ASTERISK_CORE_DIR}/core.${PID}" ]; then
+ mv "${ASTERISK_CORE_DIR}/core.${PID}" \
+ "${ASTERISK_CORE_DIR}/${CORE_TARGET}"
+ CORE_DUMPED=1
+
+ fi
+
+ [ $CORE_DUMPED -eq 1 ] && \
+ MSG="${MSG}\n\rCore dumped: ${ASTERISK_CORE_DIR}/${CORE_TARGET}"
+ else
+ MSG="Asterisk terminated with return code: $result"
+ fi
+
+ # kill left-over tasks
+ for X in ${ASTERISK_CLEANUP_ON_CRASH}; do
+ kill -9 $(pidof ${X});
+ done
+ fi
+
+ [ -n "${TTY}" ] \
+ && echo "${MSG}" >${TTY} \
+ || echo "${MSG}"
+
+
+ if [ -n "${ASTERISK_NOTIFY_EMAIL}" ] && \
+ [ -x /usr/sbin/sendmail ]; then
+ echo -e -n "Subject: Asterisk crashed\n\r${MSG}\n\r" |\
+ /usr/sbin/sendmail "${ASTERISK_NOTIFY_EMAIL}"
+ fi
+ sleep 5
+ echo "Restarting Asterisk..."
+ done
+ return 0
+}
+
+start() {
+ local OPTS USER GROUP PID
+ local tmp x
+
+ if [ -n "${ASTERISK_NICE}" ]; then
+ if [ ${ASTERISK_NICE} -ge -20 ] && \
+ [ ${ASTERISK_NICE} -le 19 ]; then
+ OPTS="--nicelevel ${ASTERISK_NICE}"
+ else
+ eerror "Nice value must be between -20 and 19"
+ return 1
+ fi
+ fi
+
+ if [ -n "${ASTERISK_USER}" ]; then
+ USER=$(echo $ASTERISK_USER | sed 's/:.*//')
+ GROUP=$(echo $ASTERISK_USER | awk -F: '/.*:.*/ { print $2 }')
+ if [ -n "${USER}" ]; then
+ ASTERISK_OPTS="${ASTERISK_OPTS} -U ${USER}"
+ fi
+ if [ -n "${GROUP}" ]; then
+ ASTERISK_OPTS="${ASTERISK_OPTS} -G ${GROUP}"
+ GROUP=":${GROUP}" # make it look nice...
+ fi
+ ebegin "Starting asterisk PBX (as ${USER}${GROUP})"
+ else
+ ebegin "Starting asterisk PBX (as root)"
+ fi
+
+ if [ "$(echo ${ASTERISK_WRAPPER} | tr '[:upper:]' '[:lower:]')" != "yes" ]; then
+ start-stop-daemon --start --exec /usr/sbin/asterisk \
+ ${OPTS} -- ${ASTERISK_OPTS}
+ result=$?
+ else
+ asterisk_run_loop ${ASTERISK_OPTS} 2>/dev/null &
+ result=$?
+ fi
+
+ if [ $result -eq 0 ]; then
+ # 2 seconds should be enough for asterisk to start
+ sleep 2
+ is_running
+ result=$?
+ fi
+
+ eend $result
+}
+
+forcestop() {
+ ebegin "Stopping asterisk PBX"
+ start-stop-daemon --stop --pidfile /var/run/asterisk/asterisk.pid
+ eend $?
+}
+
+stop() {
+ if ! is_running; then
+ eerror "Asterisk is not running!"
+ return 0
+ fi
+
+ ebegin "Stopping asterisk PBX gracefully"
+ /usr/sbin/asterisk -r -x "stop gracefully" &>/dev/null
+ # Now we have to wait until asterisk has _really_ stopped.
+ sleep 1
+ if is_running; then
+ einfon "Waiting for asterisk to shutdown ."
+ local cnt=0
+ while is_running; do
+ cnt=`expr $cnt + 1`
+ if [ $cnt -gt 60 ] ; then
+ # Waited 120 seconds now. Fail.
+ echo
+ eend 1 "Failed."
+ return
+ fi
+ sleep 2
+ echo -n "."
+ done
+ echo
+ fi
+ eend 0
+}
+
+reload() {
+ if is_running; then
+ ebegin "Forcing asterisk to reload configuration"
+ /usr/sbin/asterisk -r -x "reload" &>/dev/null
+ eend $?
+ else
+ eerror "Asterisk is not running!"
+ fi
+}
diff --git a/net-misc/asterisk/metadata.xml b/net-misc/asterisk/metadata.xml
index 7ba0d74d8d96..0ee428399413 100644
--- a/net-misc/asterisk/metadata.xml
+++ b/net-misc/asterisk/metadata.xml
@@ -3,16 +3,21 @@
<pkgmetadata>
<herd>voip</herd>
<maintainer>
- <email>rajiv@gentoo.org</email>
- <name>Rajiv Aaron Manglani</name>
+ <email>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
</maintainer>
<use>
- <flag name="pri">Enables pri support</flag>
- <flag name="zaptel">Enables zaptel support</flag>
+ <flag name="pri">Enables pri support</flag>
+ <flag name="zaptel">Enables deprecated zaptel support (use dahdi if available)</flag>
<flag name="bri">Enable ISDN BRI support (bristuff)</flag>
<flag name="h323">Build the H.323 channel driver bundled with Asterisk</flag>
<flag name="lowmem">Build Asterisk for environments with low amounts of memory (embedded devices)</flag>
<flag name="nosamples">Don't install sample sound and configuration files</flag>
<flag name="osp">Enable support for the Open Settlement Protocol</flag>
+ <flag name="keepsrc">Install sources into /usr/src for custom patching</flag>
+ <flag name="misdn">Build with mISDN (chan_misdn) support for BRI ISDN cards</flag>
+ <flag name="newt">Include additional tools that require redhats windowing toolkit</flag>
+ <flag name="dahdi">Support Digium compatible hardware (formerly known as Zaptel).</flag>
+ <flag name="span">Enable support for the spandsp codec</flag>
</use>
</pkgmetadata>