diff options
author | Alin Năstac <mrness@gentoo.org> | 2006-11-02 15:05:39 +0000 |
---|---|---|
committer | Alin Năstac <mrness@gentoo.org> | 2006-11-02 15:05:39 +0000 |
commit | 424ac14de91939d4a230a74fca6e66030e0e6c7a (patch) | |
tree | 649a4f109f3639dfdfb91d293b654bf2c3774e23 /net-misc | |
parent | Stable on x86 wrt bug #151252. (diff) | |
download | gentoo-2-424ac14de91939d4a230a74fca6e66030e0e6c7a.tar.gz gentoo-2-424ac14de91939d4a230a74fca6e66030e0e6c7a.tar.bz2 gentoo-2-424ac14de91939d4a230a74fca6e66030e0e6c7a.zip |
Fix multiple bugs: #111095, #135300, #148054, #148309, #148853, #152303 and #153656.
(Portage version: 2.1.1)
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/asterisk/ChangeLog | 9 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.2.13-r1.ebuild | 482 | ||||
-rw-r--r-- | net-misc/asterisk/files/1.2.0/asterisk-1.2.13-memleaks.diff | 11 | ||||
-rwxr-xr-x | net-misc/asterisk/files/1.2.0/asterisk.rc6 | 32 | ||||
-rw-r--r-- | net-misc/asterisk/files/digest-asterisk-1.2.13-r1 | 15 |
5 files changed, 540 insertions, 9 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog index 78dcb565b7db..191ea5d56d8b 100644 --- a/net-misc/asterisk/ChangeLog +++ b/net-misc/asterisk/ChangeLog @@ -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: 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 index 000000000000..0d21bb0ddad6 --- /dev/null +++ b/net-misc/asterisk/asterisk-1.2.13-r1.ebuild @@ -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 index 000000000000..cf3a8cdae8ee --- /dev/null +++ b/net-misc/asterisk/files/1.2.0/asterisk-1.2.13-memleaks.diff @@ -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) { diff --git a/net-misc/asterisk/files/1.2.0/asterisk.rc6 b/net-misc/asterisk/files/1.2.0/asterisk.rc6 index f2f0471e2ee1..168be13951a5 100755 --- a/net-misc/asterisk/files/1.2.0/asterisk.rc6 +++ b/net-misc/asterisk/files/1.2.0/asterisk.rc6 @@ -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 index 000000000000..0a8e0d787252 --- /dev/null +++ b/net-misc/asterisk/files/digest-asterisk-1.2.13-r1 @@ -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 |