diff options
author | Tony Vroon <chainsaw@gentoo.org> | 2012-04-24 12:08:03 +0000 |
---|---|---|
committer | Tony Vroon <chainsaw@gentoo.org> | 2012-04-24 12:08:03 +0000 |
commit | b93e4e3929e09bc05ab4502b00849adafd68a496 (patch) | |
tree | 64f1434d643612dc81564c19d4b82051e4d3d5ce /net-misc | |
parent | Version bump wrt #410875 by Ian Delaney <johneed@hotmail.com> (diff) | |
download | historical-b93e4e3929e09bc05ab4502b00849adafd68a496.tar.gz historical-b93e4e3929e09bc05ab4502b00849adafd68a496.tar.bz2 historical-b93e4e3929e09bc05ab4502b00849adafd68a496.zip |
Updates on the 1.8 & 10 branches addressing a permission escalation in the manager interface (AST-2012-004/CVE-2012-2414), a heap buffer overflow in the SCCP channel driver (AST-2012-005/CVE-2012-2415) and a remote crash vulnerability in the SIP channel driver (AST-2012-006/CVE-2012-2416).
Package-Manager: portage-2.1.10.56/cvs/Linux x86_64
Diffstat (limited to 'net-misc')
-rw-r--r-- | net-misc/asterisk/ChangeLog | 12 | ||||
-rw-r--r-- | net-misc/asterisk/Manifest | 12 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-1.8.11.1.ebuild | 288 | ||||
-rw-r--r-- | net-misc/asterisk/asterisk-10.3.1.ebuild | 289 |
4 files changed, 596 insertions, 5 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog index 7ea0fdbc38c5..d06d3cf943eb 100644 --- a/net-misc/asterisk/ChangeLog +++ b/net-misc/asterisk/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for net-misc/asterisk # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.383 2012/04/10 09:51:40 chainsaw Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.384 2012/04/24 12:08:03 chainsaw Exp $ + +*asterisk-10.3.1 (24 Apr 2012) +*asterisk-1.8.11.1 (24 Apr 2012) + + 24 Apr 2012; Tony Vroon <chainsaw@gentoo.org> +asterisk-1.8.11.1.ebuild, + +asterisk-10.3.1.ebuild: + Updates on the 1.8 & 10 branches addressing a permission escalation in the + manager interface (AST-2012-004/CVE-2012-2414), a heap buffer overflow in the + SCCP channel driver (AST-2012-005/CVE-2012-2415) and a remote crash + vulnerability in the SIP channel driver (AST-2012-006/CVE-2012-2416). 10 Apr 2012; Tony Vroon <chainsaw@gentoo.org> -asterisk-1.8.8.2.ebuild: Remove vulnerable ebuild for security bug #408431 by Tim Sammut. diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest index 5c1cea614199..5c9918f5b983 100644 --- a/net-misc/asterisk/Manifest +++ b/net-misc/asterisk/Manifest @@ -12,22 +12,26 @@ AUX 1.8.0/asterisk.initd 6511 RMD160 183128f493953a1dc9241e2966398c6e5f3e1365 SH AUX 1.8.0/asterisk.initd2 6522 RMD160 7c472eff7ee817dd3d8b3d228f66b27f2341fb91 SHA1 aa30a4b18e0952f68263493f25947caeff6aa514 SHA256 77db24b411744ea7897c3609c116315b3c71c24281012eea4f79f996df58e747 DIST asterisk-1.8.10.1.tar.gz 25202101 RMD160 6a1a5e02937b8a89b25b06995154c1cd0f345d5f SHA1 4d4dfba6bbd742328396893aa689173eb670feae SHA256 dcf9b524c5e2d0b704e86729fbd55684121af190f7f8d1b9f23b20d92f58c974 DIST asterisk-1.8.11.0.tar.gz 25250286 RMD160 51b5a9dced4642011b475d8718f404ae5be26018 SHA1 cacabf8a3f8d710a26d53ae3fa041892354ac98d SHA256 1ca2f1f4a298c28033f56cec335e2a771bed37a248cc912812554319276cdff8 +DIST asterisk-1.8.11.1.tar.gz 25243311 RMD160 5f1cc9449c243e56be4d778bc262e5cd931aa29e SHA1 401be7f99665bc423cbafd8ae4c0d7d76769b3db SHA256 2c9ed9f1395ef7646bc98769dc6967585257276dc61b58580fb1e0280c3a98ee DIST asterisk-10.2.1.tar.gz 25121295 RMD160 ad4bf33d0d544e3a1ac28d1547c771fc6c80b31f SHA1 1353019ade550eccd7989dc87fa4313f42919fc7 SHA256 e1511569e9db2d17eb60f5ebf65dfecf679acfb1463dbd2d7d4e9a8db0ed7c1f DIST asterisk-10.3.0.tar.gz 25168737 RMD160 69449a0232d10d574dfd53f65f76278bba8645aa SHA1 a381839702e6007b8d6d3412eebda4bd60a3b799 SHA256 f95227bdf845aada4640ccde1e226814653a5af61026179a68d6d9ca2cd3d4c0 +DIST asterisk-10.3.1.tar.gz 25161413 RMD160 c11bdda50f4042d230c07c49abe1bfc940f7cce9 SHA1 7026c5193443ea2f8f9e1237dac5a025961cf860 SHA256 f96503eb4d1e20c88a85a83f6be80b991e520eaad3bfe17f73b1ba6c75c20e18 DIST gentoo-asterisk-patchset-1.10.tar.bz2 30746 RMD160 d7b15cd0d11c0c8efecc007d0a52322a6df273a6 SHA1 807030a607bd49cc1e2efc7cf7850bf6feac4f20 SHA256 e7b7c30b54cc578a78950a5cc85624e9da8d7abdc75d7e9345a1101671ee0ed5 DIST gentoo-asterisk-patchset-1.11.tar.bz2 30473 RMD160 28ae7e2d63a1971ab069abb48ffb53510d187579 SHA1 c7456f43e0529bc60a84837fe17bb1ebbfe4b363 SHA256 dd2da3854cf627d3d33e4f083a5d732fd64f8baf4e418d04d2002e5124dabd2f DIST gentoo-asterisk-patchset-2.2.tar.bz2 7552 RMD160 616475b5eeb899e29e51323b202a70bb8053024e SHA1 347b11bee2ea7921658f3be94e70a5e4c754bfef SHA256 0badf6a22a75f7161b35d8d44ab3801a47a32362d4a3e12c28e8703444666259 DIST gentoo-asterisk-patchset-2.3.tar.bz2 7254 RMD160 e033ee4e9bacaee2a1a652651f761e124ea1572e SHA1 76ee692b579bdf7af2999c0afaef67e49bdfcb4a SHA256 a111d7d4d41264636bccdccda29715ce799fefae37bb52587ff39c871e0a7fbb EBUILD asterisk-1.8.10.1.ebuild 8504 RMD160 296acff78c76f698208f4e55925006340b2c8385 SHA1 14d49e9480d8965f9bee68d9dea127cefb7a1621 SHA256 c4716707497e02f05e5ccd9d02745bb4ba318ca6133a3636a0e457fdcc7eb70d EBUILD asterisk-1.8.11.0.ebuild 8475 RMD160 9db22a15ad8306a706880c1e222aa6064195e96b SHA1 55eec733f80afe8c2b157fd8e4d5051482a0aae4 SHA256 21eb369273acbcd445597794bf8c3cdc05c5da4d037b5d6af7986d0430038530 +EBUILD asterisk-1.8.11.1.ebuild 8475 RMD160 5a8eced184f3a0989392679c9db01e036c7380c2 SHA1 d48df4a710d06a3fcfdc3b49ef3ab724f0ae3f28 SHA256 cbd1222768f80e5173ff4ae85b5c98242f01b1b083cdc168b7be30222b0cb247 EBUILD asterisk-10.2.1.ebuild 8550 RMD160 195cbac4401ee83ef7ca1f9657928bcb66229d8f SHA1 c8c37ad623f40ca8ebb35c2d42dc81b2f2ff6cc1 SHA256 b0f8f9f62dba620512ebf65ccb77bad37c1340f2b32c2585ddb66f253c83ee27 EBUILD asterisk-10.3.0.ebuild 8550 RMD160 b85fa2092d371e91ba864460e8c0e85ce1297b4c SHA1 a4ff129233e34f19b691be55d4d9a3feea903619 SHA256 9518c399d232130f5177a147a327051667c68b6926d1cd0baf5e28b5ce6b7afb -MISC ChangeLog 99289 RMD160 f424f1967cc36f095b16b0c040ae19573a911594 SHA1 e6caf178f0832657a98b71f070f1a5cd529f3be3 SHA256 ad69d7bceb7b7f2b76f310619ba767d022cadfee1555706b9e95691a16db8901 +EBUILD asterisk-10.3.1.ebuild 8550 RMD160 61cb696216b604e97bf489486304e58fc1468db9 SHA1 6a36dcdd77e48d9e6f8303e3b1a37069575c8d04 SHA256 09b09f717d63c23835b6a095a5def29b6212d2542de45432f2940962f723482f +MISC ChangeLog 99756 RMD160 b2d82b7293d571258fbc9fd2534168761cc562c9 SHA1 01c312f9bbd007986cc50bbd131cdcc1aaa60259 SHA256 c8e5ca2841239094141a1fba2133d004bdd091718677342ff1888d256c5df746 MISC metadata.xml 1028 RMD160 5b59e20d3efbe652abf786d05a7b9744105a088b SHA1 e718c3ce0210047b34a05c92ff8a7b4707316e17 SHA256 63267079fefbcc798d902e6b9822609df79c756a9934c3ad3abdabfbad357de5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iEYEARECAAYFAk+EAroACgkQp5vW4rUFj5rbzQCbBR19eDO83MZUAFZcH4jZLNc/ -G5MAn0PX3jkYyfqN7n5v8IAfEOBIo5kj -=Q6cb +iEYEARECAAYFAk+Wl7IACgkQp5vW4rUFj5q7vQCeNPL4tMt0WDgrzCLzCjujebrL +uaMAoLoCz7wQKnK8dYmLiIqvq/0yiWzY +=Hkjr -----END PGP SIGNATURE----- diff --git a/net-misc/asterisk/asterisk-1.8.11.1.ebuild b/net-misc/asterisk/asterisk-1.8.11.1.ebuild new file mode 100644 index 000000000000..27d437821055 --- /dev/null +++ b/net-misc/asterisk/asterisk-1.8.11.1.ebuild @@ -0,0 +1,288 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-1.8.11.1.ebuild,v 1.1 2012/04/24 12:08:03 chainsaw Exp $ + +EAPI=4 +inherit autotools base eutils linux-info multilib + +MY_P="${PN}-${PV/_/-}" + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="http://www.asterisk.org/" +SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/${MY_P}.tar.gz + mirror://gentoo/gentoo-asterisk-patchset-1.11.tar.bz2" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex sqlite sqlite3 srtp static syslog usb vorbis" + +EPATCH_SUFFIX="patch" +PATCHES=( "${WORKDIR}/asterisk-patchset" ) + +RDEPEND="dev-libs/popt + dev-libs/libxml2 + dev-libs/openssl + sys-libs/ncurses + sys-libs/zlib + ais? ( sys-cluster/openais ) + alsa? ( media-libs/alsa-lib ) + bluetooth? ( net-wireless/bluez ) + calendar? ( net-libs/neon + dev-libs/libical + dev-libs/iksemel ) + caps? ( sys-libs/libcap ) + curl? ( net-misc/curl ) + dahdi? ( >=net-libs/libpri-1.4.12_beta2 + net-misc/dahdi-tools ) + freetds? ( dev-db/freetds ) + gtalk? ( dev-libs/iksemel ) + http? ( dev-libs/gmime:2.4 ) + iconv? ( virtual/libiconv ) + jabber? ( dev-libs/iksemel ) + jingle? ( dev-libs/iksemel ) + ldap? ( net-nds/openldap ) + lua? ( dev-lang/lua ) + mysql? ( virtual/mysql ) + newt? ( dev-libs/newt ) + odbc? ( dev-db/unixODBC ) + osplookup? ( net-libs/osptoolkit ) + portaudio? ( media-libs/portaudio ) + postgres? ( dev-db/postgresql-base ) + radius? ( net-dialup/radiusclient-ng ) + snmp? ( net-analyzer/net-snmp ) + span? ( media-libs/spandsp ) + speex? ( media-libs/speex ) + sqlite? ( dev-db/sqlite:0 ) + sqlite3? ( dev-db/sqlite:3 ) + srtp? ( net-libs/libsrtp ) + usb? ( dev-libs/libusb + media-libs/alsa-lib ) + vorbis? ( media-libs/libvorbis )" + +DEPEND="${RDEPEND} + !net-libs/openh323" + +RDEPEND="${RDEPEND} + syslog? ( virtual/logger )" + +PDEPEND="net-misc/asterisk-core-sounds + net-misc/asterisk-extra-sounds + net-misc/asterisk-moh-opsound" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + CONFIG_CHECK="~!NF_CONNTRACK_SIP" + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users + have reported that this module dropped critical SIP packets in their deployments. You + may want to disable it if you see such problems." + check_extra_config + + enewgroup asterisk + enewgroup dialout 20 + enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout" +} + +src_prepare() { + base_src_prepare + AT_M4DIR=autoconf eautoreconf +} + +src_configure() { + econf \ + --libdir="/usr/$(get_libdir)" \ + --localstatedir="/var" \ + --with-crypto \ + --with-gsm=internal \ + --with-popt \ + --with-ssl \ + --with-z \ + $(use_with caps cap) \ + $(use_with http gmime) \ + $(use_with newt) \ + $(use_with portaudio) + + # Blank out sounds/sounds.xml file to prevent + # asterisk from installing sounds files (we pull them in via + # asterisk-{core,extra}-sounds and asterisk-moh-opsound. + >"${S}"/sounds/sounds.xml + + # Compile menuselect binary for optional components + emake menuselect.makeopts + + # Broken functionality is forcibly disabled (bug #360143) + menuselect/menuselect --disable chan_misdn menuselect.makeopts + menuselect/menuselect --disable chan_ooh323 menuselect.makeopts + + # Utility set is forcibly enabled (bug #358001) + menuselect/menuselect --enable smsq menuselect.makeopts + menuselect/menuselect --enable streamplayer menuselect.makeopts + menuselect/menuselect --enable aelparse menuselect.makeopts + menuselect/menuselect --enable astman menuselect.makeopts + + # this is connected, otherwise it would not find + # ast_pktccops_gate_alloc symbol + menuselect/menuselect --enable chan_mgcp menuselect.makeopts + menuselect/menuselect --enable res_pktccops menuselect.makeopts + + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available + menuselect/menuselect --enable pbx_dundi menuselect.makeopts + menuselect/menuselect --enable func_aes menuselect.makeopts + menuselect/menuselect --enable chan_iax2 menuselect.makeopts + + # The others are based on USE-flag settings + use_select() { + local state=$(use "$1" && echo enable || echo disable) + shift # remove use from parameters + + while [[ -n $1 ]]; do + menuselect/menuselect --${state} "$1" menuselect.makeopts + shift + done + } + + use_select ais res_ais + use_select alsa chan_alsa + use_select bluetooth chan_mobile + use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar} + use_select curl func_curl res_config_curl res_curl + use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi + use_select freetds {cdr,cel}_tds + use_select gtalk chan_gtalk + use_select http res_http_post + use_select iconv func_iconv + use_select jabber res_jabber + use_select jingle chan_jingle + use_select ldap res_config_ldap + use_select lua pbx_lua + use_select mysql app_mysql cdr_mysql res_config_mysql + use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc + use_select osplookup app_osplookup + use_select oss chan_oss + use_select postgres {cdr,cel}_pgsql res_config_pgsql + use_select radius {cdr,cel}_radius + use_select snmp res_snmp + use_select span res_fax_spandsp + use_select speex {codec,func}_speex + use_select sqlite cdr_sqlite + use_select sqlite3 {cdr,cel}_sqlite3_custom + use_select srtp res_srtp + use_select syslog cdr_syslog + use_select usb chan_usbradio + use_select vorbis format_ogg_vorbis +} + +src_compile() { + ASTLDFLAGS="${LDFLAGS}" emake +} + +src_install() { + mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die + emake DESTDIR="${D}" installdirs + emake DESTDIR="${D}" install + + if use radius; then + insinto /etc/radiusclient-ng/ + doins contrib/dictionary.digium + fi + if use samples; then + emake DESTDIR="${D}" samples + for conffile in "${D}"etc/asterisk/*.* + do + chown asterisk:asterisk $conffile + chmod 0660 $conffile + done + einfo "Sample files have been installed" + else + einfo "Skipping installation of sample files..." + rm -f "${D}"var/lib/asterisk/mohmp3/* || die + rm -f "${D}"var/lib/asterisk/sounds/demo-* || die + rm -f "${D}"var/lib/asterisk/agi-bin/* || die + rm -f "${D}"etc/asterisk/* || die + fi + rm -rf "${D}"var/spool/asterisk/voicemail/default || die + + # 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.8.0/asterisk.initd2 asterisk + newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk + + # install the upgrade documentation + # + dodoc README UPGRADE* BUGS CREDITS + + # install extra documentation + # + if use doc + then + dodoc doc/*.txt + dodoc doc/*.pdf + fi + + # install SIP scripts; bug #300832 + # + dodoc "${FILESDIR}/1.6.2/sip_calc_auth" + dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh" + dodoc "${FILESDIR}/1.6.2/find_call_ids.sh" + dodoc "${FILESDIR}/1.6.2/call_data.txt" + + # install logrotate snippet; bug #329281 + # + insinto /etc/logrotate.d + newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk +} + +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.8 changes that you may care about:" + elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt" + elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2" +} + +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-10.3.1.ebuild b/net-misc/asterisk/asterisk-10.3.1.ebuild new file mode 100644 index 000000000000..053e72c472be --- /dev/null +++ b/net-misc/asterisk/asterisk-10.3.1.ebuild @@ -0,0 +1,289 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-10.3.1.ebuild,v 1.1 2012/04/24 12:08:03 chainsaw Exp $ + +EAPI=4 +inherit autotools base eutils linux-info multilib + +MY_P="${PN}-${PV/_/-}" + +DESCRIPTION="Asterisk: A Modular Open Source PBX System" +HOMEPAGE="http://www.asterisk.org/" +SRC_URI="http://downloads.asterisk.org/pub/telephony/asterisk/${MY_P}.tar.gz + mirror://gentoo/gentoo-asterisk-patchset-2.3.tar.bz2" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="ais alsa bluetooth calendar +caps curl dahdi debug doc freetds gtalk http iconv jabber jingle ldap lua mysql newt +samples odbc osplookup oss portaudio postgres radius snmp span speex srtp static syslog usb vorbis" + +EPATCH_SUFFIX="patch" +PATCHES=( "${WORKDIR}/asterisk-patchset" ) + +RDEPEND="dev-db/sqlite:3 + dev-libs/popt + dev-libs/libxml2 + dev-libs/openssl + sys-libs/ncurses + sys-libs/zlib + ais? ( sys-cluster/openais ) + alsa? ( media-libs/alsa-lib ) + bluetooth? ( net-wireless/bluez ) + calendar? ( net-libs/neon + dev-libs/libical + dev-libs/iksemel ) + caps? ( sys-libs/libcap ) + curl? ( net-misc/curl ) + dahdi? ( >=net-libs/libpri-1.4.12_beta2 + net-misc/dahdi-tools ) + freetds? ( dev-db/freetds ) + gtalk? ( dev-libs/iksemel ) + http? ( dev-libs/gmime:2.4 ) + iconv? ( virtual/libiconv ) + jabber? ( dev-libs/iksemel ) + jingle? ( dev-libs/iksemel ) + ldap? ( net-nds/openldap ) + lua? ( dev-lang/lua ) + mysql? ( virtual/mysql ) + newt? ( dev-libs/newt ) + odbc? ( dev-db/unixODBC ) + osplookup? ( net-libs/osptoolkit ) + portaudio? ( media-libs/portaudio ) + postgres? ( dev-db/postgresql-base ) + radius? ( net-dialup/radiusclient-ng ) + snmp? ( net-analyzer/net-snmp ) + span? ( media-libs/spandsp ) + speex? ( media-libs/speex ) + srtp? ( net-libs/libsrtp ) + usb? ( dev-libs/libusb + media-libs/alsa-lib ) + vorbis? ( media-libs/libvorbis )" + +DEPEND="${RDEPEND} + !net-libs/openh323" + +RDEPEND="${RDEPEND} + syslog? ( virtual/logger )" + +PDEPEND="net-misc/asterisk-core-sounds + net-misc/asterisk-extra-sounds + net-misc/asterisk-moh-opsound" + +S="${WORKDIR}/${MY_P}" + +pkg_setup() { + CONFIG_CHECK="~!NF_CONNTRACK_SIP" + local WARNING_NF_CONNTRACK_SIP="SIP (NAT) connection tracking is enabled. Some users + have reported that this module dropped critical SIP packets in their deployments. You + may want to disable it if you see such problems." + check_extra_config + + enewgroup asterisk + enewgroup dialout 20 + enewuser asterisk -1 -1 /var/lib/asterisk "asterisk,dialout" +} + +src_prepare() { + base_src_prepare + AT_M4DIR=autoconf eautoreconf +} + +src_configure() { + econf \ + --libdir="/usr/$(get_libdir)" \ + --localstatedir="/var" \ + --with-crypto \ + --with-gsm=internal \ + --with-popt \ + --with-ssl \ + --with-z \ + $(use_with caps cap) \ + $(use_with http gmime) \ + $(use_with newt) \ + $(use_with portaudio) + + # Blank out sounds/sounds.xml file to prevent + # asterisk from installing sounds files (we pull them in via + # asterisk-{core,extra}-sounds and asterisk-moh-opsound. + >"${S}"/sounds/sounds.xml + + # Compile menuselect binary for optional components + emake menuselect.makeopts + + # Broken functionality is forcibly disabled (bug #360143) + menuselect/menuselect --disable chan_misdn menuselect.makeopts + menuselect/menuselect --disable chan_ooh323 menuselect.makeopts + + # Utility set is forcibly enabled (bug #358001) + menuselect/menuselect --enable smsq menuselect.makeopts + menuselect/menuselect --enable streamplayer menuselect.makeopts + menuselect/menuselect --enable aelparse menuselect.makeopts + menuselect/menuselect --enable astman menuselect.makeopts + + # this is connected, otherwise it would not find + # ast_pktccops_gate_alloc symbol + menuselect/menuselect --enable chan_mgcp menuselect.makeopts + menuselect/menuselect --enable res_pktccops menuselect.makeopts + + # SSL is forcibly enabled, IAX2 & DUNDI are expected to be available + menuselect/menuselect --enable pbx_dundi menuselect.makeopts + menuselect/menuselect --enable func_aes menuselect.makeopts + menuselect/menuselect --enable chan_iax2 menuselect.makeopts + + # SQlite3 is now the main database backend, enable related features + menuselect/menuselect --enable cdr_sqlite3_custom menuselect.makeopts + menuselect/menuselect --enable cel_sqlite3_custom menuselect.makeopts + + # The others are based on USE-flag settings + use_select() { + local state=$(use "$1" && echo enable || echo disable) + shift # remove use from parameters + + while [[ -n $1 ]]; do + menuselect/menuselect --${state} "$1" menuselect.makeopts + shift + done + } + + use_select ais res_ais + use_select alsa chan_alsa + use_select bluetooth chan_mobile + use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar} + use_select curl func_curl res_config_curl res_curl + use_select dahdi app_dahdibarge app_dahdiras chan_dahdi codec_dahdi res_timing_dahdi + use_select freetds {cdr,cel}_tds + use_select gtalk chan_gtalk + use_select http res_http_post + use_select iconv func_iconv + use_select jabber res_jabber + use_select jingle chan_jingle + use_select ldap res_config_ldap + use_select lua pbx_lua + use_select mysql app_mysql cdr_mysql res_config_mysql + use_select odbc cdr_adaptive_odbc res_config_odbc {cdr,cel,res,func}_odbc + use_select osplookup app_osplookup + use_select oss chan_oss + use_select postgres {cdr,cel}_pgsql res_config_pgsql + use_select radius {cdr,cel}_radius + use_select snmp res_snmp + use_select span res_fax_spandsp + use_select speex {codec,func}_speex + use_select srtp res_srtp + use_select syslog cdr_syslog + use_select usb chan_usbradio + use_select vorbis format_ogg_vorbis +} + +src_compile() { + ASTLDFLAGS="${LDFLAGS}" emake +} + +src_install() { + mkdir -p "${D}"usr/$(get_libdir)/pkgconfig || die + emake DESTDIR="${D}" installdirs + emake DESTDIR="${D}" install + + if use radius; then + insinto /etc/radiusclient-ng/ + doins contrib/dictionary.digium + fi + if use samples; then + emake DESTDIR="${D}" samples + for conffile in "${D}"etc/asterisk/*.* + do + chown asterisk:asterisk $conffile + chmod 0660 $conffile + done + einfo "Sample files have been installed" + else + einfo "Skipping installation of sample files..." + rm -f "${D}"var/lib/asterisk/mohmp3/* || die + rm -f "${D}"var/lib/asterisk/sounds/demo-* || die + rm -f "${D}"var/lib/asterisk/agi-bin/* || die + rm -f "${D}"etc/asterisk/* || die + fi + rm -rf "${D}"var/spool/asterisk/voicemail/default || die + + # 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.8.0/asterisk.initd2 asterisk + newconfd "${FILESDIR}"/1.8.0/asterisk.confd asterisk + + # install the upgrade documentation + # + dodoc README UPGRADE* BUGS CREDITS + + # install extra documentation + # + if use doc + then + dodoc doc/*.txt + dodoc doc/*.pdf + fi + + # install SIP scripts; bug #300832 + # + dodoc "${FILESDIR}/1.6.2/sip_calc_auth" + dodoc "${FILESDIR}/1.6.2/find_call_sip_trace.sh" + dodoc "${FILESDIR}/1.6.2/find_call_ids.sh" + dodoc "${FILESDIR}/1.6.2/call_data.txt" + + # install logrotate snippet; bug #329281 + # + insinto /etc/logrotate.d + newins "${FILESDIR}/1.6.2/asterisk.logrotate3" asterisk +} + +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.8 changes that you may care about:" + elog "http://svn.asterisk.org/svn/${PN}/tags/${PV}/UPGRADE.txt" + elog "or: bzless ${ROOT}usr/share/doc/${PF}/UPGRADE.txt.bz2" +} + +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 +} |