Fix multiple bugs: #111095, #135300, #148054, #148309, #148853, #152303 and #153656.
authorAlin Năstac <mrness@gentoo.org>
Thu, 2 Nov 2006 15:05:39 +0000 (15:05 +0000)
committerAlin Năstac <mrness@gentoo.org>
Thu, 2 Nov 2006 15:05:39 +0000 (15:05 +0000)
Package-Manager: portage-2.1.1

net-misc/asterisk/ChangeLog
net-misc/asterisk/Manifest
net-misc/asterisk/asterisk-1.2.13-r1.ebuild [new file with mode: 0644]
net-misc/asterisk/files/1.2.0/asterisk-1.2.13-memleaks.diff [new file with mode: 0644]
net-misc/asterisk/files/1.2.0/asterisk.rc6
net-misc/asterisk/files/digest-asterisk-1.2.13-r1 [new file with mode: 0644]

index 78dcb565b7db7e3e06bf04654d2190581eda3946..191ea5d56d8b62ac4e80e205b1d584bbf46212ab 100644 (file)
@@ -1,6 +1,13 @@
 # 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.132 2006/10/20 18:42:45 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.133 2006/11/02 15:05:39 mrness Exp $
+
+*asterisk-1.2.13-r1 (02 Nov 2006)
+
+  02 Nov 2006; Alin Nastac <mrness@gentoo.org> files/1.2.0/asterisk.rc6,
+  +files/1.2.0/asterisk-1.2.13-memleaks.diff, +asterisk-1.2.13-r1.ebuild:
+  Fix multiple bugs: #111095, #135300, #148054, #148309, #148853, #152303 and
+  #153656.
 
   20 Oct 2006; Gustavo Zacarias <gustavoz@gentoo.org>
   asterisk-1.2.13.ebuild:
index b7ac434ac34c923054ca26b225b41ad915c8dca9..8a88adbd9e2805ec570d85cb3245b77add468d88 100644 (file)
@@ -113,6 +113,10 @@ AUX 1.2.0/asterisk-1.2.1-uclibc-getloadavg.diff 317 RMD160 f598d94a52cec83fefdaf
 MD5 18c24f2fcea3594b683d1c23643ad7b1 files/1.2.0/asterisk-1.2.1-uclibc-getloadavg.diff 317
 RMD160 f598d94a52cec83fefdafdce0694049c657e09e0 files/1.2.0/asterisk-1.2.1-uclibc-getloadavg.diff 317
 SHA256 61daa70727418dbaf232fc5d1eaddd20a8505b943b8fb724a1b63170edfe88cc files/1.2.0/asterisk-1.2.1-uclibc-getloadavg.diff 317
+AUX 1.2.0/asterisk-1.2.13-memleaks.diff 374 RMD160 7bf17c2b3123f75e1c1aa5ca78f7e4631071c9ff SHA1 5a2257e4225e6c9915590a29b52fe87acb45cda2 SHA256 234cd56492927c60ec29f0c0cf52e49b8ba35ed4a423df4250b68c269e72632c
+MD5 376ebb3345dc0910966e60a559f80653 files/1.2.0/asterisk-1.2.13-memleaks.diff 374
+RMD160 7bf17c2b3123f75e1c1aa5ca78f7e4631071c9ff files/1.2.0/asterisk-1.2.13-memleaks.diff 374
+SHA256 234cd56492927c60ec29f0c0cf52e49b8ba35ed4a423df4250b68c269e72632c files/1.2.0/asterisk-1.2.13-memleaks.diff 374
 AUX 1.2.0/asterisk-updater 3127 RMD160 41ea584081c3e565205e59771e24a8715d7e2042 SHA1 1c11d9ce286972b6f98c15a16cbb7f1c943414eb SHA256 93e6862361a320c7f7f30525b4209366190dd2bc21eedbd3654ffb4b991af5fd
 MD5 b3b1dced30f74b9475ca7d3a8155385d files/1.2.0/asterisk-updater 3127
 RMD160 41ea584081c3e565205e59771e24a8715d7e2042 files/1.2.0/asterisk-updater 3127
@@ -121,10 +125,10 @@ AUX 1.2.0/asterisk.confd 2200 RMD160 f26ac9b18e8c1db86c54839d9b4a816cfe45c61f SH
 MD5 1c243de2cb0b294af772955e7244dbc4 files/1.2.0/asterisk.confd 2200
 RMD160 f26ac9b18e8c1db86c54839d9b4a816cfe45c61f files/1.2.0/asterisk.confd 2200
 SHA256 b94a59f36a46362622acd2ccc811e1e9dd0abf928104285c7098d7c17a324379 files/1.2.0/asterisk.confd 2200
-AUX 1.2.0/asterisk.rc6 5569 RMD160 206738a08fbc74a43a72fbaa0138299c1d6766e8 SHA1 430d9c19920c12f59f2558eb947a6add056fd1b4 SHA256 471c3f8b3d1f4b7d3281b71f75c7857d595a676380abbc96fb86d47b1252bc82
-MD5 f1da7c89617ab1b859b6b87d69f729fc files/1.2.0/asterisk.rc6 5569
-RMD160 206738a08fbc74a43a72fbaa0138299c1d6766e8 files/1.2.0/asterisk.rc6 5569
-SHA256 471c3f8b3d1f4b7d3281b71f75c7857d595a676380abbc96fb86d47b1252bc82 files/1.2.0/asterisk.rc6 5569
+AUX 1.2.0/asterisk.rc6 5899 RMD160 fc875d84dbbd0dccad7feb1f7c2499bf72583fb7 SHA1 2d944831bb30e9f1b86eeca7209dedc725515795 SHA256 529753222748945cdcbcf8876fb9db602903b1df2b1e6ed5e6af5e7ee3f350de
+MD5 3d883819e3392add7e5fec5b723f6d15 files/1.2.0/asterisk.rc6 5899
+RMD160 fc875d84dbbd0dccad7feb1f7c2499bf72583fb7 files/1.2.0/asterisk.rc6 5899
+SHA256 529753222748945cdcbcf8876fb9db602903b1df2b1e6ed5e6af5e7ee3f350de files/1.2.0/asterisk.rc6 5899
 DIST asterisk-1.0.11.1.tar.gz 9642342 RMD160 052732640d4e7aac61a03443affaa348bd7002c8 SHA1 3c9878adbf8d0258a9baf130a78729e15afa2adc SHA256 7290dc98ffba348eeecf98d01a8939d72fee03737af2cefb0fb851a48c47c061
 DIST asterisk-1.2.11-jb.patch.bz2 15598 RMD160 cbf4a95e25bf03a41ebef2a726419299494bb298 SHA1 2302b0ff346f0efad8f1b7104be583edeb44ee5a SHA256 e85e438cb88993a188d063582f38eff0efc1b727e47d9f71809ee81d19992946
 DIST asterisk-1.2.11-patches-1.0.tar.bz2 7432 RMD160 b840a16b6ae9ffb1e76da4a7a8129916e1710204 SHA1 9c80d334097a4493e10a89b5b9e7958696019590 SHA256 46d198be655b35383725dde72ed82ecc7767b8009356f88d27c763323d1cdaa8
@@ -143,14 +147,18 @@ EBUILD asterisk-1.2.12.1.ebuild 12715 RMD160 820a816b7abe13a4725dd708829ad2f3733
 MD5 b9e92b5368ccf88afeb96b84979f305b asterisk-1.2.12.1.ebuild 12715
 RMD160 820a816b7abe13a4725dd708829ad2f37337edda asterisk-1.2.12.1.ebuild 12715
 SHA256 099aff0be9975f8c222a512bee1a9a4c9365e8958ff8d5568a11fcea7eb02b4c asterisk-1.2.12.1.ebuild 12715
+EBUILD asterisk-1.2.13-r1.ebuild 12087 RMD160 07d2be6218a8de124597d473da573c7d33145d66 SHA1 cc6ca6bad08666ee0e6462882402a53b97273ef1 SHA256 aff75460c66f6b8e5146110838a20994f2898ab8468b80339c5708dce69fa1e4
+MD5 9e0cc6cd0079ea5aee2d393880e80883 asterisk-1.2.13-r1.ebuild 12087
+RMD160 07d2be6218a8de124597d473da573c7d33145d66 asterisk-1.2.13-r1.ebuild 12087
+SHA256 aff75460c66f6b8e5146110838a20994f2898ab8468b80339c5708dce69fa1e4 asterisk-1.2.13-r1.ebuild 12087
 EBUILD asterisk-1.2.13.ebuild 12227 RMD160 0f09d18b3d1a890c7e26cbf1b2345530366a4378 SHA1 b69fc03dadaeeccc017cc5ede16d186e3ca3296d SHA256 a5d22c28f36fd0f2fbec948c08dcaf165319ebc469fdca3171374ac45153391e
 MD5 9d15844492415c181ceb33ffd002d8fa asterisk-1.2.13.ebuild 12227
 RMD160 0f09d18b3d1a890c7e26cbf1b2345530366a4378 asterisk-1.2.13.ebuild 12227
 SHA256 a5d22c28f36fd0f2fbec948c08dcaf165319ebc469fdca3171374ac45153391e asterisk-1.2.13.ebuild 12227
-MISC ChangeLog 26174 RMD160 00b453099852b99294032078fba3b21d035ca26d SHA1 b5d1e9d60cad4607cfecb274233b4559ed4e972f SHA256 e85e9b462c28bd607241572b63421da6212e91d9389bbb8298fc8a5f3cc7a83b
-MD5 a373c59494d770691dc2f9d406699cc5 ChangeLog 26174
-RMD160 00b453099852b99294032078fba3b21d035ca26d ChangeLog 26174
-SHA256 e85e9b462c28bd607241572b63421da6212e91d9389bbb8298fc8a5f3cc7a83b ChangeLog 26174
+MISC ChangeLog 26444 RMD160 5531f00589e1000b84568ceb588bf142735e878b SHA1 9b23d7de667708b87222ce08edd796aa72b410ab SHA256 f06dc7246ff154826a60e11265a722edab7c77d57ebcf066ad2a73540df8d9b5
+MD5 7e27475eab3c8ed9ddfd770d2233a6de ChangeLog 26444
+RMD160 5531f00589e1000b84568ceb588bf142735e878b ChangeLog 26444
+SHA256 f06dc7246ff154826a60e11265a722edab7c77d57ebcf066ad2a73540df8d9b5 ChangeLog 26444
 MISC metadata.xml 384 RMD160 f5de78add5676233b8e0b9e111eab08970443582 SHA1 0441844fb3a715d6979e6c548147ada23d73fec2 SHA256 674224368cb2be6f72655cd67ee19d4d2d0f3425d560aff22b698269e0adc6d8
 MD5 488aea6fbdb7537394cc049b0ff9e5d5 metadata.xml 384
 RMD160 f5de78add5676233b8e0b9e111eab08970443582 metadata.xml 384
@@ -164,10 +172,13 @@ SHA256 c3fd92c253e1b0f2637ad85131170debe3a995666f1e01a0517a9fa8c1e3123e files/di
 MD5 041ef49546f5e16e3bd5fd5ff0719f70 files/digest-asterisk-1.2.13 1376
 RMD160 782b59125ab61b4e40f284bbf830bd1fe10b1d47 files/digest-asterisk-1.2.13 1376
 SHA256 63571a9178e245b14ca367735b833b0d1700e4e2595c3d7694df7e0d5bd3fe9f files/digest-asterisk-1.2.13 1376
+MD5 041ef49546f5e16e3bd5fd5ff0719f70 files/digest-asterisk-1.2.13-r1 1376
+RMD160 782b59125ab61b4e40f284bbf830bd1fe10b1d47 files/digest-asterisk-1.2.13-r1 1376
+SHA256 63571a9178e245b14ca367735b833b0d1700e4e2595c3d7694df7e0d5bd3fe9f files/digest-asterisk-1.2.13-r1 1376
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.5-ecc0.1.6 (GNU/Linux)
+Version: GnuPG v1.4.5 (GNU/Linux)
 
-iD8DBQFFORiuKRy60XGEcJIRAuGUAJ0WlqorRzZ7o3n95IUUfsWpKydGCwCfU05v
-hIbC+8xWTy+PlI0LeRWkyVQ=
-=lYfI
+iD8DBQFFSglU3sf9c6kjmR8RAs0BAKCQCAIo2gAeQOtHX/+xBaGr1FaXFACbBLWM
+nvm0PBccV2Tw8Lv47IeuLko=
+=gw2i
 -----END PGP SIGNATURE-----
diff --git a/net-misc/asterisk/asterisk-1.2.13-r1.ebuild b/net-misc/asterisk/asterisk-1.2.13-r1.ebuild
new file mode 100644 (file)
index 0000000..0d21bb0
--- /dev/null
@@ -0,0 +1,482 @@
+# 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.13-r1.ebuild,v 1.1 2006/11/02 15:05:39 mrness Exp $
+
+inherit eutils multilib
+
+IUSE="alsa bri curl debug doc gtk genericjb h323 hardened lowmem mmx \
+       nosamples odbc osp postgres pri speex sqlite ssl ukcid zaptel \
+       elibc_uclibc"
+
+BRI_VERSION="0.3.0-PRE-1s"
+AST_PATCHES="1.2.11-patches-1.0"
+JB_PATCHES="1.2.11-jb"
+
+## NOTE:
+#
+# - t.38 dropped
+#
+
+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/releases/${MY_P}.tar.gz
+        http://www.netdomination.org/pub/asterisk/${PN}-${AST_PATCHES}.tar.bz2
+        bri? ( http://gentooexperimental.org/~genstef/dist/${MY_P}-bristuff-${BRI_VERSION}.diff.bz2
+               http://www.junghanns.net/downloads/bristuff-${BRI_VERSION}.tar.gz )
+        genericjb? ( http://www.netdomination.org/pub/asterisk/${PN}-${JB_PATCHES}.patch.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
+       ssl? ( dev-libs/openssl )
+       gtk? ( =x11-libs/gtk+-1.2* )
+       pri? ( >=net-libs/libpri-1.2.3 )
+       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 )
+       speex? ( media-libs/speex )
+       sqlite? ( <dev-db/sqlite-3.0.0 )
+       zaptel? ( >=net-misc/zaptel-1.2.8 )
+       dev-db/libpq
+       postgres? ( dev-db/postgresql )
+       osp? ( >=net-libs/osptoolkit-3.3.4 )
+       bri? (  >=net-libs/libpri-1.2.3-r1
+               >=net-misc/zaptel-1.2.8 )"
+
+DEPEND="${RDEPEND}
+       sys-devel/flex
+       sys-devel/bison
+       doc? ( app-doc/doxygen )"
+
+#asterisk uses special mpg123 functions and does not work with mpeg321, bug #42703
+PDEPEND="|| ( media-sound/mpg123 net-misc/asterisk-addons )"
+
+#
+# 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/$(get_libdir)/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 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 has_version net-misc/zaptel && ! built_with_use net-misc/zaptel ukcid; then
+                       eerror "- ukcid: Re-emerge zaptel with \"ukcid\" useflag enabled!"
+                       checkfailed=1
+               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
+       epatch "${FILESDIR}"/1.2.0/${PN}-1.2.13-memleaks.diff
+
+       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
+
+       #
+       # Generic jitterbuffer (asterisk bug #3854)
+       #
+       if use genericjb; then
+               einfo "Generic jitterbuffer (ast #3854, full patch available on http://www.asterisk-backports.org/)"
+#              epatch "${WORKDIR}"/ast_jb-${JB_PATCHES}.patch
+               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}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" install || die "Make install failed"
+       make DESTDIR="${D}" ASTLIBDIR="\$(INSTALL_PREFIX)/usr/$(get_libdir)/asterisk" samples || die "Failed to create sample files"
+
+       # remove bristuff capi
+       use bri && \
+               rm -f "${D}"usr/$(get_libdir)/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*
+               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 astxs
+       dobin  contrib/scripts/astxs
+
+       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
+
+       # make sure misdn/capi stuff is not installed, provided by asterisk-chan_..
+       rm -f "${D}"/etc/asterisk/misdn.conf "${D}"/usr/lib/asterisk/modules/chan_misdn.so \
+               "${D}"/usr/share/doc/${PF}/{conf/misdn.conf,configs/misdn.conf.sample.gz,README.misdn.gz}
+       rm -f "${D}"/usr/include/asterisk/chan_capi{,_app}.h \
+               "${D}"/usr/share/doc/${PF}/{conf/capi.conf,configs/capi.conf.sample.gz}
+}
+
+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 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-1.2.13-memleaks.diff b/net-misc/asterisk/files/1.2.0/asterisk-1.2.13-memleaks.diff
new file mode 100644 (file)
index 0000000..cf3a8cd
--- /dev/null
@@ -0,0 +1,11 @@
+diff -Nru asterisk-1.2.13.orig/callerid.c asterisk-1.2.13/callerid.c
+--- asterisk-1.2.13.orig/callerid.c    2006-06-06 19:02:43.000000000 +0300
++++ asterisk-1.2.13/callerid.c 2006-11-02 15:05:50.000000000 +0200
+@@ -280,6 +280,7 @@
+               buf += (olen - mylen);
+               if (res < 0) {
+                       ast_log(LOG_NOTICE, "fsk_serie failed\n");
++                      free(obuf);
+                       return -1;
+               }
+               if (res == 1) {
index f2f0471e2ee119b6ded63bb611f914a0eddd03c7..168be13951a5dd03d965f9b59cefcb614cfc3980 100755 (executable)
@@ -1,7 +1,7 @@
 #!/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 $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/files/1.2.0/asterisk.rc6,v 1.2 2006/11/02 15:05:39 mrness Exp $
 
 opts="${opts} forcestop reload"
 
@@ -212,16 +212,32 @@ forcestop() {
 }
 
 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
-               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!"
+               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() {
diff --git a/net-misc/asterisk/files/digest-asterisk-1.2.13-r1 b/net-misc/asterisk/files/digest-asterisk-1.2.13-r1
new file mode 100644 (file)
index 0000000..0a8e0d7
--- /dev/null
@@ -0,0 +1,15 @@
+MD5 a407d1ef9bc88e38f435581380975fec asterisk-1.2.11-jb.patch.bz2 15598
+RMD160 cbf4a95e25bf03a41ebef2a726419299494bb298 asterisk-1.2.11-jb.patch.bz2 15598
+SHA256 e85e438cb88993a188d063582f38eff0efc1b727e47d9f71809ee81d19992946 asterisk-1.2.11-jb.patch.bz2 15598
+MD5 c91195d62d39cf71da31122dd8157828 asterisk-1.2.11-patches-1.0.tar.bz2 7432
+RMD160 b840a16b6ae9ffb1e76da4a7a8129916e1710204 asterisk-1.2.11-patches-1.0.tar.bz2 7432
+SHA256 46d198be655b35383725dde72ed82ecc7767b8009356f88d27c763323d1cdaa8 asterisk-1.2.11-patches-1.0.tar.bz2 7432
+MD5 af2139bac5d6b5c3642dbc90ccc8277b asterisk-1.2.13-bristuff-0.3.0-PRE-1s.diff.bz2 90716
+RMD160 8a9a66f9397fa2b6892967ae98c9990ef400d829 asterisk-1.2.13-bristuff-0.3.0-PRE-1s.diff.bz2 90716
+SHA256 e6fff5febd78944399148c373cdcf4e112e8dfc82e36fa87cea79e882e780354 asterisk-1.2.13-bristuff-0.3.0-PRE-1s.diff.bz2 90716
+MD5 ad8fbe2198568f55c254045ecb3b7926 asterisk-1.2.13.tar.gz 10584113
+RMD160 7cf9e00a0697b16891b463345c64a615c30015a3 asterisk-1.2.13.tar.gz 10584113
+SHA256 8d197b118d9ee25bc8793b37d1daa6b54fd6074e6738f462368361e5698d98f8 asterisk-1.2.13.tar.gz 10584113
+MD5 760eba19b03d03cd1dc8648d6239b4af bristuff-0.3.0-PRE-1s.tar.gz 265953
+RMD160 8d3abdbbae4c376d52225395c72f4538e1f84a94 bristuff-0.3.0-PRE-1s.tar.gz 265953
+SHA256 30adea4f070ed44d1952163e850c177f976857b96965e18844ccd492ccef968d bristuff-0.3.0-PRE-1s.tar.gz 265953