summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2014-11-20 16:05:39 +0000
committerTony Vroon <chainsaw@gentoo.org>2014-11-20 16:05:39 +0000
commit5caf8c356e8091e05ec16a6f647ba9f56aef24d6 (patch)
treea3f4ae7ac8897ac32f5af3c3a5ec039350edca71 /net-misc/asterisk
parentStable for ia64, wrt bug #528900 (diff)
downloadhistorical-5caf8c356e8091e05ec16a6f647ba9f56aef24d6.tar.gz
historical-5caf8c356e8091e05ec16a6f647ba9f56aef24d6.tar.bz2
historical-5caf8c356e8091e05ec16a6f647ba9f56aef24d6.zip
Resource leak fixes, particularly in error paths.
Package-Manager: portage-2.2.14/cvs/Linux x86_64 Manifest-Sign-Key: 0xB5058F9A
Diffstat (limited to 'net-misc/asterisk')
-rw-r--r--net-misc/asterisk/ChangeLog9
-rw-r--r--net-misc/asterisk/Manifest12
-rw-r--r--net-misc/asterisk/asterisk-11.14.0.ebuild320
-rw-r--r--net-misc/asterisk/asterisk-12.7.0.ebuild321
4 files changed, 657 insertions, 5 deletions
diff --git a/net-misc/asterisk/ChangeLog b/net-misc/asterisk/ChangeLog
index f01d886adc3c..080b3026af59 100644
--- a/net-misc/asterisk/ChangeLog
+++ b/net-misc/asterisk/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-misc/asterisk
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.503 2014/11/03 13:47:30 titanofold Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/ChangeLog,v 1.504 2014/11/20 16:05:34 chainsaw Exp $
+
+*asterisk-12.7.0 (20 Nov 2014)
+*asterisk-11.14.0 (20 Nov 2014)
+
+ 20 Nov 2014; Tony Vroon <chainsaw@gentoo.org> +asterisk-11.14.0.ebuild,
+ +asterisk-12.7.0.ebuild:
+ Resource leak fixes, particularly in error paths.
03 Nov 2014; Aaron W. Swenson <titanofold@gentoo.org>
asterisk-11.13.1.ebuild, asterisk-12.6.1.ebuild:
diff --git a/net-misc/asterisk/Manifest b/net-misc/asterisk/Manifest
index c181107370d7..ad9e238af44e 100644
--- a/net-misc/asterisk/Manifest
+++ b/net-misc/asterisk/Manifest
@@ -11,17 +11,21 @@ AUX 1.8.0/asterisk.initd7 9382 SHA256 7951901371035da2cb958d029ddbd8af276a5de7be
AUX 1.8.0/find_call_ids.sh 1078 SHA256 185d0f55f54d044eb4b4dc64954e5191f8b993d139749bfe869e34f3ecff9d09 SHA512 1690eb3ea9eb51711df9fd7c121dbc520a2a15870fa06523f096968386ca68a132a46e361b9d19367c7089cd9ad18132ed02ef0aedd990d5939550182a3366c9 WHIRLPOOL f123f60557066707d0c276451af32f5561abb8db7e8d4eeb3a2da871ae0245108e42d28c7ff77d228a963e5f5326f7382b0ac54f92fc1bfeec2c085b9b237a15
AUX 1.8.0/find_call_sip_trace.sh 1115 SHA256 e1ebeb1dab05f552f89f380719d319cdf579cb6aeb86a9010e13e14c57f55985 SHA512 e679f3953b2e397d7c80bb2f0ca3db848f07ba97ca139c87224de4467f8172034eb4372e5ddd68116774a7b9d5fd48aa30d809e2af2c6e6e0747762c69090b6a WHIRLPOOL 8c30be245556b37dd45dd5ff5cf5c3141050f60c3e286631520f8114e167c6bd4f7930be21e57e93fd183ab65dfbd3b95b8e342808870979b67977f3ce189ebf
DIST asterisk-11.13.1.tar.gz 34959077 SHA256 382e914f3025f746d3a36cd218bc35f6a0f335b58226f35eaf4cc664b228d351 SHA512 d18f71fe3aebe64e572e3d442189f7a6b9d89d95719fb2a15b1b646ea974e5a59043eec58ea46505033279047776fcba444882bbd60e67da8627c8a467fa95d9 WHIRLPOOL 0a5be4a01807239ce8e40e6d78fd2b96a6de6928b770cc0aad7e786177608681e775d7abb38123c00f88cd5432648131825874b2296048ae6890b01f1bae15a7
+DIST asterisk-11.14.0.tar.gz 34975152 SHA256 ad4710aba7f21c75bf1d16159a349034a04d3d36895243c262059a89f892098a SHA512 cb4d43663f294574c2b20b4307889fc9590a0613c9a3755a0eb3a7bd2ac33240f204d2b76ab4812617cd88a3ad7f503c21711b4a53e52af33039872e80775675 WHIRLPOOL 05675c87a691aa6df89a76d30a19be486d3275cc908cc221b87a175de57909e0a7a421430714050f6da920e5fda78d74c9f852b5a25ab5b9b0e75ddc363a969b
DIST asterisk-12.6.1.tar.gz 56823910 SHA256 57f3d87f58594bd6f23c0bdac0f55973ea729bdeb9433162ba0879d97a127f0b SHA512 e64256b13645e7c9f347bfef9892fa518207161cf82b88927a7519f302bcb0edfffac1ffc120baec59d7d780bf9b76b3c41b20745cc12e86c2c730677712b124 WHIRLPOOL f45d6441fc0c50e308b6c31afb9b003185aec96f3996a14c15523eb76f39b10dc9b2051e4059dc88ae3a02fd3932bcf816989c71ef506a72100374b034332f05
+DIST asterisk-12.7.0.tar.gz 56880730 SHA256 f58c2d11b633e1d4fd74095f16a3873dc3b554b460e34a17c5fbd59f32273156 SHA512 9febac28f87204a7d69406801f23f5fb9e1734c54fdeac590f4a81ff0887d1c20af2178415e872d94e1755154097c9037ab5a08b796a9a2d5765c68e14bef819 WHIRLPOOL 40139c3049af61c17b61357bc0fac893f68b9e9ee88306841da1778875354b94a528ebdc58d852fb26120a2183c81b6f28d1fac5b6f14a827565abb56ec9ac41
DIST gentoo-asterisk-patchset-3.13.tar.bz2 6321 SHA256 2eb19760f2b2917ff651296a3ab6332e2f087abfa4127d7e3b15d079b65cdf98 SHA512 b0d4f23fe09426dedfc67d2b022388e6c931fa38842ed5436beb3ff4033ce5b83e95d7513bbe3d1def0a98806450713c75b32b7a9211160b12767a8e49f14dde WHIRLPOOL 6e1117a2cad8646551acab72c5436030483fee550bcbfaa6b36745a80896503ce7b20e9c36ee81789331f2b086cf71bc3f213d288d90a189befe4c6a07b9876b
EBUILD asterisk-11.13.1.ebuild 9480 SHA256 44411832125923f106f8ad74e01b087a7eb4d72eb0928a41e09fb46c6a752a05 SHA512 956bae67029942606a5110bb0a5ea583b4eae57c64119028480f509716c79cb4332380ef6c154e4ba5ddbbfca12f24942beddc0a0dc818e47515abccad9c5ac4 WHIRLPOOL 60ec388006656225300875b4a37c5b283494267a4ae3605851577caa592348ba83d142cd30d95611fc18066dd1b5a3e4b3db5f932b55e98b5433eecfd441b58d
+EBUILD asterisk-11.14.0.ebuild 9480 SHA256 37244a83ff2580171c19eab1cc67b94cc6eaf22b8cd334b6e69d100bcd254704 SHA512 b6451f35d0243a8ffdcb5d441606d01235ff67902d5dfe574917a878034afc28422b6d79643fb21801ff3c34bec900f22ef901cd8a0de70543bc94f9088f9ae1 WHIRLPOOL c71036fce435312d0f7385862de30ae69ac5e014d56827ac19df4b2ff893253bd308b6848b5e04ecd394d64d9ae062fef9403a7f3a75410fb63d1be1825ab72d
EBUILD asterisk-12.6.1.ebuild 9499 SHA256 d5bd71ae98ec0e2924be310da97aaea41940e24ced9e79c708ecd9e2a1129969 SHA512 7e6b95ed33caa9b673985bdceb32a03b9f387658e51a0f10878631f880ecb680d5d372f37aefb4d89b251b6840243fad0fd2ecb502379cc1f09614fac618f4ff WHIRLPOOL 5c3e335aa4077c11273cdd9d820558d792d7345db7c4c481b552574eee308af0ce2fa0b71bf1946d4f8365231525dc617dd320f3b3a1fe29b9608d689f694cd5
-MISC ChangeLog 21277 SHA256 c3f3d769f7eba2418138d8542ccf7d6fef65e68deb607fa87368cac380cab64e SHA512 801b5add834f72b2a26d77ad7f5b4f1ae5a662a226cac959ff4ab641e479162ec6dbb14a349361a88f3aa625ce384bcbf20bea2255f0723e1f12f73c8352fd1b WHIRLPOOL cdb9828e7a7e78c15fa715de5066cb2abf2095f957c53fb5d70f931013f1be21ffa6c277b8493734bd7d19773abaf273b2a9ec16da8eb80c627a4ccae3f0df23
+EBUILD asterisk-12.7.0.ebuild 9497 SHA256 e3db4d415f0ea262a285c795bf42584e397c418b368004e7711a982bd18dfac8 SHA512 612ad3bf467140a0af70902c25ebbebb8ab86771fb7d76cedc550087afb24a2074a6167a620c4344cf523c6356609cbf29296fbf48a019f04e61ec23050115e6 WHIRLPOOL 87ceee71a76173ebb1fba76380824c3713448b955fdb143a089e5947395cb820b3753372ede0c000484c59c646fdebd600aa26f13964bd8a58294ac3491e8b49
+MISC ChangeLog 21493 SHA256 2c5d5feef0087ed8d142b2dd75ae9405e0f46678e912b6a75bcad4c6d511460f SHA512 5cb218f5977374978610a786d96f300a34ce7183cefd15ffab31751474bf3f9d2aeb3af0be20ff1f34abe867241e2e48ec90ac9a6dbfd8ff1ca729781e4743e4 WHIRLPOOL 6fc0eaeb07c1ece63df779b8d76fdecfa5d61c711b5ab259c2a69c3768d0d18749fd68bb7f0f1a72485b7f3c1cc2d087ab1f3a6502b41cc343a0fc749d0a96f6
MISC ChangeLog-2012 113409 SHA256 6beb419f0c2e63641c73f2c14bd0c3a6a319c65bca8be526aa441fac2104fc9c SHA512 08c037acd578b9c3c387a80e45e80a68c4da84e63fced30215f22ec14eb6e223348d8e7d68f4decdf8a2d8cd0933b3f7fa3adddf7cd80bb407498b3e2868d917 WHIRLPOOL be0f2192531f7477545ccc0f10d9a50f36228e8d8d0e2773ccce3799c2d1b5e1b7be70d96502f759c7c878f88efd83122fc9230374c40c8963fe0bc7ff014b87
MISC metadata.xml 1080 SHA256 297d1772ab811058eefd6d99d80eff0c552dd1c4c1a55a2d5cafebd14e7b85f9 SHA512 fce6e57053f835e396553796ea3ff64c9411f81fed6e07c77e37b00f23b01739962afb069497764cabf38c3d2f3fcfccdbd0ac41a3da06969ee95faf7e2e3999 WHIRLPOOL 148361759ded02f98c735b0e8d2f72a37b908f8484cd978055ee05c9dc9b290c29c3983a51c4ffebe943a149e3d0df0df2c9b548256027a0ee5df289d63337b0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-iF4EAREIAAYFAlRXh3QACgkQVxOqA9G7/aDbOwD/Zz1BO15SGwlUxU745u7REajF
-+dOMU6FcESk1vE1SN9wA/3zjGNaLsWhJisNF9jSFu9EycdlmCwfVhWarugC7puTZ
-=8PLk
+iEYEAREIAAYFAlRuEVAACgkQp5vW4rUFj5rbEACeIRjQ1KOdNS39xOsz65DK7mw4
+cqIAniS19aEGN5dmv+Y7sutIl7LBk7XC
+=GkIU
-----END PGP SIGNATURE-----
diff --git a/net-misc/asterisk/asterisk-11.14.0.ebuild b/net-misc/asterisk/asterisk-11.14.0.ebuild
new file mode 100644
index 000000000000..8636947470de
--- /dev/null
+++ b/net-misc/asterisk/asterisk-11.14.0.ebuild
@@ -0,0 +1,320 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-11.14.0.ebuild,v 1.1 2014/11/20 16:05:34 chainsaw Exp $
+
+EAPI=5
+inherit autotools base eutils linux-info multilib user
+
+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/releases/${MY_P}.tar.gz
+ mirror://gentoo/gentoo-asterisk-patchset-3.13.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE_VOICEMAIL_STORAGE="
+ +voicemail_storage_file
+ voicemail_storage_odbc
+ voicemail_storage_imap
+"
+IUSE="${IUSE_VOICEMAIL_STORAGE} alsa bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc jabber ldap libedit lua mysql newt +samples odbc osplookup oss portaudio postgres radius selinux snmp span speex srtp static syslog vorbis"
+IUSE_EXPAND="VOICEMAIL_STORAGE"
+REQUIRED_USE="gtalk? ( jabber )
+ ^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
+ voicemail_storage_odbc? ( odbc )
+"
+
+EPATCH_SUFFIX="patch"
+PATCHES=( "${WORKDIR}/asterisk-patchset" )
+
+CDEPEND="dev-db/sqlite:3
+ dev-libs/popt
+ dev-libs/libxml2
+ dev-libs/openssl
+ sys-libs/ncurses
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ bluetooth? ( net-wireless/bluez )
+ calendar? ( net-libs/neon
+ dev-libs/libical
+ dev-libs/iksemel )
+ caps? ( sys-libs/libcap )
+ cluster? ( sys-cluster/corosync )
+ 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.6 )
+ iconv? ( virtual/libiconv )
+ ilbc? ( dev-libs/ilbc-rfc3951 )
+ jabber? ( dev-libs/iksemel )
+ ldap? ( net-nds/openldap )
+ libedit? ( dev-libs/libedit )
+ lua? ( dev-lang/lua )
+ mysql? ( virtual/mysql )
+ newt? ( dev-libs/newt )
+ odbc? ( dev-db/unixODBC )
+ osplookup? ( net-libs/osptoolkit )
+ portaudio? ( media-libs/portaudio )
+ postgres? ( virtual/postgresql )
+ radius? ( net-dialup/radiusclient-ng )
+ snmp? ( net-analyzer/net-snmp )
+ span? ( media-libs/spandsp )
+ speex? ( media-libs/speex )
+ srtp? ( net-libs/libsrtp )
+ vorbis? ( media-libs/libvorbis )"
+
+DEPEND="${CDEPEND}
+ !net-libs/openh323
+ !net-libs/pjsip
+ voicemail_storage_imap? ( virtual/imap-c-client )
+ virtual/pkgconfig
+"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-asterisk )
+ 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() {
+ local vmst
+
+ econf \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir="/var" \
+ --with-crypto \
+ --with-gsm=internal \
+ --with-popt \
+ --with-ssl \
+ --with-z \
+ --without-pwlib \
+ $(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
+
+ # That NATIVE_ARCH chatter really is quite bothersome
+ sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system"
+
+ # 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 alsa chan_alsa
+ use_select bluetooth chan_mobile
+ use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
+ use_select cluster res_corosync
+ 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_motif
+ use_select http res_http_post
+ use_select iconv func_iconv
+ use_select jabber res_xmpp
+ use_select ilbc codec_ilbc format_ilbc
+ 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 vorbis format_ogg_vorbis
+
+ # Voicemail storage ...
+ for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
+ if use ${vmst}; then
+ menuselect/menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
+ fi
+ done
+
+ if use debug; then
+ for o in DONT_OPTIMIZE DEBUG_THREADS BETTER_BACKTRACES; do
+ menuselect/menuselect --enable $o menuselect.makeopts
+ done
+ fi
+}
+
+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
+ diropts -m 0750 -o root -g asterisk
+ keepdir /etc/asterisk
+ if use samples; then
+ emake DESTDIR="${D}" samples
+ for conffile in "${D}"etc/asterisk/*.*
+ do
+ chown root:root $conffile
+ chmod 0644 $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 asterisk
+ keepdir /var/lib/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.initd7 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.8.0/find_call_sip_trace.sh"
+ dodoc "${FILESDIR}/1.8.0/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 "Please read the Asterisk 11 upgrade document:"
+ elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+11"
+}
+
+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-12.7.0.ebuild b/net-misc/asterisk/asterisk-12.7.0.ebuild
new file mode 100644
index 000000000000..9777efc0faef
--- /dev/null
+++ b/net-misc/asterisk/asterisk-12.7.0.ebuild
@@ -0,0 +1,321 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/asterisk/asterisk-12.7.0.ebuild,v 1.1 2014/11/20 16:05:34 chainsaw Exp $
+
+EAPI=5
+inherit autotools base eutils linux-info multilib user
+
+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/releases/${MY_P}.tar.gz
+ mirror://gentoo/gentoo-asterisk-patchset-3.13.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE_VOICEMAIL_STORAGE="
+ +voicemail_storage_file
+ voicemail_storage_odbc
+ voicemail_storage_imap
+"
+IUSE="${IUSE_VOICEMAIL_STORAGE} alsa bluetooth calendar +caps cluster curl dahdi debug doc freetds gtalk http iconv ilbc jabber ldap libedit lua mysql newt +samples odbc osplookup oss portaudio postgres radius selinux snmp span speex srtp static syslog vorbis"
+IUSE_EXPAND="VOICEMAIL_STORAGE"
+REQUIRED_USE="gtalk? ( jabber )
+ ^^ ( ${IUSE_VOICEMAIL_STORAGE/+/} )
+ voicemail_storage_odbc? ( odbc )
+"
+
+EPATCH_SUFFIX="patch"
+PATCHES=( "${WORKDIR}/asterisk-patchset" )
+
+CDEPEND="dev-db/sqlite:3
+ dev-libs/popt
+ dev-libs/jansson
+ dev-libs/libxml2
+ dev-libs/openssl
+ sys-libs/ncurses
+ sys-libs/zlib
+ alsa? ( media-libs/alsa-lib )
+ bluetooth? ( net-wireless/bluez )
+ calendar? ( net-libs/neon
+ dev-libs/libical
+ dev-libs/iksemel )
+ caps? ( sys-libs/libcap )
+ cluster? ( sys-cluster/corosync )
+ 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.6 )
+ iconv? ( virtual/libiconv )
+ ilbc? ( dev-libs/ilbc-rfc3951 )
+ jabber? ( dev-libs/iksemel )
+ ldap? ( net-nds/openldap )
+ libedit? ( dev-libs/libedit )
+ lua? ( dev-lang/lua )
+ mysql? ( virtual/mysql )
+ newt? ( dev-libs/newt )
+ odbc? ( dev-db/unixODBC )
+ osplookup? ( net-libs/osptoolkit )
+ portaudio? ( media-libs/portaudio )
+ postgres? ( virtual/postgresql )
+ radius? ( net-dialup/radiusclient-ng )
+ snmp? ( net-analyzer/net-snmp )
+ span? ( media-libs/spandsp )
+ speex? ( media-libs/speex )
+ srtp? ( net-libs/libsrtp )
+ vorbis? ( media-libs/libvorbis )"
+
+DEPEND="${CDEPEND}
+ !net-libs/openh323
+ !net-libs/pjsip
+ voicemail_storage_imap? ( virtual/imap-c-client )
+ virtual/pkgconfig
+"
+
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-asterisk )
+ 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() {
+ local vmst
+
+ econf \
+ --libdir="/usr/$(get_libdir)" \
+ --localstatedir="/var" \
+ --with-crypto \
+ --with-gsm=internal \
+ --with-popt \
+ --with-ssl \
+ --with-z \
+ --without-pwlib \
+ $(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
+
+ # That NATIVE_ARCH chatter really is quite bothersome
+ sed -i 's/NATIVE_ARCH=/NATIVE_ARCH=0/' build_tools/menuselect-deps || die "Unable to squelch noisy build system"
+
+ # 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 alsa chan_alsa
+ use_select bluetooth chan_mobile
+ use_select calendar res_calendar res_calendar_{caldav,ews,exchange,icalendar}
+ use_select cluster res_corosync
+ 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_motif
+ use_select http res_http_post
+ use_select iconv func_iconv
+ use_select jabber res_xmpp
+ use_select ilbc codec_ilbc format_ilbc
+ 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 vorbis format_ogg_vorbis
+
+ # Voicemail storage ...
+ for vmst in ${IUSE_VOICEMAIL_STORAGE/+/}; do
+ if use ${vmst}; then
+ menuselect/menuselect --enable $(echo ${vmst##*_} | tr '[:lower:]' '[:upper:]')_STORAGE menuselect.makeopts
+ fi
+ done
+
+ if use debug; then
+ for o in DONT_OPTIMIZE DEBUG_THREADS BETTER_BACKTRACES; do
+ menuselect/menuselect --enable $o menuselect.makeopts
+ done
+ fi
+}
+
+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
+ diropts -m 0750 -o root -g asterisk
+ keepdir /etc/asterisk
+ if use samples; then
+ emake DESTDIR="${D}" samples
+ for conffile in "${D}"etc/asterisk/*.*
+ do
+ chown root:root $conffile
+ chmod 0644 $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 asterisk
+ keepdir /var/lib/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.initd7 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.8.0/find_call_sip_trace.sh"
+ dodoc "${FILESDIR}/1.8.0/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 "Please read the Asterisk 12 upgrade document:"
+ elog "https://wiki.asterisk.org/wiki/display/AST/Upgrading+to+Asterisk+12"
+}
+
+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
+}