diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2010-02-02 22:48:09 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2010-02-02 22:48:09 +0000 |
commit | a5d1d3bb0b2ca1fad63ba3c0888cd90e0b630f18 (patch) | |
tree | 56a368a78e34c3c2c1fec2ff728058ceea873d7e /net-misc/asterisk | |
parent | refmac splitted from ccp4 package (diff) | |
download | historical-a5d1d3bb0b2ca1fad63ba3c0888cd90e0b630f18.tar.gz historical-a5d1d3bb0b2ca1fad63ba3c0888cd90e0b630f18.tar.bz2 historical-a5d1d3bb0b2ca1fad63ba3c0888cd90e0b630f18.zip |
Security update for AST-2010-001; remote T.38 over SIP crash by sitting FaxMaxDatagram to a negative or exceptionally large value. Init script update by Jaco Kroon closes bug #303265. Remove vulnerable 1.6.2 branch ebuilds.
Package-Manager: portage-2.2_rc62/cvs/Linux x86_64
Diffstat (limited to 'net-misc/asterisk')
-rw-r--r-- | net-misc/asterisk/ChangeLog | 12 | ||||
-rw-r--r-- | net-misc/asterisk/Manifest | 15 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.6.2.0.ebuild | 422 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.6.2.2.ebuild (renamed from net-misc/asterisk/asterisk-1.6.2.1.ebuild) | 6 | ||||
-rw-r--r-- | net-misc/asterisk/files/1.6.1/asterisk.initd3 | 269 |
5 files changed, 290 insertions, 434 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog index f9fb1c857ee2..91f73f99b7d9 100644 --- a/net-misc/asterisk/ChangeLog +++ b/net-misc/asterisk/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-misc/asterisk # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.243 2010/01/27 15:14:38 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.244 2010/02/02 22:48:08 chainsaw Exp $ + +*asterisk-1.6.2.2 (02 Feb 2010) + + 02 Feb 2010; <chainsaw@gentoo.org> +files/1.6.1/asterisk.initd3, + -asterisk-1.6.2.0.ebuild, -asterisk-1.6.2.1.ebuild, + +asterisk-1.6.2.2.ebuild: + Security update for AST-2010-001; remote T.38 over SIP crash by sitting + FaxMaxDatagram to a negative or exceptionally large value. Init script + update by Jaco Kroon closes bug #303265. Remove vulnerable 1.6.2 branch + ebuilds. *asterisk-1.6.1.13 (27 Jan 2010) diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest index 87cbda819c5e..e67f38073772 100644 --- a/net-misc/asterisk/Manifest +++ b/net-misc/asterisk/Manifest @@ -24,6 +24,7 @@ AUX 1.6.1/asterisk-1.6.1.6-transfer-segfault.patch 929 RMD160 10d6b0977783d9a57d AUX 1.6.1/asterisk-1.6.1.8-session_expiry.patch 408 RMD160 87e69abc900676b033f33c9b063bceff1355b1c7 SHA1 d07471e65f0e82f3f7612c18041a7f24e1fdc908 SHA256 5289ba9db50cb26924a8d738ea9bcc9fab31161a7ba5ed205f9733654c173b66 AUX 1.6.1/asterisk.initd 5897 RMD160 8a5d8ed9138a043008c0628985c74e6989bbbb62 SHA1 4473ab6479fa525e3b59d311c9a071604563f76f SHA256 c220f4732f537bafeb32a7e917db5361958c88a8a68b5dff57e86c711993a9ac AUX 1.6.1/asterisk.initd2 6199 RMD160 b70c78b8f4921ae543077acf82957a0a6b6973db SHA1 3252d06b63cfdc19782cee8a7d102dd6286db1ff SHA256 bd58c5ed46ef8f413d2f65e292db0c2cd4c413feb9bc6fe006f50fe3a3b70861 +AUX 1.6.1/asterisk.initd3 6534 RMD160 5d116a92346cc8da603d233d81da302647e8ecd2 SHA1 e9a12867d3068da9c5c9e1fb758ad9fe3068d80a SHA256 47b1e0b635ab6add48c44a885639d227b5306a720d461a9f5a12f6271a483abf AUX 1.6.1/asterisk.rc6 5896 RMD160 da94968d2dd315977a1ddfbac020ebe0ea2fbfeb SHA1 d65dd46e052066ea02bd613c8068b3a471ace157 SHA256 511da355d94afc6e81504f2f1a95f4c30346920d582ea9b00e27df8866c16515 AUX 1.6.2/asterisk-1.6.2.0-bt-line-test.patch 1754 RMD160 c63c9631da619932700c1a93b923fd88c5e9f6f1 SHA1 72bfa40709bc1e47370df228ab96c1a0c316190f SHA256 7ef5d976f41d26e6752bc3474be368ca7c67c601e581ad31bf50fc5cb066a21d AUX 1.6.2/asterisk-1.6.2.1-parallel-make.patch 3797 RMD160 bb13234b020daa96a3b32baf38ebaa4bddd7f468 SHA1 561cfc994d36f346eee238ae4b2f8ebec6ae47bb SHA256 390f40a34f2c8deb0efbc7f84c4a52018f9ebdc6d431f2cf309d07d767c64506 @@ -32,20 +33,18 @@ DIST asterisk-1.2.36.tar.gz 29897926 RMD160 47b8c0e58c43cac6aa415482182aea15b148 DIST asterisk-1.2.37.tar.gz 29899629 RMD160 1de7ff96d3b1fd8d89f3ef7b3bb9e35bedccfb33 SHA1 c9a3c4684e021f62b4d19f6e0c8fc11f64db19d6 SHA256 9f3ec67efe0e4d45434621cd358e8e7d64e1b05df04d66e2390c9420acd2aeaa DIST asterisk-1.6.1.12.tar.gz 23438391 RMD160 fa2440974605ea3098cd99d697bab2bea534b827 SHA1 b7c9cdfd6b7401be2eabac537f6f6cebee10b48c SHA256 b67752bc27a36cfd9a5b7488ebfa427846f26452cbe7a3dcc0e4936a5cdf733e DIST asterisk-1.6.1.13.tar.gz 23517712 RMD160 fd70865704ffb5aaae59ad81b21edea07409157d SHA1 e9c92c0837d4cdf6976037c7dad34cf2098a2c80 SHA256 2168438a376c820ced2e819db8461e3d1ae4f6dc75d9589dc38dd7d81bd6170e -DIST asterisk-1.6.2.0.tar.gz 23195395 RMD160 710e23e974da23a644947244e6944def3d852520 SHA1 ed53ff39219826342f6a6948ec3ea891c522da11 SHA256 f40a910b328d0b620f6eee060081e645442ac2547882b7a7b0b938d219699877 -DIST asterisk-1.6.2.1.tar.gz 23186322 RMD160 a2b1b6d4502b0d13f9bae429f7b4a9b71dc0a221 SHA1 160c565ad1890841afca595eccf4b96d2a650d1a SHA256 7de3996a855736a0bf231534b84e2aaa208795db73e30a96986e9fb26a2c1ae9 +DIST asterisk-1.6.2.2.tar.gz 23177043 RMD160 fdba60d04307a503d9bf06583bf919d9f83b4e53 SHA1 9417194632c4b0fbaedfdb9d833cba7c859c8e44 SHA256 1aa026a99c2f830426489abead8e1fdd83bf2a6a3ec92f2d684344c61dcf7877 EBUILD asterisk-1.2.36.ebuild 10640 RMD160 de9118d48d7122200847783aec84e89724f33475 SHA1 8839099437bb0fa20ab7ba4c4aabeef33be353d5 SHA256 73421c18cf2aec1412ef1f86cb6a810765cf7c78fdb056b2e84224430368a1ca EBUILD asterisk-1.2.37.ebuild 10640 RMD160 82f1d14082b607402146bd8f7950ea32ee2558f3 SHA1 5718e0411fff8bc14c4c57562a9df281c33abdc5 SHA256 2f2290922b09f9b71b06cb73e99fc7916b4a994960375e0e48b6bb39fd802e0c EBUILD asterisk-1.6.1.12-r1.ebuild 11045 RMD160 e316facf21a655a55c7f944da8a23a10dbe46d0c SHA1 ed592dc3b338852c0dda826af6ebb57847b58898 SHA256 e0a0cfdda8e4b3d52df58454da54a15a5aeaa29e08a80c2f6df9edd7a48b1c81 EBUILD asterisk-1.6.1.13.ebuild 10778 RMD160 013aefbd86bc4152fe900519b73b4b1ae04586c0 SHA1 5df167944c68d0dcf2f167e99da2dd9647f0b2d6 SHA256 b07634328f54aefaa367a305a45ae9a69428f937dd6cc5a8e19d2804c741ccbe -EBUILD asterisk-1.6.2.0.ebuild 11089 RMD160 db1480bddaafc198a3ed60c26d92445caa89a93a SHA1 2c3dbe596c2c90f73a6de6ea13a600d52dc37985 SHA256 f6508fc6b4ec9baf0b9fa61fc6a9b389442a45940c423cb72f6fbafad105c39f -EBUILD asterisk-1.6.2.1.ebuild 9497 RMD160 7148781a2da51387f6ef5d5ed7edd4dc3dfccb07 SHA1 3eddf8887c638f297031c7c738d31a3d93f42300 SHA256 8df6bb3eaa45b4068276955a8ff0dba5124a6f1ff40bbb8658307e7bb203e06b -MISC ChangeLog 53489 RMD160 0227a3aa27da97d74b83f44640c32357479200fe SHA1 8f5ad63701ac2bb4435042a4bbcbda4cc0ee1809 SHA256 823882c3f9fff6534719f50daa85a45f93c7024c310583099885019c4a141c71 +EBUILD asterisk-1.6.2.2.ebuild 9506 RMD160 a098a36262c8a265d74d5caf4af58ac738f616b9 SHA1 992368e60ac361834ac26f1e0ded664e353c1df3 SHA256 4745de18196315062b97b30eaca3845f3890d8c15fc7e6c8dfb4e945f497fd00 +MISC ChangeLog 53904 RMD160 05057247aefd47d0b23ac3a631477398ce1952b5 SHA1 7f97d09e0e1252b76fbbd6d8ec7a66537261b440 SHA256 a162e9a9b31a4fbd172e1925a0895feffbc67609f7f1b7873cabe3012002c9b6 MISC metadata.xml 1103 RMD160 9be6c713684efa268e58cfc111fae4716e97f9dd SHA1 5af1f100c97f1bca1834867e06c3fb9111ed1fde SHA256 a83ca9d4cfd8da10b8dbb9583e1b6fa5fc0f30968a0681e4bc931673a00e1c99 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) -iEYEARECAAYFAktgV/wACgkQp5vW4rUFj5oazACgu5QLfuE0LqugU7r8qvtAafHk -8KAAoIRn6a3W/SJFYO/B0BWEPHypMNp5 -=fN12 +iEYEARECAAYFAktorBsACgkQp5vW4rUFj5qupACgtzL7KqWeVtrhXyZT/KFC5PkM +M8MAoKti6chvmmGxQ2D+kb4eSRG18DDq +=VlKb -----END PGP SIGNATURE----- diff --git a/net-misc/asterisk/asterisk-1.6.2.0.ebuild b/net-misc/asterisk/asterisk-1.6.2.0.ebuild deleted file mode 100644 index 122934c50a47..000000000000 --- a/net-misc/asterisk/asterisk-1.6.2.0.ebuild +++ /dev/null @@ -1,422 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.2.0.ebuild,v 1.1 2010/01/04 15:11:51 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 iconv jabber ldap keepsrc misdn newt nosamples oss postgres radius snmp span speex ssl sqlite static vorbis" - -RDEPEND="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 ) - iconv? ( virtual/libiconv ) - jabber? ( dev-libs/iksemel ) - ldap? ( net-nds/openldap ) - misdn? ( net-dialup/misdnuser ) - newt? ( dev-libs/newt ) - 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 - !net-misc/asterisk-chan_unistim - !net-misc/zaptel" - -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_ast12update ; then - ewarn "Please note that the configuration style (particularly the dial plan) has changed significantly." - ewarn "sip.conf: insecure=very -> insecure=port,invite" - ewarn "asterisk.conf: please familiarise yourself with [compat]" - ewarn "extensions.conf: use comma instead of pipe as a separator" - ewarn "- Please read "${ROOT}"usr/share/doc/${PF}/UPGRADE.txt.bz2 after the installation!" - 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 - - 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}" - - # - # fix gsm codec cflags (e.g. i586 core epias) and disable - # assembler optimizations - # - epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-gsm-pic.patch || die "patch failed" - - # - # add missing LIBS for uclibc - # - epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1-uclibc.patch || die "patch failed" - - # - # make sure FXO ports are usable immediately, without requiring an inbound call first - # https://issues.asterisk.org/view.php?id=14577 - # - epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.6-fxsks-hookstate.patch || die "patch failed" - - # - # do not ignore alarm-cleared event while V23 caller ID detection is in progress - # otherwise automated British Telecom line test causes permanent red alarm - # https://issues.asterisk.org/view.php?id=14163 - # - epatch "${FILESDIR}"/1.6.2/${PN}-1.6.2.0-bt-line-test.patch || die "patch failed" - - # - # allow longer CID field so European phone numbers (which are often longer then USA - # numbers) have a better chance of avoiding truncation - # https://issues.asterisk.org/view.php?id=16459 - # - - epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.12-longer-sip-cid.patch || die "patch failed" - - # - # sprinkle some plus signs in strategic locations for maximum parallel make happiness - # https://issues.asterisk.org/view.php?id=16489 - # - epatch "${FILESDIR}"/1.6.1/${PN}-1.6.1.12-parallel-make-v2.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 iconv) \ - $(use_with jabber iksemel) \ - $(use_with misdn isdnnet) \ - $(use_with misdn suppserv) \ - $(use_with misdn) \ - $(use_with newt) \ - $(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 - - ASTLDFLAGS="${LDFLAGS}" 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* - - cd "${D}" - for conffile in etc/asterisk/*.* - do - fowners asterisk:asterisk $conffile - fperms 0660 $conffile - done - cd "${S}" - - # keep directories - diropts -m 0770 -o asterisk -g asterisk - keepdir /etc/asterisk - keepdir /var/lib/asterisk - keepdir /var/run/asterisk - keepdir /var/spool/asterisk - keepdir /var/spool/asterisk/{system,tmp,meetme,monitor,dictate,voicemail} - diropts -m 0750 -o asterisk -g asterisk - keepdir /var/log/asterisk/{cdr-csv,cdr-custom} - - newinitd "${FILESDIR}"/1.6.1/asterisk.initd2 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() { - # - # 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 - elog "1.6.1 -> 1.6.2 changes that you may care about:" - elog "canreinvite -> directmedia (sip.conf)" - elog "extensive T.38 (fax) changes" - elog "http://svn.asterisk.org/svn/asterisk/tags/1.6.2.0/UPGRADE.txt" - - # - # 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/asterisk-1.6.2.1.ebuild b/net-misc/asterisk/asterisk-1.6.2.2.ebuild index a787979c4cf4..c78a0c1a8c09 100644 --- a/net-misc/asterisk/asterisk-1.6.2.1.ebuild +++ b/net-misc/asterisk/asterisk-1.6.2.2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.2.1.ebuild,v 1.1 2010/01/19 13:12:46 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.6.2.2.ebuild,v 1.1 2010/02/02 22:48:08 chainsaw Exp $ EAPI=1 inherit eutils autotools linux-info @@ -104,7 +104,7 @@ src_unpack() { # sprinkle some plus signs in strategic locations for maximum parallel make happiness # https://issues.asterisk.org/view.php?id=16489 # - epatch "${FILESDIR}"/1.6.2/${P}-parallel-make.patch || die "patch failed" + epatch "${FILESDIR}"/1.6.2/${PN}-1.6.2.1-parallel-make.patch || die "patch failed" AT_M4DIR=autoconf eautoreconf @@ -268,7 +268,7 @@ src_install() { diropts -m 0750 -o asterisk -g asterisk keepdir /var/log/asterisk/{cdr-csv,cdr-custom} - newinitd "${FILESDIR}"/1.6.1/asterisk.initd2 asterisk + newinitd "${FILESDIR}"/1.6.1/asterisk.initd3 asterisk newconfd "${FILESDIR}"/1.6.0/asterisk.confd asterisk # some people like to keep the sources around for custom patching diff --git a/net-misc/asterisk/files/1.6.1/asterisk.initd3 b/net-misc/asterisk/files/1.6.1/asterisk.initd3 new file mode 100644 index 000000000000..cc9e6dc1e052 --- /dev/null +++ b/net-misc/asterisk/files/1.6.1/asterisk.initd3 @@ -0,0 +1,269 @@ +#!/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.1/asterisk.initd3,v 1.1 2010/02/02 22:48:09 chainsaw Exp $ + +opts="${opts} forcestop reload" + +depend() { + need net + use nscd dns dahdi 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}" + + trap "rm /var/run/asterisk/wrapper_loop.pid" EXIT + cut -f4 -d' ' < /proc/self/stat > /var/run/asterisk/wrapper_loop.pid + + 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 + logger -t asterisk_wrapper "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} \ + || logger -t asterisk_wrapper "${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 + logger -t asterisk_wrapper "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 + for element in $(find /var/{log,run}/asterisk); do + if [ $(stat -c %U $element) != ${USER} ]; then + ewarn "${USER} is not the owner of $element, fixing." + chown -R ${USER} /var/{log,run}/asterisk + chmod -R u+r /var/{log,run}/asterisk + chmod u+x /var/{log,run}/asterisk + fi; + done; + 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 + + if [ -r /var/run/asterisk/wrapper_loop.pid ]; then + ebegin "Killing wrapper script" + kill $(</var/run/asterisk/wrapper_loop.pid) + eend $? + fi + + ebegin "Stopping asterisk PBX gracefully" + /usr/sbin/asterisk -r -x "core 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 +} |