diff options
author | Stefan Knoblich <stkn@gentoo.org> | 2006-04-16 01:04:44 +0000 |
---|---|---|
committer | Stefan Knoblich <stkn@gentoo.org> | 2006-04-16 01:04:44 +0000 |
commit | 549327d933a620b03ea109a6ba7d49358c3d963c (patch) | |
tree | 33c3ca484811a3cfe007b05a90a0c971789698bf /net-misc/asterisk | |
parent | Update gcc4 patch to fix compilation with gcc-4.1 as well; bug #125679 (diff) | |
download | historical-549327d933a620b03ea109a6ba7d49358c3d963c.tar.gz historical-549327d933a620b03ea109a6ba7d49358c3d963c.tar.bz2 historical-549327d933a620b03ea109a6ba7d49358c3d963c.zip |
New version, add experimental generic jitter buffer patch (use at your own risk), cleanups, add asterisk-updater script and check for asterisk-1.0.x modules after update, initgroups patch has been dropped (update your conf.d and init.d files!), add work-in-progress wrapper initscript.
Package-Manager: portage-2.0.54
Diffstat (limited to 'net-misc/asterisk')
-rw-r--r-- | net-misc/asterisk/ChangeLog | 12 | ||||
-rw-r--r-- | net-misc/asterisk/Manifest | 7 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.2.7_p1.ebuild | 529 | ||||
-rw-r--r-- | net-misc/asterisk/files/1.2.0/asterisk-updater | 146 | ||||
-rw-r--r-- | net-misc/asterisk/files/1.2.0/asterisk.confd | 98 | ||||
-rwxr-xr-x | net-misc/asterisk/files/1.2.0/asterisk.rc6 | 235 | ||||
-rw-r--r-- | net-misc/asterisk/files/digest-asterisk-1.2.7_p1 | 15 |
7 files changed, 1040 insertions, 2 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog index 536899173f7b..f405989fb26a 100644 --- a/net-misc/asterisk/ChangeLog +++ b/net-misc/asterisk/ChangeLog @@ -1,6 +1,16 @@ # 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.107 2006/03/13 21:53:22 stkn Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.108 2006/04/16 01:04:44 stkn Exp $ + +*asterisk-1.2.7_p1 (16 Apr 2006) + + 16 Apr 2006; Stefan Knoblich <stkn@gentoo.org> + +files/1.2.0/asterisk.confd, +files/1.2.0/asterisk.rc6, + +files/1.2.0/asterisk-updater, +asterisk-1.2.7_p1.ebuild: + New version, add experimental generic jitter buffer patch (use at your own + risk), cleanups, add asterisk-updater script and check for asterisk-1.0.x + modules after update, initgroups patch has been dropped (update your conf.d + and init.d files!), add work-in-progress wrapper initscript. 13 Mar 2006; Stefan Knoblich <stkn@gentoo.org> asterisk-1.2.4.ebuild: Getloadavg fix for uclibc is still necessary for >=asterisk-1.2.4 (jaervosz++). diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest index fbe494c6b862..7d49efcee7bf 100644 --- a/net-misc/asterisk/Manifest +++ b/net-misc/asterisk/Manifest @@ -1,4 +1,4 @@ -MD5 d5a4668a19536cb96c45533290e8c698 ChangeLog 21510 +MD5 aebbb80012ae2a29466b34b9733b0f8f ChangeLog 22006 MD5 5331ab3504762b397113ab2996b7ba61 asterisk-1.0.10-r1.ebuild 14665 MD5 5a641e52c52eded4766e31c8520fe83b asterisk-1.0.7-r2.ebuild 13672 MD5 f47f423dec3c8c0aaca9c4f117a8c5fc asterisk-1.0.7-r3.ebuild 13676 @@ -8,6 +8,7 @@ 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 09d2b6905923ef8beadadb6fc592d62c asterisk-1.2.7_p1.ebuild 13073 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 @@ -34,6 +35,9 @@ MD5 fe0af9ff2c4dea24a7c1d62754dee092 files/1.0.0/asterisk.rc6.sec 1230 MD5 ab552fbbe803766b5291d61942dbcd9f files/1.0.0/res_perl-1.0.7-bristuff-0.2.0.diff 860 MD5 3932983fb155e026eb10533425174f59 files/1.2.0/asterisk-1.2.0_beta-ukcid.patch 5787 MD5 18c24f2fcea3594b683d1c23643ad7b1 files/1.2.0/asterisk-1.2.1-uclibc-getloadavg.diff 317 +MD5 08c434a101bdfe7f558d1ef67c3336a9 files/1.2.0/asterisk-updater 2871 +MD5 1c243de2cb0b294af772955e7244dbc4 files/1.2.0/asterisk.confd 2200 +MD5 f1da7c89617ab1b859b6b87d69f729fc files/1.2.0/asterisk.rc6 5569 MD5 c4df1f7c307b1ed6df4b93df7c307e51 files/digest-asterisk-1.0.10-r1 771 MD5 48a3518349e2abfe20fa918a9db5eea2 files/digest-asterisk-1.0.7-r2 210 MD5 225681e768dff47ab88ef2cec2e4bac8 files/digest-asterisk-1.0.7-r3 768 @@ -43,4 +47,5 @@ MD5 e9e9701fad77824bcfdff1f02b9634e3 files/digest-asterisk-1.0.9-r3 768 MD5 770c431ec679210d12c9e486a2fc2e92 files/digest-asterisk-1.2.0 217 MD5 a129c7144790bae1af36d42252618118 files/digest-asterisk-1.2.1 306 MD5 f69ef36e0e37920142654d01e205cf28 files/digest-asterisk-1.2.4 306 +MD5 03e2e55422979c602afee0c184679bba files/digest-asterisk-1.2.7_p1 1421 MD5 488aea6fbdb7537394cc049b0ff9e5d5 metadata.xml 384 diff --git a/net-misc/asterisk/asterisk-1.2.7_p1.ebuild b/net-misc/asterisk/asterisk-1.2.7_p1.ebuild new file mode 100644 index 000000000000..163de7faf9cc --- /dev/null +++ b/net-misc/asterisk/asterisk-1.2.7_p1.ebuild @@ -0,0 +1,529 @@ +# 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.7_p1.ebuild,v 1.1 2006/04/16 01:04:44 stkn Exp $ + +inherit eutils + +IUSE="alsa bri curl debug doc genericjb gtk h323 hardened lowmem mmx mysql \ + nosamples odbc osp postgres pri speex sqlite ssl ukcid zaptel" + +#IUSE="alsa bri curl debug doc gtk genericjb h323 hardened lowmem mmx mysql \ +# nosamples odbc osp postgres pri speex sqlite ssl t38 ukcid zaptel" + +BRI_VERSION="0.3.0-PRE-1n" +AST_PATCHES="1.2.7-patches-1.0" +#T38_PATCHES="1.2.4-t38-20060216" +JB_PATCHES="1.2.5-genericjb-20060228" + +## NOTE: +# + +MY_P="${P/_p/.}" + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="http://www.asterisk.org/" +SRC_URI="http://ftp.digium.com/pub/asterisk/${MY_P}.tar.gz + http://www.netdomination.org/pub/asterisk/${PN}-${AST_PATCHES}.tar.bz2 + genericjb? ( http://www.netdomination.org/pub/asterisk/${PN}-${JB_PATCHES}.patch.gz ) + bri? ( http://www.netdomination.org/pub/asterisk/${MY_P}-bristuff-${BRI_VERSION}.diff.bz2 + http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )" + +# t38? ( http://www.netdomination.org/pub/asterisk/${PN}-${T38_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.2.2 ) + 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.5 ) + postgres? ( dev-db/postgresql ) + osp? ( >=net-libs/osptoolkit-3.3.4 ) + bri? ( >=net-libs/libpri-1.2.2 + >=net-misc/zaptel-1.2.5 )" + +DEPEND="${RDEPEND} + sys-devel/flex + sys-devel/bison + doc? ( app-doc/doxygen )" + + +# +# List of modules to ignore during scan (because they have been removed in 1.2.x) +# +SCAN_IGNORE_MODS=" + app_qcall + chan_modem + chan_modem_i4l + chan_modem_bestdata + chan_modme_aopen" + +# +# shortcuts +# +is_ast10update() { + return $(has_version "=net-misc/asterisk-1.0*") +} + +is_astupdate() { + if ! is_ast10update; then + return $(has_version "<net-misc/asterisk-${PV}") + fi + return 0 +} + +# +# Display a nice countdown... +# +countdown() { + local n + + ebeep + + n=${1:-10} + while [[ $n -gt 0 ]]; do + echo -en " Waiting $n second(s)...\r" + sleep 1 + (( n-- )) + done +} + +# +# Scan for asterisk-1.0.x modules that will have to be updated +# +scan_modules() { + local modules_list="" + local n + + for x in $(ls -1 ${ROOT}usr/lib/asterisk/modules/*.so); do + echo -en "Scanning.... $(basename ${x}) \r" + + # skip blacklisted modules + hasq $(basename ${x//.so}) ${SCAN_IGNORE_MODS} && continue + + if $(readelf -s "${x}" | grep -q "\(ast_load\|ast_destroy\)$"); then + modules_list="${modules_list} $(basename ${x//.so})" + fi + done + + if [[ -n "${modules_list}" ]]; then + echo " ========================================================" + ewarn "Please update or unmerge the following modules:" + echo + + n=0 + for x in ${modules_list}; do + ewarn " - ${x}" + (( n++ )) + done + + echo + ewarn "Warning: $n outdated module(s) found!" + ewarn "Warning: asterisk may not work if you don't update them!" + echo " ========================================================" + echo + einfo "You can use the \"asterisk-updater\" script to update the modules" + echo + countdown + echo + return 1 + else + einfo "No asterisk-1.0.x modules found!" + return 0 + fi +} + +pkg_setup() { + local checkfailed=0 waitaftermsg=0 + + if is_ast10update; then + ewarn " Asterisk UPGRADE Warning" + ewarn "" + ewarn "- Please read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz after the installation!" + ewarn "" + ewarn " Asterisk UPGRADE Warning" + echo + waitaftermsg=1 + fi + +# if use t38; then +# ewarn "********************** Experimental Feature **************************" +# ewarn "Please note that T.38 pass-through support is experimental and may not" +# ewarn "be included in newer versions!" +# echo +# waitaftermsg=1 +# fi + + if use genericjb; then + ewarn "********************** Experimental Feature **************************" + ewarn "Please note that generic jitterbuffer support is experimental and may not" + ewarn "be included in newer versions!" + echo + waitaftermsg=1 + fi + + if [[ $waitaftermsg -eq 1 ]]; then + einfo "Press Ctrl+C to abort" + echo + countdown + fi + + # + # Regular checks + # + einfo "Running some pre-flight checks..." + echo + + # check if zaptel has been compiled with ukcid too + if use ukcid; then + if ! built_with_use net-misc/zaptel ukcid; then + eerror "- ukcid: Re-emerge zaptel with \"ukcid\" useflag enabled!" + checkfailed=1 + fi + 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 "- bri: Re-emerge zaptel with \"bri\" useflag enabled!" + heckfailed=1 + fi + + if ! built_with_use net-libs/libpri bri; then + eerror "- bri: Re-emerge libpri with \"bri\" useflag enabled!" + checkfailed=1 + fi + fi + + # stop here if checks failed + [[ $checkfailed -eq 1 ]] && \ + die "Pre-flight check failed, see messages for more information!" +} + +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 ${WORKDIR}/${MY_P}-bristuff-${BRI_VERSION}.diff +# epatch ${S_BRI}/patches/asterisk.patch + fi + + # + # T.38 pass-through patch (asterisk bug #5090) + # +# if use t38; then +# einfo "T.38 experimental pass-through support (ast #5090)" +# epatch ${WORKDIR}/asterisk-${T38_PATCHES}-udptl.patch +# +# if use bri; then +# epatch ${WORKDIR}/asterisk-${T38_PATCHES}-bri.patch +# else +# epatch ${WORKDIR}/asterisk-${T38_PATCHES}-nobri.patch +# fi +# fi + + # + # Generic jitterbuffer (asterisk bug #3854) + # + if use genericjb; then + einfo "Generic jitterbuffer (ast #3854)" + epatch ${WORKDIR}/${PN}-${JB_PATCHES}.patch + + sed -i -e "s:^\(GENERIC_JB = \)#-DAST_JB:\1 -DAST_JB:" \ + Makefile + 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 bristuff capi + use bri && \ + rm -f ${D}usr/lib/asterisk/modules/{app,chan}_capi*.so 2>/dev/null + + # remove installed sample files if nosamples flag is set + if use nosamples; then + einfo "Skipping installation of sample files..." + 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 + + # move sample configuration files to doc directory + if is_ast10update; then + einfo "Updating from old (pre-1.2) asterisk version, new configuration files have been installed" + einfo "into ${ROOT}etc/asterisk, use etc-update or dispatch-conf to update them" + elif has_version "net-misc/asterisk"; then + einfo "Configuration samples have been moved to: $ROOT/usr/share/doc/${PF}/conf" + insinto /usr/share/doc/${PF}/conf + doins ${D}etc/asterisk/*.conf* /usr/share/doc/${PF}/conf + rm -f ${D}etc/asterisk/*.conf* 2>/dev/null + fi + + # don't delete these directories, even if they are empty + for x in voicemail meetme system dictate monitor 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.2.0/asterisk.rc6 asterisk + newconfd ${FILESDIR}/1.2.0/asterisk.confd 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 + + # install asterisk-updater + dosbin ${FILESDIR}/1.2.0/asterisk-updater +} + +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 1.0 -> 1.2 changes... + # + if is_ast10update; then + ewarn "" + ewarn "- Please read ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.gz before continuing" + ewarn "" + fi + + if is_astupdate; then + ewarn "" + ewarn " - The initgroups patch has been dropped, please update your" + ewarn " \"conf.d/asterisk\" and \"init.d/asterisk\" file!" + ewarn "" + fi + +# if use t38; then +# ewarn "********************** Experimental Feature **************************" +# ewarn "Please note that T.38 pass-through support is experimental and may not" +# ewarn "be included in newer versions!" +# echo +# fi + if use genericjb; then + ewarn "********************** Experimental Feature **************************" + ewarn "Please note that generic jitterbuffer support is experimental and may not" + ewarn "be included in newer versions!" + echo + fi + + # scan for old modules + if is_ast10update; then + einfo "Asterisk has been updated from pre-1.2.x, scanning for old modules" + scan_modules + 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=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.2.0/asterisk-updater b/net-misc/asterisk/files/1.2.0/asterisk-updater new file mode 100644 index 000000000000..309c48987d52 --- /dev/null +++ b/net-misc/asterisk/files/1.2.0/asterisk-updater @@ -0,0 +1,146 @@ +#!/bin/bash + +# +# +# +PORTDB_DIR="$(portageq vdb_path)" +PRETEND=0 +UPDATE=0 + +# +# +# +modules_list="" +ebuild_list="" + +pkgname() { + echo "${1%-[0-9.]*}" +} + +pkgver() { + echo "${1##$(pkgname "$1")-}" +} + +for x in $@; do + case ${x} in + *help|*h) + echo "Usage: $0 [EMERGE_OPTIONS|--help|-h]" + exit 0 + ;; + *pretend|*p) + PRETEND=1 + ;; + *update|*u) + UPDATE=1 + ;; + esac +done + +echo ">>> Scanning modules in /usr/lib/asterisk/modules..." + +# create list of modules +for x in $(ls -1 /usr/lib/asterisk/modules/*.so); do + + if $(readelf -s "${x}" | grep -q "\(ast_load\|ast_destroy\)$"); then + modules_list="${modules_list} $(basename ${x})" + fi +done + +if [[ -n "${modules_list}" ]]; then + echo ">>> Module(s) need to be updated, creating list..." + + # + # grab initial list of ebuilds + # + for x in ${modules_list}; do + package="$(grep -l "${x}" "${PORTDB_DIR}"/net-misc/*/CONTENTS | head -n 1 | sed -e "s:${PORTDB_DIR}/::" -e "s:/CONTENTS::")" + + [[ -n "${package}" ]] && \ + ebuild_list="${ebuild_list} ${package}" + done + + echo + echo ">>> Checking packages..." + + tmp_list="" + fail_list="" + for x in ${ebuild_list}; do + # strip version from package + pkgname="${x%-[0-9.]*}" + + if ! emerge -pq "=${x}" &>/dev/null; then + if ! emerge -pq ">${x}" &>/dev/null; then + + # ebuild is gone + fail_list="${fail_list} ${x}" + else + + # ebuild is available in a newer version, + # add it to the update list + update_list="${update_list} ${x}" + fi + else + if [[ $UPDATE -eq 1 ]]; then + # user wants to update all ebuilds... + if emerge -pq ">${x}" &>/dev/null; then + + # add ebuild without version information to the update list + update_list="${update_list} ${x}" + continue + fi + fi + + tmp_list="${tmp_list} =${x}" + fi + done + + echo + + if [[ -n "${fail_list}" ]]; then + echo + echo "!!! The following ebuild(s) need to be updated manually:" + for x in ${fail_list}; do + echo " $(pkgname "${x}")" + done + echo + fi + + if [[ $UPDATE -eq 0 ]] && [[ -n "${update_list}" ]] + then + # display list of packages and ask user what to do + echo "!!! The following ebuilds are only available in newer versions:" + echo + for x in ${update_list}; do + echo " $(pkgname "${x}")" + done + echo + echo -n "--- Do you want to update them (y/N)? " + read tmp + + tmp="$(echo "${tmp}" | tr "[[:upper:]]" "[[:lower:]]")" + if [[ "${tmp}" != "y" ]]; then + echo ">>> NOT updating ebuilds" + unset update_list + fi + fi + + if [[ -n "${update_list}" ]]; then + # simply copy update list to merge list + echo ">>> Adding list of ebuilds to update..." + for x in ${update_list}; do + tmp_list="${tmp_list} $(pkgname "${x}")" + done + fi + + if [[ -n "${tmp_list}" ]]; then + echo ">>> Feeding list of ebuilds to emerge $@..." + emerge ${tmp_list} $@ + else + echo -e "*** Nothing to emerge..." + fi +else + echo "*** No asterisk-1.0.x modules found!" +fi + +echo +exit 0 diff --git a/net-misc/asterisk/files/1.2.0/asterisk.confd b/net-misc/asterisk/files/1.2.0/asterisk.confd new file mode 100644 index 000000000000..c25ee0050ff9 --- /dev/null +++ b/net-misc/asterisk/files/1.2.0/asterisk.confd @@ -0,0 +1,98 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.2.0/asterisk.confd,v 1.1 2006/04/16 01:04:44 stkn 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.2.0/asterisk.rc6 b/net-misc/asterisk/files/1.2.0/asterisk.rc6 new file mode 100755 index 000000000000..f2f0471e2ee1 --- /dev/null +++ b/net-misc/asterisk/files/1.2.0/asterisk.rc6 @@ -0,0 +1,235 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.2.0/asterisk.rc6,v 1.1 2006/04/16 01:04:44 stkn Exp $ + +opts="${opts} forcestop reload" + +depend() { + need net + use 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="/bin/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=${ASTERISK_USER/:*/} + 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} + else + asterisk_run_loop ${ASTERISK_OPTS} 2>/dev/null & + fi + + if [[ $result -eq 0 ]]; then + # 2 seconds should be enough for asterisk to start + sleep 2 + + result=$(is_running) + fi + + eend $result +} + +forcestop() { + ebegin "Stopping asterisk PBX" + start-stop-daemon --stop --pidfile /var/run/asterisk/asterisk.pid + eend $? +} + +stop() { + + if is_running; then + ebegin "Stopping asterisk PBX gracefully" + /usr/sbin/asterisk -r -x "stop gracefully" &>/dev/null + [[ $? -eq 0 ]] && svc_stop + eend + else + + eerror "Asterisk is not running!" + fi +} + +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/files/digest-asterisk-1.2.7_p1 b/net-misc/asterisk/files/digest-asterisk-1.2.7_p1 new file mode 100644 index 000000000000..c003fb1aa407 --- /dev/null +++ b/net-misc/asterisk/files/digest-asterisk-1.2.7_p1 @@ -0,0 +1,15 @@ +MD5 7d1509b8871dc21598644d15eeb5dec5 asterisk-1.2.5-genericjb-20060228.patch.gz 14864 +RMD160 857811e1882d3a9b88cd3e511eb5b0cdaa9a0a40 asterisk-1.2.5-genericjb-20060228.patch.gz 14864 +SHA256 eb95782962cd158e5ced8342e0822fd3d9c196c07c5465aab8c549acc2eb4acb asterisk-1.2.5-genericjb-20060228.patch.gz 14864 +MD5 1658bc78dd14c1f6cf4885f581c62143 asterisk-1.2.7-patches-1.0.tar.bz2 8330 +RMD160 1e699108a1016f9c2e0291c02638c750ff9465e9 asterisk-1.2.7-patches-1.0.tar.bz2 8330 +SHA256 4e3f69063d160edef35ade7e86f2a7d5408c6937d4c7487c6ed6043fb3c12d2c asterisk-1.2.7-patches-1.0.tar.bz2 8330 +MD5 a00cfbd2b80f64a01eaab23735285c18 asterisk-1.2.7.1-bristuff-0.3.0-PRE-1n.diff.bz2 81710 +RMD160 1ab7df2785fc7fd7859f7e55cc1ab643519249bf asterisk-1.2.7.1-bristuff-0.3.0-PRE-1n.diff.bz2 81710 +SHA256 8e6e00e4273a7d96bde834c872b598f18e3328c01172940975fa93bf726f70b6 asterisk-1.2.7.1-bristuff-0.3.0-PRE-1n.diff.bz2 81710 +MD5 5c4b473eee2fbc2cb9e346f0564ef970 asterisk-1.2.7.1.tar.gz 10554037 +RMD160 28c1d5c3ac6db52d7d315f59d391a655b77338fd asterisk-1.2.7.1.tar.gz 10554037 +SHA256 c561ec886a779a59c78cbeffda457f2a07535ddceb371561c54adc6ee60d984a asterisk-1.2.7.1.tar.gz 10554037 +MD5 a0c78e7676acbc06b26d2c68ef3e0c86 bristuff-0.3.0-PRE-1n.tar.gz 248488 +RMD160 3da3043a88551578b4495ae8e54ffb6a4f3bfd2c bristuff-0.3.0-PRE-1n.tar.gz 248488 +SHA256 31b894bdd2741e309dfed23963db1cda3d74a8d616de8df9f1281b5558aa27f1 bristuff-0.3.0-PRE-1n.tar.gz 248488 |