Merge https://github.com/gentoo/gentoo.git
diff --git a/app-accessibility/at-spi2-atk/at-spi2-atk-2.16.0-r1.ebuild b/app-accessibility/at-spi2-atk/at-spi2-atk-2.16.0-r1.ebuild
index 160813a..c84e5b5 100644
--- a/app-accessibility/at-spi2-atk/at-spi2-atk-2.16.0-r1.ebuild
+++ b/app-accessibility/at-spi2-atk/at-spi2-atk-2.16.0-r1.ebuild
@@ -13,7 +13,7 @@
 
 LICENSE="LGPL-2+"
 SLOT="2"
-KEYWORDS="alpha amd64 ~arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
 IUSE="test"
 
 COMMON_DEPEND="
diff --git a/app-accessibility/at-spi2-core/at-spi2-core-2.16.0.ebuild b/app-accessibility/at-spi2-core/at-spi2-core-2.16.0.ebuild
index 0dda5cb..91c20e4 100644
--- a/app-accessibility/at-spi2-core/at-spi2-core-2.16.0.ebuild
+++ b/app-accessibility/at-spi2-core/at-spi2-core-2.16.0.ebuild
@@ -14,7 +14,7 @@
 LICENSE="LGPL-2+"
 SLOT="2"
 IUSE="+X +introspection"
-KEYWORDS="alpha amd64 ~arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
 
 # x11-libs/libSM is needed until upstream #719808 is solved either
 # making the dep unneeded or fixing their configure
diff --git a/app-accessibility/brltty/metadata.xml b/app-accessibility/brltty/metadata.xml
index 395bfb3..e8e32d5 100644
--- a/app-accessibility/brltty/metadata.xml
+++ b/app-accessibility/brltty/metadata.xml
@@ -18,9 +18,9 @@
 functionality. Some speech capability has also been incorporated. 
 </longdescription>
 <longdescription lang="ja">
-BRLTTYは、盲人用ブライユ点字ディスプレイのためのLinux/Unixコンソールを制御するバ
-ックグラウンド・プロセス(デーモン)です。ブライユ点字ディスプレイを動かし、その多
-機能な完全なスクリーン・レビューを提供します。幾つかの台詞読み上げ機能も統合され
-ています。
+BRLTTYは、盲人用ブライユ点字ディスプレイのためのLinux/Unixコンソールを制御するバ
+ックグラウンド・プロセス(デーモン)です。ブライユ点字ディスプレイを動かし、その多
+機能な完全なスクリーン・レビューを提供します。幾つかの台詞読み上げ機能も統合され
+ています。
 </longdescription>
 </pkgmetadata>
diff --git a/app-accessibility/orca/Manifest b/app-accessibility/orca/Manifest
index 1e055df..ad66383 100644
--- a/app-accessibility/orca/Manifest
+++ b/app-accessibility/orca/Manifest
@@ -1,3 +1,2 @@
-DIST orca-3.14.3.tar.xz 1998804 SHA256 8258dc3174572a4bf1a266ad36df46cf5f2c5a8dc5df1a071f49f812bec2a315 SHA512 579eb592ab99a98598ce7405e180b9e8657c5b418d792f1209684bca7b309bb8e0857fd2766a39fb53835ae44f12e3447dda08402b21113e16c92bb7f60e661d WHIRLPOOL 624fc3c89ad20e734ab61160839a4d469243c587ed8c72b413ee011275e27eff73ac8ffa82f03dfa69902450c0db970b402d4b371e647298ee4b193218851e64
-DIST orca-3.14.4.tar.xz 2016596 SHA256 94a522e0a29143858be0d092346d9996e62b55fefdf4651b5edf79bcb9f4a1ef SHA512 1270c18c83817f02c0804db711915d112ff8e3b336c2dd39eb3ff5e2110393ce0afb030f82bdefb1a56acf6471107d2f237100aa22b85ac88ab04c7325cebfc8 WHIRLPOOL 298004708658a62d8fde7bb0f2ec53a7d4b64188ed663cfc5edd7d788bcc8de7f07bff5ce58ad625572692233652a251e2666640f1309d23a7ab67574cd20125
 DIST orca-3.16.2.tar.xz 2078728 SHA256 cd14b28878cc04166ec43c7d9a8e6b0056c66cbfb1e4f934f12f74568937789a SHA512 768628c4630d84929a8a2b12b73771de7b104b1754e9462b1fe63c2bbadca192e56416a1e2a43ad5f5594c91a4fe94941d2deb1e44cccaf253d4f03704f31ee1 WHIRLPOOL eea3f9a1a0b1aebb4ca3a6da1a5cf016b1ea6d042c4e8e1b7275325cd08e77c6a7c6519048651ace34ef10d69c22663e9009dab20502ff3fca7d6c6c9a888c9a
+DIST orca-3.16.3.tar.xz 2124800 SHA256 540deeaa1a973cc7ccc8a463f8fcf51db51f7ccfb130bc2019ac53bf67943dc7 SHA512 c579437d956bee014db61aeb7494a295345e28a147a938a71a8062c30de67fcff3767c5ea8767067ce5f2f5ff84c0aaf2fc250730e4a7036ae100078fd6f058f WHIRLPOOL 839b3c7170f2fd44fa5b97cfd9ed6989dd94721d379d21428a166b8321fb5162a56f758327df0ea632bf320711362b0e03916358d023fba8dffec2a36f62b970
diff --git a/app-accessibility/orca/orca-3.14.3.ebuild b/app-accessibility/orca/orca-3.14.3.ebuild
deleted file mode 100644
index 5ba9662..0000000
--- a/app-accessibility/orca/orca-3.14.3.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-GCONF_DEBUG="no"
-GNOME2_LA_PUNT="yes"
-PYTHON_COMPAT=( python3_{3,4} )
-PYTHON_REQ_USE="threads"
-
-inherit gnome2 python-r1
-
-DESCRIPTION="Extensible screen reader that provides access to the desktop"
-HOMEPAGE="https://wiki.gnome.org/Projects/Orca"
-
-LICENSE="LGPL-2.1+ CC-BY-SA-3.0"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd"
-
-IUSE="+braille"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-# liblouis is not in portage yet
-# it is used to provide contracted braille support
-# XXX: Check deps for correctness
-COMMON_DEPEND="
-	>=app-accessibility/at-spi2-atk-2.10:2
-	>=app-accessibility/at-spi2-core-2.10:2[introspection]
-	>=dev-libs/atk-2.10
-	>=dev-libs/glib-2.28:2
-	>=dev-python/pygobject-3.10:3[${PYTHON_USEDEP}]
-	>=x11-libs/gtk+-3.6.2:3[introspection]
-	braille? (
-		>=app-accessibility/brltty-5.0-r3[python,${PYTHON_USEDEP}]
-		dev-libs/liblouis[python,${PYTHON_USEDEP}] )
-	${PYTHON_DEPS}
-"
-RDEPEND="${COMMON_DEPEND}
-	>=app-accessibility/speech-dispatcher-0.8[python,${PYTHON_USEDEP}]
-	dev-libs/atk[introspection]
-	dev-python/pyatspi[${PYTHON_USEDEP}]
-	dev-python/setproctitle[${PYTHON_USEDEP}]
-	x11-libs/libwnck:3[introspection]
-	x11-libs/pango[introspection]
-"
-DEPEND="${COMMON_DEPEND}
-	>=dev-util/intltool-0.50
-	virtual/pkgconfig
-"
-#	app-text/yelp-tools
-
-src_prepare() {
-	gnome2_src_prepare
-
-	python_copy_sources
-}
-
-src_configure() {
-	python_foreach_impl run_in_build_dir gnome2_src_configure \
-		ITSTOOL="$(type -P true)" \
-		$(use_with braille liblouis)
-}
-
-src_compile() {
-	python_foreach_impl run_in_build_dir gnome2_src_compile
-}
-
-src_install() {
-	DOCS="AUTHORS ChangeLog MAINTAINERS NEWS README TODO"
-	installing() {
-		gnome2_src_install
-		# Massage shebang to make python_doscript happy
-		sed -e 's:#!'"${PYTHON}:#!/usr/bin/python:" \
-			-i src/orca/orca || die
-		python_doscript src/orca/orca
-	}
-	python_foreach_impl run_in_build_dir installing
-}
diff --git a/app-accessibility/orca/orca-3.14.4.ebuild b/app-accessibility/orca/orca-3.14.4.ebuild
deleted file mode 100644
index 792a5dd..0000000
--- a/app-accessibility/orca/orca-3.14.4.ebuild
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-GCONF_DEBUG="no"
-GNOME2_LA_PUNT="yes"
-PYTHON_COMPAT=( python3_{3,4} )
-PYTHON_REQ_USE="threads"
-
-inherit gnome2 python-r1
-
-DESCRIPTION="Extensible screen reader that provides access to the desktop"
-HOMEPAGE="https://wiki.gnome.org/Projects/Orca"
-
-LICENSE="LGPL-2.1+ CC-BY-SA-3.0"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd"
-
-IUSE="+braille"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-# liblouis is not in portage yet
-# it is used to provide contracted braille support
-# XXX: Check deps for correctness
-COMMON_DEPEND="${PYTHON_DEPS}
-	>=app-accessibility/at-spi2-atk-2.10:2
-	>=app-accessibility/at-spi2-core-2.10:2[introspection]
-	>=dev-libs/atk-2.10
-	>=dev-libs/glib-2.28:2
-	>=dev-python/pygobject-3.10:3[${PYTHON_USEDEP}]
-	>=x11-libs/gtk+-3.6.2:3[introspection]
-	braille? (
-		>=app-accessibility/brltty-5.0-r3[python,${PYTHON_USEDEP}]
-		dev-libs/liblouis[python,${PYTHON_USEDEP}] )
-"
-RDEPEND="${COMMON_DEPEND}
-	>=app-accessibility/speech-dispatcher-0.8[python,${PYTHON_USEDEP}]
-	dev-libs/atk[introspection]
-	dev-python/pyatspi[${PYTHON_USEDEP}]
-	dev-python/setproctitle[${PYTHON_USEDEP}]
-	x11-libs/libwnck:3[introspection]
-	x11-libs/pango[introspection]
-"
-DEPEND="${COMMON_DEPEND}
-	>=dev-util/intltool-0.50
-	virtual/pkgconfig
-"
-#	app-text/yelp-tools
-
-src_prepare() {
-	gnome2_src_prepare
-
-	python_copy_sources
-}
-
-src_configure() {
-	python_foreach_impl run_in_build_dir gnome2_src_configure \
-		ITSTOOL="$(type -P true)" \
-		$(use_with braille liblouis)
-}
-
-src_compile() {
-	python_foreach_impl run_in_build_dir gnome2_src_compile
-}
-
-src_install() {
-	DOCS="AUTHORS ChangeLog MAINTAINERS NEWS README TODO"
-	installing() {
-		gnome2_src_install
-		# Massage shebang to make python_doscript happy
-		sed -e 's:#!'"${PYTHON}:#!/usr/bin/python:" \
-			-i src/orca/orca || die
-		python_doscript src/orca/orca
-	}
-	python_foreach_impl run_in_build_dir installing
-}
diff --git a/app-accessibility/orca/orca-3.16.3.ebuild b/app-accessibility/orca/orca-3.16.3.ebuild
new file mode 100644
index 0000000..00c8093
--- /dev/null
+++ b/app-accessibility/orca/orca-3.16.3.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+GCONF_DEBUG="no"
+GNOME2_LA_PUNT="yes"
+PYTHON_COMPAT=( python3_{3,4} )
+PYTHON_REQ_USE="threads"
+
+inherit gnome2 python-r1
+
+DESCRIPTION="Extensible screen reader that provides access to the desktop"
+HOMEPAGE="https://wiki.gnome.org/Projects/Orca"
+
+LICENSE="LGPL-2.1+ CC-BY-SA-3.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+
+IUSE="+braille"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# liblouis is not in portage yet
+# it is used to provide contracted braille support
+# XXX: Check deps for correctness
+COMMON_DEPEND="${PYTHON_DEPS}
+	>=app-accessibility/at-spi2-atk-2.10:2
+	>=app-accessibility/at-spi2-core-2.10:2[introspection]
+	>=dev-libs/atk-2.10
+	>=dev-libs/glib-2.28:2
+	>=dev-python/pygobject-3.10:3[${PYTHON_USEDEP}]
+	>=x11-libs/gtk+-3.6.2:3[introspection]
+	braille? (
+		>=app-accessibility/brltty-5.0-r3[python,${PYTHON_USEDEP}]
+		dev-libs/liblouis[python,${PYTHON_USEDEP}] )
+"
+RDEPEND="${COMMON_DEPEND}
+	>=app-accessibility/speech-dispatcher-0.8[python,${PYTHON_USEDEP}]
+	dev-libs/atk[introspection]
+	dev-python/pyatspi[${PYTHON_USEDEP}]
+	dev-python/setproctitle[${PYTHON_USEDEP}]
+	x11-libs/libwnck:3[introspection]
+	x11-libs/pango[introspection]
+"
+DEPEND="${COMMON_DEPEND}
+	>=dev-util/intltool-0.50
+	dev-util/itstool
+	virtual/pkgconfig
+"
+#	app-text/yelp-tools
+
+src_prepare() {
+	gnome2_src_prepare
+	python_copy_sources
+}
+
+src_configure() {
+	python_foreach_impl run_in_build_dir gnome2_src_configure \
+		$(use_with braille liblouis)
+}
+
+src_compile() {
+	python_foreach_impl run_in_build_dir gnome2_src_compile
+}
+
+src_install() {
+	DOCS="AUTHORS ChangeLog MAINTAINERS NEWS README TODO"
+	installing() {
+		gnome2_src_install
+		# Massage shebang to make python_doscript happy
+		sed -e 's:#!'"${PYTHON}:#!/usr/bin/python:" \
+			-i src/orca/orca || die
+		python_doscript src/orca/orca
+	}
+	python_foreach_impl run_in_build_dir installing
+}
diff --git a/app-admin/ansible/Manifest b/app-admin/ansible/Manifest
index 416c4cc..d4b79fe 100644
--- a/app-admin/ansible/Manifest
+++ b/app-admin/ansible/Manifest
@@ -1,2 +1,3 @@
 DIST ansible-1.9.2.tar.gz 927525 SHA256 c25ef4738b08fdfb3094247c012f3fd1b29972acbd37f988070b2a85f5fbee00 SHA512 6c0b3eaac11e11bf90f5b63c54da86df0cb33b0ee98c987c48a68fa643b39e9f0817884767f2bd9c0f6e8852d37fd1b197d5299abc574fccc181fbb22985d4ad WHIRLPOOL 19d50845b9920d85c5ce0380303144e7a4237e673dd4beb5ff020042d7bac59dc0706cff88f08155029ce1a3aa9decc3c54261f9f16524b6e5e3b42e599d3a6b
 DIST ansible-1.9.3.tar.gz 936633 SHA256 2594f642fd800056a427c1026410dc6ed8dfa7c0033f5c3d187abdb2b0d4eeed SHA512 280d7506417affc11fe8c8715f82ffb011991e48e96db73aca915e1393d51073564c78a98b018c380b7fb8e697ce0fac6208822da44f2bac545f142707325d43 WHIRLPOOL 5738bcd263ca32279bbca30e3f1b5c53e5bd72a18025fdb82393a8d85e5a826b3be4ce78cbbc648133768d212fa49d1c3320af4b34f948c1b1cee40d73147f8a
+DIST ansible-1.9.4.tar.gz 937120 SHA256 972c2face49f1577bd0ff7989440bfe2820e66fb10d7579915cc536bccfa6fe3 SHA512 53ef5b3390be620cedc92687c7c9853c42f38547494f9b77056d5ea48ccd8f43d193648a7f4569fcba5afad343a9202b123296ab47c8cd02eecfe455d83b9586 WHIRLPOOL 0b88a27f690ff940eae1969ff163d8f8c26df038d2e9aa76694bdba1448ac9cbe8123795d0787e528c6d22cf66cc01d6b89add8e3e97bbb107a3f1a96860fd8e
diff --git a/app-admin/ansible/ansible-1.9.3.ebuild b/app-admin/ansible/ansible-1.9.3.ebuild
index 273d25a..7c8406c 100644
--- a/app-admin/ansible/ansible-1.9.3.ebuild
+++ b/app-admin/ansible/ansible-1.9.3.ebuild
@@ -14,7 +14,7 @@
 
 LICENSE="GPL-3"
 SLOT="0"
-KEYWORDS="~amd64 ~x86 ~x64-macos"
+KEYWORDS="amd64 ~x86 ~x64-macos"
 IUSE="test"
 
 RDEPEND="
diff --git a/app-admin/ansible/ansible-1.9.4.ebuild b/app-admin/ansible/ansible-1.9.4.ebuild
new file mode 100644
index 0000000..273d25a
--- /dev/null
+++ b/app-admin/ansible/ansible-1.9.4.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 eutils readme.gentoo
+
+DESCRIPTION="Radically simple deployment, model-driven configuration management, and command execution framework"
+HOMEPAGE="http://ansible.com/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~x64-macos"
+IUSE="test"
+
+RDEPEND="
+	dev-python/httplib2[${PYTHON_USEDEP}]
+	dev-python/jinja[${PYTHON_USEDEP}]
+	dev-python/keyczar[${PYTHON_USEDEP}]
+	>=dev-python/pycrypto-2.6[${PYTHON_USEDEP}]
+	dev-python/pyyaml[${PYTHON_USEDEP}]
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	net-misc/sshpass
+	virtual/ssh
+"
+DEPEND="
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	test? (
+		${RDEPEND}
+		dev-python/mock[${PYTHON_USEDEP}]
+		dev-python/nose[${PYTHON_USEDEP}]
+		dev-python/passlib[${PYTHON_USEDEP}]
+		dev-vcs/git
+	)"
+
+# not included in release tarball
+RESTRICT="test"
+
+python_test() {
+	nosetests -d -w test/units -v --with-coverage --cover-package=ansible --cover-branches || die
+}
+
+python_install_all() {
+	EXAMPLES=( examples )
+	distutils-r1_python_install_all
+
+	doman docs/man/man1/*.1
+
+	newenvd "${FILESDIR}"/${PN}.env 95ansible
+}
+
+src_install() {
+	distutils-r1_src_install
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	optfeature "Alternative ssh transport" dev-python/paramiko
+}
diff --git a/app-admin/collectd/files/collectd.initd b/app-admin/collectd/files/collectd.initd
index 4f48a11..10d2952 100644
--- a/app-admin/collectd/files/collectd.initd
+++ b/app-admin/collectd/files/collectd.initd
@@ -47,6 +47,7 @@
 
 	ebegin "Starting collectd"
 	start-stop-daemon --start --user "${COLLECTD_USER}:collectd" \
+		--env LC_NUMERIC=C \
 		--nicelevel "${COLLECTD_NICELVL}" --exec /usr/sbin/collectd -- \
 			-P "${COLLECTD_PIDFILE}" -C "${COLLECTD_CFGFILE}"
 	eend $? "Failed to start collectd"
@@ -55,6 +56,7 @@
 stop() {
 	ebegin "Stopping collectd"
 	start-stop-daemon --stop \
+		--env LC_NUMERIC=C \
 		--pidfile "${COLLECTD_PIDFILE}"
 	eend $? "Failed to stop collectd"
 }
diff --git a/app-admin/conky/conky-1.10.0.ebuild b/app-admin/conky/conky-1.10.0.ebuild
index d6660ea..5994fb8 100644
--- a/app-admin/conky/conky-1.10.0.ebuild
+++ b/app-admin/conky/conky-1.10.0.ebuild
@@ -12,7 +12,7 @@
 
 LICENSE="GPL-3 BSD LGPL-2.1 MIT"
 SLOT="0"
-KEYWORDS="~amd64 ~ppc ~x86"
+KEYWORDS="~amd64 ~arm ~ppc ~x86"
 IUSE="apcupsd audacious cmus curl debug eve hddtemp ical iconv imlib iostats
 	ipv6 irc lua-cairo lua-imlib lua-rsvg math moc mpd mysql nano-syntax
 	ncurses nvidia +portmon rss thinkpad truetype vim-syntax weather-metar
@@ -64,6 +64,7 @@
 	"
 DEPEND="
 	${DEPEND_COMMON}
+	app-text/docbook2X
 	"
 
 CONFIG_CHECK=IPV6
diff --git a/app-admin/gkrellm/gkrellm-2.3.6_rc1-r1.ebuild b/app-admin/gkrellm/gkrellm-2.3.6_rc1-r1.ebuild
new file mode 100644
index 0000000..fa3ef34
--- /dev/null
+++ b/app-admin/gkrellm/gkrellm-2.3.6_rc1-r1.ebuild
@@ -0,0 +1,145 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib user systemd toolchain-funcs
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="Single process stack of various system monitors"
+HOMEPAGE="http://www.gkrellm.net/"
+SRC_URI="http://gkrellm.srcbox.net/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="gnutls hddtemp libressl lm_sensors nls ntlm ssl kernel_FreeBSD X"
+
+RDEPEND="
+	dev-libs/glib:2
+	hddtemp? ( app-admin/hddtemp )
+	gnutls? ( net-libs/gnutls )
+	!gnutls? (
+		ssl? (
+			!libressl? ( dev-libs/openssl:0= )
+			libressl? ( dev-libs/libressl:= )
+		)
+	)
+	lm_sensors? ( sys-apps/lm_sensors )
+	nls? ( virtual/libintl )
+	ntlm? ( net-libs/libntlm )
+	X? (
+		x11-libs/gdk-pixbuf
+		x11-libs/gtk+:2
+		x11-libs/libICE
+		x11-libs/libSM
+		x11-libs/libX11
+		x11-libs/pango
+		)"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.3.5-cifs.patch
+	"${FILESDIR}"/${PN}-2.3.5-config.patch
+	"${FILESDIR}"/${PN}-2.3.5-width.patch
+	"${FILESDIR}"/${PN}-2.3.5-sansfont.patch
+	"${FILESDIR}"/${P}-fix_gtk_deprecation_warning.patch
+	"${FILESDIR}"/${P}-fix_copypaste_error.patch
+	"${FILESDIR}"/${P}-avoid_possible_busy_loop.patch
+	"${FILESDIR}"/${P}-update_german_translation.patch.xz
+)
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+	enewgroup gkrellmd
+	enewuser gkrellmd -1 -1 -1 gkrellmd
+	TARGET=
+	use kernel_FreeBSD && TARGET="freebsd"
+}
+
+src_prepare() {
+	sed -e 's:-O2 ::' \
+		-e 's:override CC:CFLAGS:' \
+		-e 's:-L/usr/X11R6/lib::' \
+		-i */Makefile || die "sed Makefile(s) failed"
+
+	sed -e "s:/usr/lib:${EPREFIX}/usr/$(get_libdir):" \
+		-e "s:/usr/local/lib:${EPREFIX}/usr/local/$(get_libdir):" \
+		-i src/${PN}.h || die "sed ${PN}.h failed"
+
+	epatch ${PATCHES[@]}
+}
+
+src_compile() {
+	if use X ; then
+		local sslopt=""
+		if use gnutls; then
+			sslopt="without-ssl=yes"
+		elif use ssl; then
+			sslopt="without-gnutls=yes"
+		else
+			sslopt="without-ssl=yes without-gnutls=yes"
+		fi
+
+		emake \
+			${TARGET} \
+			CC="$(tc-getCC)" \
+			STRIP="" \
+			INSTALLROOT="${EPREFIX}/usr" \
+			INCLUDEDIR="${EPREFIX}/usr/include/gkrellm2" \
+			LOCALEDIR="${EPREFIX}/usr/share/locale" \
+			$(usex nls "" "enable_nls=0") \
+			$(usex lm_sensors "" "without-libsensors=yes") \
+			$(usex ntlm "" "without-ntlm=yes") \
+			${sslopt}
+	else
+		cd server || die
+		emake \
+			${TARGET} \
+			CC="$(tc-getCC)" \
+			LINK_FLAGS="$LDFLAGS -Wl,-E" \
+			STRIP="" \
+			$(usex nls "" "enable_nls=0") \
+			$(usex lm_sensors "" "without-libsensors=yes")
+	fi
+}
+
+src_install() {
+	if use X ; then
+		emake \
+			install${TARGET:+_}${TARGET} \
+			$(usex nls "" "enable_nls=0") \
+			STRIP="" \
+			INSTALLDIR="${ED}/usr/bin" \
+			INCLUDEDIR="${ED}/usr/include" \
+			LOCALEDIR="${ED}/usr/share/locale" \
+			PKGCONFIGDIR="${ED}/usr/$(get_libdir)/pkgconfig" \
+			MANDIR="${ED}/usr/share/man/man1"
+
+		dohtml *.html
+
+		newicon src/icon.xpm ${PN}.xpm
+		make_desktop_entry ${PN} GKrellM ${PN}
+	else
+		dobin server/gkrellmd
+
+		insinto /usr/include/gkrellm2
+		doins server/gkrellmd.h
+		doins shared/log.h
+	fi
+
+	newinitd "${FILESDIR}"/gkrellmd.initd gkrellmd
+	newconfd "${FILESDIR}"/gkrellmd.conf gkrellmd
+
+	systemd_dounit "${FILESDIR}"/gkrellmd.service
+
+	insinto /etc
+	doins server/gkrellmd.conf
+
+	dodoc Changelog CREDITS README
+}
diff --git a/app-admin/glance/files/CVE-2015-3289_2015.1.0.patch b/app-admin/glance/files/CVE-2015-3289_2015.1.0.patch
deleted file mode 100644
index 5b69774..0000000
--- a/app-admin/glance/files/CVE-2015-3289_2015.1.0.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 88f92eb11d556bf43e2800a05973ad2da0db0195 Mon Sep 17 00:00:00 2001
-From: Flavio Percoco <flaper87@gmail.com>
-Date: Fri, 8 May 2015 11:44:14 +0200
-Subject: [PATCH] Save image data after setting the data
-
-The image's locations are missing when image's are imported using tasks
-because the ImportToStore task is not saving the image metadata after
-the import. This patch fixes that.
-
-Change-Id: I43dec450d5fc4bee2131d78dbe3c2b2373c3f739
-Closes-bug: #1453068
-(cherry picked from commit 4efb56aae9288952bdb0d368a7c307e8524b80d8)
----
- glance/async/flows/base_import.py            | 4 ++++
- glance/tests/unit/async/flows/test_import.py | 4 ++++
- 2 files changed, 8 insertions(+)
-
-diff --git a/glance/async/flows/base_import.py b/glance/async/flows/base_import.py
-index 487247c..7656bde 100644
---- a/glance/async/flows/base_import.py
-+++ b/glance/async/flows/base_import.py
-@@ -283,6 +283,10 @@ class _ImportToStore(task.Task):
- 
-         image_import.set_image_data(image, file_path or self.uri, None)
- 
-+        # NOTE(flaper87): We need to save the image again after the locations
-+        # have been set in the image.
-+        self.image_repo.save(image)
-+
- 
- class _SaveImage(task.Task):
- 
-diff --git a/glance/tests/unit/async/flows/test_import.py b/glance/tests/unit/async/flows/test_import.py
-index 0f355bc..7acd599 100644
---- a/glance/tests/unit/async/flows/test_import.py
-+++ b/glance/tests/unit/async/flows/test_import.py
-@@ -112,6 +112,10 @@ class TestImportTask(test_utils.BaseTestCase):
-                                           "%s.tasks_import" % image_path)
-             self.assertFalse(os.path.exists(tmp_image_path))
-             self.assertTrue(os.path.exists(image_path))
-+            self.assertEqual(1, len(list(self.image.locations)))
-+            self.assertEqual("file://%s/%s" % (self.test_dir,
-+                                               self.image.image_id),
-+                             self.image.locations[0]['url'])
- 
-     def test_import_flow_missing_work_dir(self):
-         self.config(engine_mode='serial', group='taskflow_executor')
--- 
-2.3.6
-
diff --git a/app-admin/glance/files/CVE-2015-5286_2015.1.1.patch b/app-admin/glance/files/CVE-2015-5286_2015.1.1.patch
new file mode 100644
index 0000000..0478135
--- /dev/null
+++ b/app-admin/glance/files/CVE-2015-5286_2015.1.1.patch
@@ -0,0 +1,137 @@
+From 5bebd513fa71edcdb84f7dec7b16f3523c0c1092 Mon Sep 17 00:00:00 2001
+From: Mike Fedosin <mfedosin@mirantis.com>
+Date: Sun, 20 Sep 2015 17:01:22 +0300
+Subject: Cleanup chunks for deleted image if token expired
+
+In patch I47229b366c25367ec1bd48aec684e0880f3dfe60 it was
+introduced the logic that if image was deleted during file
+upload when we want to update image status from 'saving'
+to 'active' it's expected to get Duplicate error and delete
+stale chunks after that. But if user's token is expired
+there will be Unathorized exception and chunks will stay
+in store and clog it.
+And when, the upload operation for such an image is
+completed the operator configured quota can be exceeded.
+
+This patch fixes the issue of left over chunks for an image
+which was deleted from saving status, by correctly handle
+auth exceptions from registry server.
+
+Partial-bug: #1498163
+
+Conflicts:
+	glance/api/v1/upload_utils.py
+        (Kilo catches NotFound instead of ImagenotFound)
+
+Change-Id: I17a66eca55bfb83107046910e69c4da01415deec
+(cherry picked from commit 98a8832777a0639a4031e52c69f0d565b3f500c5)
+
+diff --git a/glance/api/v1/upload_utils.py b/glance/api/v1/upload_utils.py
+index 7adb2dc..ad4f724 100644
+--- a/glance/api/v1/upload_utils.py
++++ b/glance/api/v1/upload_utils.py
+@@ -171,6 +171,14 @@ def upload_data_to_store(req, image_meta, image_data, store, notifier):
+                     raise exception.NotFound()
+                 else:
+                     raise
++
++        except exception.NotAuthenticated as e:
++            # Delete image data due to possible token expiration.
++            LOG.debug("Authentication error - the token may have "
++                      "expired during file upload. Deleting image data for "
++                      " %s " % image_id)
++            initiate_deletion(req, location_data, image_id)
++            raise webob.exc.HTTPUnauthorized(explanation=e.msg, request=req)
+         except exception.NotFound:
+             msg = _LI("Image %s could not be found after upload. The image may"
+                       " have been deleted during the upload.") % image_id
+diff --git a/glance/api/v2/image_data.py b/glance/api/v2/image_data.py
+index 4025eeb..9967662 100644
+--- a/glance/api/v2/image_data.py
++++ b/glance/api/v2/image_data.py
+@@ -88,7 +88,19 @@ class ImageDataController(object):
+                 raise webob.exc.HTTPGone(explanation=msg,
+                                          request=req,
+                                          content_type='text/plain')
+-
++            except exception.NotAuthenticated:
++                msg = (_("Authentication error - the token may have "
++                         "expired during file upload. Deleting image data for "
++                         "%s.") % image_id)
++                LOG.debug(msg)
++                try:
++                    image.delete()
++                except exception.NotAuthenticated:
++                    # NOTE: Ignore this exception
++                    pass
++                raise webob.exc.HTTPUnauthorized(explanation=msg,
++                                                 request=req,
++                                                 content_type='text/plain')
+         except ValueError as e:
+             LOG.debug("Cannot save data for image %(id)s: %(e)s",
+                       {'id': image_id, 'e': utils.exception_to_str(e)})
+diff --git a/glance/tests/unit/v1/test_upload_utils.py b/glance/tests/unit/v1/test_upload_utils.py
+index 1afaf00..8d05515 100644
+--- a/glance/tests/unit/v1/test_upload_utils.py
++++ b/glance/tests/unit/v1/test_upload_utils.py
+@@ -323,3 +323,29 @@ class TestUploadUtils(base.StoreClearingUnitTest):
+                                   'metadata': {}}, image_meta['id'])
+                         mock_safe_kill.assert_called_once_with(
+                             req, image_meta['id'], 'saving')
++
++    @mock.patch.object(registry, 'update_image_metadata',
++                       side_effect=exception.NotAuthenticated)
++    @mock.patch.object(upload_utils, 'initiate_deletion')
++    def test_activate_image_with_expired_token(
++            self, mocked_delete, mocked_update):
++        """Test token expiration during image upload.
++
++        If users token expired before image was uploaded then if auth error
++        was caught from registry during changing image status from 'saving'
++        to 'active' then it's required to delete all image data.
++        """
++        context = mock.Mock()
++        req = mock.Mock()
++        req.context = context
++        with self._get_store_and_notifier() as (location, checksum, image_meta,
++                                                image_data, store, notifier,
++                                                update_data):
++            self.assertRaises(webob.exc.HTTPUnauthorized,
++                              upload_utils.upload_data_to_store,
++                              req, image_meta, image_data, store, notifier)
++            self.assertEqual(2, mocked_update.call_count)
++            mocked_delete.assert_called_once_with(
++                req,
++                {'url': 'file://foo/bar', 'status': 'active', 'metadata': {}},
++                'c80a1a6c-bd1f-41c5-90ee-81afedb1d58d')
+diff --git a/glance/tests/unit/v2/test_image_data_resource.py b/glance/tests/unit/v2/test_image_data_resource.py
+index bc8891e..7458eda 100644
+--- a/glance/tests/unit/v2/test_image_data_resource.py
++++ b/glance/tests/unit/v2/test_image_data_resource.py
+@@ -192,6 +192,23 @@ class TestImagesController(base.StoreClearingUnitTest):
+         self.assertRaises(webob.exc.HTTPBadRequest, self.controller.upload,
+                           request, unit_test_utils.UUID1, 'YYYY', 4)
+ 
++    def test_upload_with_expired_token(self):
++        def side_effect(image, from_state=None):
++            if from_state == 'saving':
++                raise exception.NotAuthenticated()
++
++        mocked_save = mock.Mock(side_effect=side_effect)
++        mocked_delete = mock.Mock()
++        request = unit_test_utils.get_fake_request()
++        image = FakeImage('abcd')
++        image.delete = mocked_delete
++        self.image_repo.result = image
++        self.image_repo.save = mocked_save
++        self.assertRaises(webob.exc.HTTPUnauthorized, self.controller.upload,
++                          request, unit_test_utils.UUID1, 'YYYY', 4)
++        self.assertEqual(3, mocked_save.call_count)
++        mocked_delete.assert_called_once_with()
++
+     def test_upload_non_existent_image_during_save_initiates_deletion(self):
+         def fake_save_not_found(self):
+             raise exception.NotFound()
+-- 
+cgit v0.10.2
+
diff --git a/app-admin/glance/glance-2015.1.1-r2.ebuild b/app-admin/glance/glance-2015.1.1-r2.ebuild
deleted file mode 100644
index 78e711b..0000000
--- a/app-admin/glance/glance-2015.1.1-r2.ebuild
+++ /dev/null
@@ -1,190 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-PYTHON_COMPAT=( python2_7 )
-
-inherit distutils-r1 user
-
-DESCRIPTION="Provides services for discovering, registering, and retrieving
-virtual machine images"
-HOMEPAGE="https://launchpad.net/glance"
-SRC_URI="https://launchpad.net/${PN}/kilo/${PV}/+download/${P}.tar.gz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="amd64 x86"
-IUSE="doc mysql postgres +sqlite +swift test"
-REQUIRED_USE="|| ( mysql postgres sqlite )"
-
-DEPEND="
-		dev-python/setuptools[${PYTHON_USEDEP}]
-		>=dev-python/pbr-0.8.0[${PYTHON_USEDEP}]
-		<dev-python/pbr-1.0[${PYTHON_USEDEP}]
-		test? (
-			${RDEPEND}
-			>=dev-python/hacking-0.10.0[${PYTHON_USEDEP}]
-			<dev-python/hacking-0.11[${PYTHON_USEDEP}]
-			>=dev-python/Babel-1.3[${PYTHON_USEDEP}]
-			>=dev-python/coverage-3.6[${PYTHON_USEDEP}]
-			>=dev-python/fixtures-0.3.14[${PYTHON_USEDEP}]
-			<dev-python/fixtures-1.3.0[${PYTHON_USEDEP}]
-			>=dev-python/mock-1.0[${PYTHON_USEDEP}]
-			<dev-python/mock-1.1.0[${PYTHON_USEDEP}]
-			>=dev-python/sphinx-1.1.2[${PYTHON_USEDEP}]
-			!~dev-python/sphinx-1.2.0[${PYTHON_USEDEP}]
-			<dev-python/sphinx-1.3[${PYTHON_USEDEP}]
-			>=dev-python/requests-2.2.0[${PYTHON_USEDEP}]
-			!~dev-python/requests-2.4.0[${PYTHON_USEDEP}]
-			>=dev-python/testrepository-0.0.18[${PYTHON_USEDEP}]
-			>=dev-python/testtools-0.9.36[${PYTHON_USEDEP}]
-			!~dev-python/testtools-1.2.0[${PYTHON_USEDEP}]
-			>=dev-python/psutil-1.1.1[${PYTHON_USEDEP}]
-			<dev-python/psutil-2.0.0[${PYTHON_USEDEP}]
-			>=dev-python/oslotest-1.5.1[${PYTHON_USEDEP}]
-			<dev-python/oslotest-1.6.0[${PYTHON_USEDEP}]
-			dev-python/mysql-python[${PYTHON_USEDEP}]
-			dev-python/psycopg[${PYTHON_USEDEP}]
-			~dev-python/pysendfile-2.0.1[${PYTHON_USEDEP}]
-			dev-python/qpid-python[${PYTHON_USEDEP}]
-			>=dev-python/pyxattr-0.5.0[${PYTHON_USEDEP}]
-			>=dev-python/oslo-sphinx-2.5.0[${PYTHON_USEDEP}]
-			<dev-python/oslo-sphinx-2.6.0[${PYTHON_USEDEP}]
-			>=dev-python/elasticsearch-py-1.3.0[${PYTHON_USEDEP}]
-		)"
-
-#note to self, wsgiref is a python builtin, no need to package it
-#>=dev-python/wsgiref-0.1.2[${PYTHON_USEDEP}]
-
-RDEPEND="
-	>=dev-python/greenlet-0.3.2[${PYTHON_USEDEP}]
-	sqlite? (
-		>=dev-python/sqlalchemy-0.9.7[sqlite,${PYTHON_USEDEP}]
-		<=dev-python/sqlalchemy-0.9.99[sqlite,${PYTHON_USEDEP}]
-	)
-	mysql? (
-		dev-python/mysql-python
-		>=dev-python/sqlalchemy-0.9.7[${PYTHON_USEDEP}]
-		<=dev-python/sqlalchemy-0.9.99[${PYTHON_USEDEP}]
-	)
-	postgres? (
-		dev-python/psycopg:2
-		>=dev-python/sqlalchemy-0.9.7[${PYTHON_USEDEP}]
-		<=dev-python/sqlalchemy-0.9.99[${PYTHON_USEDEP}]
-	)
-	>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
-	>=dev-python/eventlet-0.16.1[${PYTHON_USEDEP}]
-	!~dev-python/eventlet-0.17.0[${PYTHON_USEDEP}]
-	>=dev-python/pastedeploy-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/routes-1.12.3[${PYTHON_USEDEP}]
-	!~dev-python/routes-2.0[${PYTHON_USEDEP}]
-	>=dev-python/webob-1.2.3[${PYTHON_USEDEP}]
-	>=dev-python/sqlalchemy-migrate-0.9.5[${PYTHON_USEDEP}]
-	>=dev-python/httplib2-0.7.5[${PYTHON_USEDEP}]
-	>=dev-python/kombu-2.5.0[${PYTHON_USEDEP}]
-	>=dev-python/pycrypto-2.6[${PYTHON_USEDEP}]
-	>=dev-python/iso8601-0.1.9[${PYTHON_USEDEP}]
-	dev-python/ordereddict[${PYTHON_USEDEP}]
-	>=dev-python/oslo-config-1.9.3[${PYTHON_USEDEP}]
-	<dev-python/oslo-config-1.10.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-concurrency-1.8.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-concurrency-1.9.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-context-0.2.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-context-0.3.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-utils-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-utils-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/stevedore-1.3.0[${PYTHON_USEDEP}]
-	<dev-python/stevedore-1.4.0[${PYTHON_USEDEP}]
-	>=dev-python/taskflow-0.7.1[${PYTHON_USEDEP}]
-	<dev-python/taskflow-0.8.0[${PYTHON_USEDEP}]
-	>=dev-python/keystonemiddleware-1.5.0[${PYTHON_USEDEP}]
-	<dev-python/keystonemiddleware-1.6.0[${PYTHON_USEDEP}]
-	>=dev-python/WSME-0.6[${PYTHON_USEDEP}]
-	<dev-python/WSME-0.7[${PYTHON_USEDEP}]
-	dev-python/posix_ipc[${PYTHON_USEDEP}]
-	swift? (
-		>=dev-python/python-swiftclient-2.2.0[${PYTHON_USEDEP}]
-		<dev-python/python-swiftclient-2.5.0[${PYTHON_USEDEP}]
-	)
-	>=dev-python/oslo-vmware-0.11.1[${PYTHON_USEDEP}]
-	<dev-python/oslo-vmware-0.12.0[${PYTHON_USEDEP}]
-	dev-python/paste[${PYTHON_USEDEP}]
-	>=dev-python/jsonschema-2.0.0[${PYTHON_USEDEP}]
-	<dev-python/jsonschema-3.0.0[${PYTHON_USEDEP}]
-	>=dev-python/python-keystoneclient-1.2.0[${PYTHON_USEDEP}]
-	<dev-python/python-keystoneclient-1.4.0[${PYTHON_USEDEP}]
-	>=dev-python/pyopenssl-0.11[${PYTHON_USEDEP}]
-	>=dev-python/six-1.9.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-db-1.7.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-db-1.8.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-i18n-1.5.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-i18n-1.6.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-log-1.0.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-log-1.1.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-messaging-1.8.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-messaging-1.9.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-policy-0.3.1[${PYTHON_USEDEP}]
-	<dev-python/oslo-policy-0.4.0[${PYTHON_USEDEP}]
-	>=dev-python/oslo-serialization-1.4.0[${PYTHON_USEDEP}]
-	<dev-python/oslo-serialization-1.5.0[${PYTHON_USEDEP}]
-	>=dev-python/retrying-1.2.3[${PYTHON_USEDEP}]
-	!~dev-python/retrying-1.3.0[${PYTHON_USEDEP}]
-	>=dev-python/osprofiler-0.3.0[${PYTHON_USEDEP}]
-	>=dev-python/glance_store-0.3.0[${PYTHON_USEDEP}]
-	<dev-python/glance_store-0.5.0[${PYTHON_USEDEP}]
-	>=dev-python/semantic_version-2.3.1[${PYTHON_USEDEP}]
-"
-
-PATCHES=(
-	"${FILESDIR}/cve-2015-5163-stable-kilo.patch"
-	"${FILESDIR}/cve-2015-5251-stable-kilo.patch"
-)
-
-pkg_setup() {
-	enewgroup glance
-	enewuser glance -1 -1 /var/lib/glance glance
-}
-
-python_prepare_all() {
-	sed -i '/xattr/d' test-requirements.txt || die
-	sed -i '/pysendfile/d' test-requirements.txt || die
-	distutils-r1_python_prepare_all
-}
-
-python_compile_all() {
-	use doc && "${PYTHON}" setup.py build_sphinx
-}
-
-python_test() {
-	# https://bugs.launchpad.net/glance/+bug/1251105
-	# https://bugs.launchpad.net/glance/+bug/1242501
-	testr init
-	testr run --parallel || die "failed testsuite under python2.7"
-}
-
-python_install() {
-	distutils-r1_python_install
-
-	for svc in api registry scrubber; do
-		newinitd "${FILESDIR}/glance.initd" glance-${svc}
-	done
-
-	diropts -m 0750 -o glance -g glance
-	dodir /var/log/glance /var/lib/glance/images /var/lib/glance/scrubber
-	keepdir /etc/glance
-	keepdir /var/log/glance
-	keepdir /var/lib/glance/images
-	keepdir /var/lib/glance/scrubber
-
-	insinto /etc/glance
-	insopts -m 0640 -o glance -g glance
-	doins etc/*.ini
-	doins etc/*.conf
-	doins etc/*.sample
-}
-
-python_install_all() {
-	use doc && local HTML_DOCS=( doc/build/html/. )
-	distutils-r1_python_install_all
-}
diff --git a/app-admin/glance/glance-2015.1.1-r3.ebuild b/app-admin/glance/glance-2015.1.1-r3.ebuild
new file mode 100644
index 0000000..88ae901
--- /dev/null
+++ b/app-admin/glance/glance-2015.1.1-r3.ebuild
@@ -0,0 +1,191 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1 user
+
+DESCRIPTION="Provides services for discovering, registering, and retrieving
+virtual machine images"
+HOMEPAGE="https://launchpad.net/glance"
+SRC_URI="https://launchpad.net/${PN}/kilo/${PV}/+download/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc mysql postgres +sqlite +swift test"
+REQUIRED_USE="|| ( mysql postgres sqlite )"
+
+DEPEND="
+		dev-python/setuptools[${PYTHON_USEDEP}]
+		>=dev-python/pbr-0.8.0[${PYTHON_USEDEP}]
+		<dev-python/pbr-1.0[${PYTHON_USEDEP}]
+		test? (
+			${RDEPEND}
+			>=dev-python/hacking-0.10.0[${PYTHON_USEDEP}]
+			<dev-python/hacking-0.11[${PYTHON_USEDEP}]
+			>=dev-python/Babel-1.3[${PYTHON_USEDEP}]
+			>=dev-python/coverage-3.6[${PYTHON_USEDEP}]
+			>=dev-python/fixtures-0.3.14[${PYTHON_USEDEP}]
+			<dev-python/fixtures-1.3.0[${PYTHON_USEDEP}]
+			>=dev-python/mock-1.0[${PYTHON_USEDEP}]
+			<dev-python/mock-1.1.0[${PYTHON_USEDEP}]
+			>=dev-python/sphinx-1.1.2[${PYTHON_USEDEP}]
+			!~dev-python/sphinx-1.2.0[${PYTHON_USEDEP}]
+			<dev-python/sphinx-1.3[${PYTHON_USEDEP}]
+			>=dev-python/requests-2.2.0[${PYTHON_USEDEP}]
+			!~dev-python/requests-2.4.0[${PYTHON_USEDEP}]
+			>=dev-python/testrepository-0.0.18[${PYTHON_USEDEP}]
+			>=dev-python/testtools-0.9.36[${PYTHON_USEDEP}]
+			!~dev-python/testtools-1.2.0[${PYTHON_USEDEP}]
+			>=dev-python/psutil-1.1.1[${PYTHON_USEDEP}]
+			<dev-python/psutil-2.0.0[${PYTHON_USEDEP}]
+			>=dev-python/oslotest-1.5.1[${PYTHON_USEDEP}]
+			<dev-python/oslotest-1.6.0[${PYTHON_USEDEP}]
+			dev-python/mysql-python[${PYTHON_USEDEP}]
+			dev-python/psycopg[${PYTHON_USEDEP}]
+			~dev-python/pysendfile-2.0.1[${PYTHON_USEDEP}]
+			dev-python/qpid-python[${PYTHON_USEDEP}]
+			>=dev-python/pyxattr-0.5.0[${PYTHON_USEDEP}]
+			>=dev-python/oslo-sphinx-2.5.0[${PYTHON_USEDEP}]
+			<dev-python/oslo-sphinx-2.6.0[${PYTHON_USEDEP}]
+			>=dev-python/elasticsearch-py-1.3.0[${PYTHON_USEDEP}]
+		)"
+
+#note to self, wsgiref is a python builtin, no need to package it
+#>=dev-python/wsgiref-0.1.2[${PYTHON_USEDEP}]
+
+RDEPEND="
+	>=dev-python/greenlet-0.3.2[${PYTHON_USEDEP}]
+	sqlite? (
+		>=dev-python/sqlalchemy-0.9.7[sqlite,${PYTHON_USEDEP}]
+		<=dev-python/sqlalchemy-0.9.99[sqlite,${PYTHON_USEDEP}]
+	)
+	mysql? (
+		dev-python/mysql-python
+		>=dev-python/sqlalchemy-0.9.7[${PYTHON_USEDEP}]
+		<=dev-python/sqlalchemy-0.9.99[${PYTHON_USEDEP}]
+	)
+	postgres? (
+		dev-python/psycopg:2
+		>=dev-python/sqlalchemy-0.9.7[${PYTHON_USEDEP}]
+		<=dev-python/sqlalchemy-0.9.99[${PYTHON_USEDEP}]
+	)
+	>=dev-python/anyjson-0.3.3[${PYTHON_USEDEP}]
+	>=dev-python/eventlet-0.16.1[${PYTHON_USEDEP}]
+	!~dev-python/eventlet-0.17.0[${PYTHON_USEDEP}]
+	>=dev-python/pastedeploy-1.5.0[${PYTHON_USEDEP}]
+	>=dev-python/routes-1.12.3[${PYTHON_USEDEP}]
+	!~dev-python/routes-2.0[${PYTHON_USEDEP}]
+	>=dev-python/webob-1.2.3[${PYTHON_USEDEP}]
+	>=dev-python/sqlalchemy-migrate-0.9.5[${PYTHON_USEDEP}]
+	>=dev-python/httplib2-0.7.5[${PYTHON_USEDEP}]
+	>=dev-python/kombu-2.5.0[${PYTHON_USEDEP}]
+	>=dev-python/pycrypto-2.6[${PYTHON_USEDEP}]
+	>=dev-python/iso8601-0.1.9[${PYTHON_USEDEP}]
+	dev-python/ordereddict[${PYTHON_USEDEP}]
+	>=dev-python/oslo-config-1.9.3[${PYTHON_USEDEP}]
+	<dev-python/oslo-config-1.10.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-concurrency-1.8.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-concurrency-1.9.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-context-0.2.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-context-0.3.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-utils-1.4.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-utils-1.5.0[${PYTHON_USEDEP}]
+	>=dev-python/stevedore-1.3.0[${PYTHON_USEDEP}]
+	<dev-python/stevedore-1.4.0[${PYTHON_USEDEP}]
+	>=dev-python/taskflow-0.7.1[${PYTHON_USEDEP}]
+	<dev-python/taskflow-0.8.0[${PYTHON_USEDEP}]
+	>=dev-python/keystonemiddleware-1.5.0[${PYTHON_USEDEP}]
+	<dev-python/keystonemiddleware-1.6.0[${PYTHON_USEDEP}]
+	>=dev-python/WSME-0.6[${PYTHON_USEDEP}]
+	<dev-python/WSME-0.7[${PYTHON_USEDEP}]
+	dev-python/posix_ipc[${PYTHON_USEDEP}]
+	swift? (
+		>=dev-python/python-swiftclient-2.2.0[${PYTHON_USEDEP}]
+		<dev-python/python-swiftclient-2.5.0[${PYTHON_USEDEP}]
+	)
+	>=dev-python/oslo-vmware-0.11.1[${PYTHON_USEDEP}]
+	<dev-python/oslo-vmware-0.12.0[${PYTHON_USEDEP}]
+	dev-python/paste[${PYTHON_USEDEP}]
+	>=dev-python/jsonschema-2.0.0[${PYTHON_USEDEP}]
+	<dev-python/jsonschema-3.0.0[${PYTHON_USEDEP}]
+	>=dev-python/python-keystoneclient-1.2.0[${PYTHON_USEDEP}]
+	<dev-python/python-keystoneclient-1.4.0[${PYTHON_USEDEP}]
+	>=dev-python/pyopenssl-0.11[${PYTHON_USEDEP}]
+	>=dev-python/six-1.9.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-db-1.7.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-db-1.8.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-i18n-1.5.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-i18n-1.6.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-log-1.0.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-log-1.1.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-messaging-1.8.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-messaging-1.9.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-policy-0.3.1[${PYTHON_USEDEP}]
+	<dev-python/oslo-policy-0.4.0[${PYTHON_USEDEP}]
+	>=dev-python/oslo-serialization-1.4.0[${PYTHON_USEDEP}]
+	<dev-python/oslo-serialization-1.5.0[${PYTHON_USEDEP}]
+	>=dev-python/retrying-1.2.3[${PYTHON_USEDEP}]
+	!~dev-python/retrying-1.3.0[${PYTHON_USEDEP}]
+	>=dev-python/osprofiler-0.3.0[${PYTHON_USEDEP}]
+	>=dev-python/glance_store-0.3.0[${PYTHON_USEDEP}]
+	<dev-python/glance_store-0.5.0[${PYTHON_USEDEP}]
+	>=dev-python/semantic_version-2.3.1[${PYTHON_USEDEP}]
+"
+
+PATCHES=(
+	"${FILESDIR}/cve-2015-5163-stable-kilo.patch"
+	"${FILESDIR}/cve-2015-5251-stable-kilo.patch"
+	"${FILESDIR}/CVE-2015-5286_2015.1.1.patch"
+)
+
+pkg_setup() {
+	enewgroup glance
+	enewuser glance -1 -1 /var/lib/glance glance
+}
+
+python_prepare_all() {
+	sed -i '/xattr/d' test-requirements.txt || die
+	sed -i '/pysendfile/d' test-requirements.txt || die
+	distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+	use doc && "${PYTHON}" setup.py build_sphinx
+}
+
+python_test() {
+	# https://bugs.launchpad.net/glance/+bug/1251105
+	# https://bugs.launchpad.net/glance/+bug/1242501
+	testr init
+	testr run --parallel || die "failed testsuite under python2.7"
+}
+
+python_install() {
+	distutils-r1_python_install
+
+	for svc in api registry scrubber; do
+		newinitd "${FILESDIR}/glance.initd" glance-${svc}
+	done
+
+	diropts -m 0750 -o glance -g glance
+	dodir /var/log/glance /var/lib/glance/images /var/lib/glance/scrubber
+	keepdir /etc/glance
+	keepdir /var/log/glance
+	keepdir /var/lib/glance/images
+	keepdir /var/lib/glance/scrubber
+
+	insinto /etc/glance
+	insopts -m 0640 -o glance -g glance
+	doins etc/*.ini
+	doins etc/*.conf
+	doins etc/*.sample
+}
+
+python_install_all() {
+	use doc && local HTML_DOCS=( doc/build/html/. )
+	distutils-r1_python_install_all
+}
diff --git a/app-admin/keepass/files/keepass-2.30-mono-4-support.patch b/app-admin/keepass/files/keepass-2.30-mono-4-support.patch
new file mode 100644
index 0000000..5794ba0
--- /dev/null
+++ b/app-admin/keepass/files/keepass-2.30-mono-4-support.patch
@@ -0,0 +1,92 @@
+File keepass-2.30-original/.ipc_in is a fifo while file keepass-2.30/.ipc_in is a fifo
+File keepass-2.30-original/.ipc_out is a fifo while file keepass-2.30/.ipc_out is a fifo
+diff -ur keepass-2.30-original/work/Ext/KeePassMsi/KeePassMsi.sln keepass-2.30/work/Ext/KeePassMsi/KeePassMsi.sln
+--- keepass-2.30-original/work/Ext/KeePassMsi/KeePassMsi.sln	2008-09-11 18:19:14.000000000 +0200
++++ keepass-2.30/work/Ext/KeePassMsi/KeePassMsi.sln	2015-09-28 17:21:23.640007000 +0200
+@@ -1,5 +1,5 @@
+ 

+-Microsoft Visual Studio Solution File, Format Version 10.00

++Microsoft Visual Studio Solution File, Format Version 11.00

+ # Visual Studio 2008

+ Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "KeePassMsi", "KeePassMsi.vdproj", "{C4135368-4A84-4924-B5CE-82B18FAADFD4}"

+ EndProject

+diff -ur keepass-2.30-original/work/KeePass/KeePass.csproj keepass-2.30/work/KeePass/KeePass.csproj
+--- keepass-2.30-original/work/KeePass/KeePass.csproj	2015-09-28 17:20:19.828006799 +0200
++++ keepass-2.30/work/KeePass/KeePass.csproj	2015-09-28 17:21:26.160007008 +0200
+@@ -1,5 +1,5 @@
+-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

+-  <PropertyGroup>

++<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

++  <PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

+     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

+     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

+     <ProductVersion>9.0.30729</ProductVersion>

+@@ -1315,6 +1315,6 @@
+   <Target Name="AfterBuild">

+   </Target>

+   -->

+-  <PropertyGroup>

++  <PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

+   </PropertyGroup>

+ </Project>
+diff -ur keepass-2.30-original/work/KeePassLib/KeePassLib.csproj keepass-2.30/work/KeePassLib/KeePassLib.csproj
+--- keepass-2.30-original/work/KeePassLib/KeePassLib.csproj	2015-09-28 17:20:19.836006799 +0200
++++ keepass-2.30/work/KeePassLib/KeePassLib.csproj	2015-09-28 17:21:26.148007008 +0200
+@@ -1,5 +1,5 @@
+-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

+-  <PropertyGroup>

++<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

++  <PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

+     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

+     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

+     <ProductVersion>9.0.30729</ProductVersion>

+diff -ur keepass-2.30-original/work/KeePassLibSD/KeePassLibSD.csproj keepass-2.30/work/KeePassLibSD/KeePassLibSD.csproj
+--- keepass-2.30-original/work/KeePassLibSD/KeePassLibSD.csproj	2014-05-08 15:00:06.000000000 +0200
++++ keepass-2.30/work/KeePassLibSD/KeePassLibSD.csproj	2015-09-28 17:21:26.148007008 +0200
+@@ -1,5 +1,5 @@
+-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

+-  <PropertyGroup>

++<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

++  <PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

+     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

+     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

+     <ProductVersion>9.0.30729</ProductVersion>

+@@ -14,7 +14,7 @@
+     <PlatformID>3C41C503-53EF-4c2a-8DD4-A8217CAD115E</PlatformID>

+     <OSVersion>4.20</OSVersion>

+     <DeployDirSuffix>KeePassLibSD</DeployDirSuffix>

+-    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>

++    

+     <FormFactorID>

+     </FormFactorID>

+     <SignAssembly>true</SignAssembly>

+diff -ur keepass-2.30-original/work/KeePass.sln keepass-2.30/work/KeePass.sln
+--- keepass-2.30-original/work/KeePass.sln	2015-09-28 17:20:19.848006799 +0200
++++ keepass-2.30/work/KeePass.sln	2015-09-28 17:21:23.632007000 +0200
+@@ -1,4 +1,4 @@
+-Microsoft Visual Studio Solution File, Format Version 10.00

++Microsoft Visual Studio Solution File, Format Version 11.00

+ # Visual Studio 2008

+ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeePassLib", "KeePassLib\KeePassLib.csproj", "{53573E4E-33CB-4FDB-8698-C95F5E40E7F3}"

+ EndProject

+diff -ur keepass-2.30-original/work/ShInstUtil/ShInstUtil.sln keepass-2.30/work/ShInstUtil/ShInstUtil.sln
+--- keepass-2.30-original/work/ShInstUtil/ShInstUtil.sln	2011-09-10 13:21:28.000000000 +0200
++++ keepass-2.30/work/ShInstUtil/ShInstUtil.sln	2015-09-28 17:21:23.636007000 +0200
+@@ -1,5 +1,5 @@
+ 

+-Microsoft Visual Studio Solution File, Format Version 10.00

++Microsoft Visual Studio Solution File, Format Version 11.00

+ # Visual Studio 2008

+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShInstUtil", "ShInstUtil.vcproj", "{C9FBA6FD-04AC-4B2F-8277-B852B8013DAE}"

+ EndProject

+diff -ur keepass-2.30-original/work/Translation/TrlUtil/TrlUtil.csproj keepass-2.30/work/Translation/TrlUtil/TrlUtil.csproj
+--- keepass-2.30-original/work/Translation/TrlUtil/TrlUtil.csproj	2013-07-21 10:06:38.000000000 +0200
++++ keepass-2.30/work/Translation/TrlUtil/TrlUtil.csproj	2015-09-28 17:21:26.140007008 +0200
+@@ -1,5 +1,5 @@
+-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

+-  <PropertyGroup>

++<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">

++  <PropertyGroup><TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

+     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

+     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>

+     <ProductVersion>9.0.30729</ProductVersion>

diff --git a/app-admin/keepass/keepass-2.30.ebuild b/app-admin/keepass/keepass-2.30.ebuild
index 55cdd13..d98b4e7 100644
--- a/app-admin/keepass/keepass-2.30.ebuild
+++ b/app-admin/keepass/keepass-2.30.ebuild
@@ -33,6 +33,9 @@
 	# KeePass looks for some XSL files in the same folder as the executable,
 	# we prefer to have it in /usr/share/KeePass
 	epatch "${FILESDIR}/${PN}-2.20-xsl-path-detection.patch"
+	# bug # 558094
+	has_version ">=dev-lang/mono-4" && epatch \
+		"${FILESDIR}/${P}-mono-4-support.patch"
 }
 
 src_compile() {
diff --git a/app-admin/logrotate/Manifest b/app-admin/logrotate/Manifest
index d427552..25d4efc 100644
--- a/app-admin/logrotate/Manifest
+++ b/app-admin/logrotate/Manifest
@@ -1,3 +1,2 @@
-DIST logrotate-3.8.8.tar.gz 72014 SHA256 46a1510ef4a1f4359edd5f361112cfd1523942e85ff28e6cbb0c81bad1829d0f SHA512 2b7b5fe587b3a5cbe98b8035a541b5e272e6e4c40669f65ff6c43d1524b686eca9abc0b93bc00c8eb6da4d189f14a9b79905fcc0fadb914276d884ad7493bb4b WHIRLPOOL b145d51cdcf0214e4f4b6a97aed7b9e1375c2848efecbc16181eaa6e1105ac8892c57248c89b92eb080d6cd6b23958085f39a894df7f5dce0bea6516e2d583c4
 DIST logrotate-3.8.9.tar.gz 77408 SHA256 700ed7ce9072a1cca324779a74797dfaefdae37ac50a817134b947c4ded1dfa7 SHA512 342533f321a1d77c0ca389fd0a393377ba73f10654aae163cbd35f8d5df25673f1aa6e44d0af42be5419d152a7dae11024d9005076bce0a3b3dad1f0e12b9c0d WHIRLPOOL 005621b5dc7f6954e505876eece76e3adf03b9b89b724e5c28b845c8af3ebb8e978d20e3a82c8a503c32bfd8758517625207e23518d6d08068e237c22fe7212d
 DIST logrotate-3.9.1.tar.gz 79061 SHA256 022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545 SHA512 e6da7c7f067befaf2441e9c6ce77e53cf5ddb4f56cc3304c3e50873b6f20c68520f4a0e50ec466cbebcbed20bfd77bf6dfc489975a8131e9573fb19856c0fe28 WHIRLPOOL 9b3558bb03c6c95f8f386ea75ca09bfda802ae4c45b9ef8408692e3aa7a2ee57447cf15ce04d0289946b9cae2266acb5509d8151d15ac6ea0ad9113aeb32dc17
diff --git a/app-admin/logrotate/files/logrotate-3.8.8-Werror.patch b/app-admin/logrotate/files/logrotate-3.8.8-Werror.patch
deleted file mode 100644
index db96529..0000000
--- a/app-admin/logrotate/files/logrotate-3.8.8-Werror.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,7 +1,7 @@
- MAN = logrotate.8
- MAN5 = logrotate.conf.5
- 
--AM_CFLAGS = -Wall -Werror
-+AM_CFLAGS = -Wall
- sbin_PROGRAMS = logrotate
- logrotate_SOURCES = logrotate.c log.c config.c basenames.c
- 
diff --git a/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch b/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch
deleted file mode 100644
index 2816125..0000000
--- a/app-admin/logrotate/files/logrotate-3.8.8-atomic-create.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff -Nuar a/logrotate.c b/logrotate.c
---- a/logrotate.c	2014-10-16 13:12:35.000000000 +0200
-+++ b/logrotate.c	2014-11-04 20:26:46.080067315 +0100
-@@ -359,15 +359,20 @@
- int createOutputFile(char *fileName, int flags, struct stat *sb, acl_type acl, int force_mode)
- {
-     int fd;
--	struct stat sb_create;
--	int acl_set = 0;
--
--	fd = open(fileName, (flags | O_EXCL | O_NOFOLLOW),
--		(S_IRUSR | S_IWUSR) & sb->st_mode);
-+    int acl_set = 0;
-+    struct stat sb_create;
-+    char template[PATH_MAX + 1];
-+    char *fname;
-+    mode_t umask_value;
-+    snprintf(template, PATH_MAX, "%s/logrotate_temp.XXXXXX", ourDirName(fileName));
-+    umask_value = umask(0000);
-+    fname = mktemp(template);
-+    fd = open(fname, (flags | O_EXCL | O_NOFOLLOW), (S_IRUSR | S_IWUSR) & sb->st_mode);
-+    umask(umask_value);
- 
-     if (fd < 0) {
--	message(MESS_ERROR, "error creating output file %s: %s\n",
--		fileName, strerror(errno));
-+        message(MESS_ERROR, "error creating unique temp file: %s\n",
-+               strerror(errno));
- 	return -1;
-     }
-     if (fchmod(fd, (S_IRUSR | S_IWUSR) & sb->st_mode)) {
-@@ -418,6 +423,13 @@
- 		}
- 	}
- 
-+    if (rename(template, fileName)) {
-+        message(MESS_ERROR, "error renaming temp file to %s: %s\n",
-+        fileName, strerror(errno));
-+        close(fd);
-+        return -1;
-+    }
-+
-     return fd;
- }
- 
diff --git a/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch b/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch
deleted file mode 100644
index ff10211..0000000
--- a/app-admin/logrotate/files/logrotate-3.8.8-fbsd.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-diff -Nuar a/config.c b/config.c
---- a/config.c	2014-10-16 13:12:35.000000000 +0200
-+++ b/config.c	2014-11-04 19:22:31.750055957 +0100
-@@ -1,6 +1,6 @@
- #include <sys/queue.h>
- /* Alloca is defined in stdlib.h in NetBSD */
--#ifndef __NetBSD__
-+#if !defined(__NetBSD__) && !defined(__FreeBSD__)
- #include <alloca.h>
- #endif
- #include <limits.h>
-@@ -24,6 +24,10 @@
- #include <fnmatch.h>
- #include <sys/mman.h>
- 
-+#if !defined(PATH_MAX) && defined(__FreeBSD__)
-+#include <sys/param.h>
-+#endif
-+
- #include "basenames.h"
- #include "log.h"
- #include "logrotate.h"
-diff -Nuar a/logrotate.c b/logrotate.c
---- a/logrotate.c	2014-10-16 13:12:35.000000000 +0200
-+++ b/logrotate.c	2014-11-04 19:25:35.440056498 +0100
-@@ -1,6 +1,6 @@
- #include <sys/queue.h>
- /* alloca() is defined in stdlib.h in NetBSD */
--#ifndef __NetBSD__
-+#if !defined(__NetBSD__) && !defined(__FreeBSD__)
- #include <alloca.h>
- #endif
- #include <limits.h>
-@@ -25,6 +25,10 @@
- #include <limits.h>
- #endif
- 
-+#if !defined(PATH_MAX) && defined(__FreeBSD__)
-+#include <sys/param.h>
-+#endif
-+
- #include "basenames.h"
- #include "log.h"
- #include "logrotate.h"
-diff -Nuar a/Makefile b/Makefile
---- a/Makefile	2014-10-16 13:12:35.000000000 +0200
-+++ b/Makefile	2014-11-04 19:26:07.850056594 +0100
-@@ -22,7 +22,9 @@
- 
- ifeq ($(WITH_ACL),yes)
- CFLAGS += -DWITH_ACL
-+ifneq ($(OS_NAME),FreeBSD)
- LOADLIBES += -lacl
-+endif
- # See pretest
- TEST_ACL=1
- else
diff --git a/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch b/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch
deleted file mode 100644
index bdd0fbd..0000000
--- a/app-admin/logrotate/files/logrotate-3.8.8-ignore-hidden.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -Nuar a/config.c b/config.c
---- a/config.c	2014-10-16 13:12:35.000000000 +0200
-+++ b/config.c	2014-11-04 19:19:55.200055496 +0100
-@@ -255,7 +255,9 @@
- 	char *pattern;
- 
- 	/* Check if fname is '.' or '..'; if so, return false */
--	if (fname[0] == '.' && (!fname[1] || (fname[1] == '.' && !fname[2])))
-+	/* Don't include 'hidden' files either; this breaks Gentoo 
-+	   portage config file management http://bugs.gentoo.org/87683 */
-+	if (fname[0] == '.')
- 		return 0;
- 
- 	/* Check if fname is ending in a taboo-extension; if so, return false */
diff --git a/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch b/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch
deleted file mode 100644
index 31ad707..0000000
--- a/app-admin/logrotate/files/logrotate-3.8.8-noasprintf.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -Nuar a/config.c b/config.c
---- a/config.c	2014-10-16 13:12:35.000000000 +0200
-+++ b/config.c	2014-11-04 19:28:58.110057096 +0100
-@@ -45,39 +45,6 @@
- #include "asprintf.c"
- #endif
- 
--#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
--#include <stdarg.h>
--
--int asprintf(char **string_ptr, const char *format, ...)
--{
--	va_list arg;
--	char *str;
--	int size;
--	int rv;
--
--	va_start(arg, format);
--	size = vsnprintf(NULL, 0, format, arg);
--	size++;
--	va_start(arg, format);
--	str = malloc(size);
--	if (str == NULL) {
--		va_end(arg);
--		/*
--		 * Strictly speaking, GNU asprintf doesn't do this,
--		 * but the caller isn't checking the return value.
--		 */
--		fprintf(stderr, "failed to allocate memory\\n");
--		exit(1);
--	}
--	rv = vsnprintf(str, size, format, arg);
--	va_end(arg);
--
--	*string_ptr = str;
--	return (rv);
--}
--
--#endif
--
- #if !defined(strndup)
- char *strndup(const char *s, size_t n)
- {
-diff -Nuar a/logrotate.h b/logrotate.h
---- a/logrotate.h	2014-10-16 13:12:35.000000000 +0200
-+++ b/logrotate.h	2014-11-04 19:29:15.610057147 +0100
-@@ -75,8 +75,5 @@
- extern int debug;
- 
- int readAllConfigPaths(const char **paths);
--#if !defined(asprintf) && !defined(_FORTIFY_SOURCE)
--int asprintf(char **string_ptr, const char *format, ...);
--#endif
- 
- #endif
diff --git a/app-admin/logrotate/logrotate-3.8.8.ebuild b/app-admin/logrotate/logrotate-3.8.8.ebuild
deleted file mode 100644
index 1085ce9..0000000
--- a/app-admin/logrotate/logrotate-3.8.8.ebuild
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit autotools eutils toolchain-funcs flag-o-matic
-
-DESCRIPTION="Rotates, compresses, and mails system logs"
-HOMEPAGE="https://fedorahosted.org/logrotate/"
-SRC_URI="https://fedorahosted.org/releases/l/o/logrotate/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ~ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
-IUSE="acl selinux"
-
-CDEPEND="
-	>=dev-libs/popt-1.5
-	selinux? (
-		sys-libs/libselinux
-	)
-	acl? ( virtual/acl )"
-
-DEPEND="${CDEPEND}
-	>=sys-apps/sed-4
-"
-RDEPEND="${CDEPEND}
-	selinux? ( sec-policy/selinux-logrotate )
-"
-
-src_prepare() {
-	epatch \
-		"${FILESDIR}"/${P}-ignore-hidden.patch \
-		"${FILESDIR}"/${P}-fbsd.patch \
-		"${FILESDIR}"/${P}-noasprintf.patch \
-		"${FILESDIR}"/${P}-atomic-create.patch \
-		"${FILESDIR}"/${P}-Werror.patch
-	eautoreconf
-}
-
-src_compile() {
-	local myconf
-	myconf="CC=$(tc-getCC)"
-	use selinux && myconf="${myconf} WITH_SELINUX=yes"
-	use acl && myconf="${myconf} WITH_ACL=yes"
-	emake ${myconf} RPM_OPT_FLAGS="${CFLAGS}"
-}
-
-src_install() {
-	insinto /usr
-	dosbin logrotate
-	doman logrotate.8
-	dodoc CHANGES examples/logrotate*
-
-	exeinto /etc/cron.daily
-	newexe "${S}"/examples/logrotate.cron "${PN}"
-
-	insinto /etc
-	doins "${FILESDIR}"/logrotate.conf
-
-	keepdir /etc/logrotate.d
-}
-
-pkg_postinst() {
-	if [[ -z ${REPLACING_VERSIONS} ]] ; then
-		elog "If you wish to have logrotate e-mail you updates, please"
-		elog "emerge virtual/mailx and configure logrotate in"
-		elog "/etc/logrotate.conf appropriately"
-		elog
-		elog "Additionally, /etc/logrotate.conf may need to be modified"
-		elog "for your particular needs.  See man logrotate for details."
-	fi
-}
diff --git a/app-admin/paxtest/Manifest b/app-admin/paxtest/Manifest
index 7db4620..1f0c111 100644
--- a/app-admin/paxtest/Manifest
+++ b/app-admin/paxtest/Manifest
@@ -1 +1 @@
-DIST paxtest-0.9.13.tar.gz 34451 SHA256 b1f9122e45927a05ea65ec9c3b8dad92377245e546c0eff08b0f8ad9ba6e4c75 SHA512 dc375f7b0c9dd3efcf22adae6cbf0724ae505c6b3a1c55de223665c454650f86014098a45226b3fc8e4b89d528152aaf458aa3b7d1c9ffc86b3be52f2af69d60 WHIRLPOOL 6d5066f759d01e7efd6b4e872bb9d9e1a7341f82f379e77dc8ae77139fa533abe004bdda9f8a35d90a1d2f4c8917d8ba4b1c56e65401522ccc1e99f99a158070
+DIST paxtest-0.9.14.tar.gz 34286 SHA256 7dead81fcdc8db2f88e3da1027e6d7c93596f2e6e4dac25ec9b54c41fa808048 SHA512 6e2d642e1dfe7e3381ed520956d2f5b19ad8c8e569c4ddcf43a2772a76ed67701bb18fe55d7fe2b82ff50644f92470622243ac974083d87448f560f6d48d8727 WHIRLPOOL bef2998611b0487590364648b8f5d4ddc470b212c2a8b0282f4220b1da8033f23299298b51dc932c35f37099f7076a99220726b30d91472ca266042f16c4ed02
diff --git a/app-admin/paxtest/paxtest-0.9.13.ebuild b/app-admin/paxtest/paxtest-0.9.13.ebuild
deleted file mode 100644
index 117f41f..0000000
--- a/app-admin/paxtest/paxtest-0.9.13.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="2"
-
-inherit eutils multilib toolchain-funcs
-
-DESCRIPTION="PaX regression test suite"
-HOMEPAGE="http://pax.grsecurity.net"
-SRC_URI="http://grsecurity.net/~spender/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
-IUSE=""
-
-RDEPEND=""
-DEPEND="${RDEPEND}
-	sys-apps/paxctl"
-
-# EI_PAX flags are not strip safe.
-RESTRICT="strip"
-
-QA_EXECSTACK="usr/bin/${PN}
-	usr/$(get_libdir)/${PN}/getamap
-	usr/$(get_libdir)/${PN}/shlibtest2.so
-	usr/$(get_libdir)/${PN}/execheap
-	usr/$(get_libdir)/${PN}/mprotstack
-	usr/$(get_libdir)/${PN}/mprotdata
-	usr/$(get_libdir)/${PN}/mprotheap
-	usr/$(get_libdir)/${PN}/randshlib
-	usr/$(get_libdir)/${PN}/randmain1
-	usr/$(get_libdir)/${PN}/getshlib
-	usr/$(get_libdir)/${PN}/randheap2
-	usr/$(get_libdir)/${PN}/rettofunc2x
-	usr/$(get_libdir)/${PN}/shlibdata
-	usr/$(get_libdir)/${PN}/shlibbss
-	usr/$(get_libdir)/${PN}/getmain1
-	usr/$(get_libdir)/${PN}/execdata
-	usr/$(get_libdir)/${PN}/execstack
-	usr/$(get_libdir)/${PN}/rettofunc2
-	usr/$(get_libdir)/${PN}/mprotshdata
-	usr/$(get_libdir)/${PN}/getstack1
-	usr/$(get_libdir)/${PN}/randamap
-	usr/$(get_libdir)/${PN}/rettofunc1x
-	usr/$(get_libdir)/${PN}/getheap2
-	usr/$(get_libdir)/${PN}/getheap1
-	usr/$(get_libdir)/${PN}/randheap1
-	usr/$(get_libdir)/${PN}/getstack2
-	usr/$(get_libdir)/${PN}/getmain2
-	usr/$(get_libdir)/${PN}/rettofunc1
-	usr/$(get_libdir)/${PN}/randstack2
-	usr/$(get_libdir)/${PN}/mprotshbss
-	usr/$(get_libdir)/${PN}/randstack1
-	usr/$(get_libdir)/${PN}/mprotanon
-	usr/$(get_libdir)/${PN}/randmain2
-	usr/$(get_libdir)/${PN}/writetext
-	usr/$(get_libdir)/${PN}/mprotbss
-	usr/$(get_libdir)/${PN}/anonmap
-	usr/$(get_libdir)/${PN}/execbss
-	usr/$(get_libdir)/${PN}/shlibtest.so"
-
-src_prepare() {
-	mv Makefile.psm Makefile
-	epatch "${FILESDIR}/${P}-Makefile.patch"
-	sed -i "s/^CC := gcc/CC := $(tc-getCC)/" Makefile
-	sed -i "s/^LD := ld/LD := $(tc-getLD)/" Makefile
-}
-
-src_compile() {
-	emake RUNDIR=/usr/$(get_libdir)/paxtest || die
-}
-
-src_install() {
-	emake DESTDIR="${D}" BINDIR=/usr/bin RUNDIR=/usr/$(get_libdir)/paxtest install || die
-
-	newman debian/manpage.1.ex paxtest.1 || die
-	dodoc ChangeLog README || die
-}
diff --git a/app-admin/paxtest/paxtest-0.9.14.ebuild b/app-admin/paxtest/paxtest-0.9.14.ebuild
new file mode 100644
index 0000000..10fbe28
--- /dev/null
+++ b/app-admin/paxtest/paxtest-0.9.14.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils multilib toolchain-funcs
+
+DESCRIPTION="PaX regression test suite"
+HOMEPAGE="http://pax.grsecurity.net"
+SRC_URI="http://grsecurity.net/~spender/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+	sys-apps/paxctl"
+
+# EI_PAX flags are not strip safe.
+RESTRICT="strip"
+
+QA_EXECSTACK="usr/bin/${PN}
+	usr/$(get_libdir)/${PN}/getamap
+	usr/$(get_libdir)/${PN}/shlibtest2.so
+	usr/$(get_libdir)/${PN}/execheap
+	usr/$(get_libdir)/${PN}/mprotstack
+	usr/$(get_libdir)/${PN}/mprotdata
+	usr/$(get_libdir)/${PN}/mprotheap
+	usr/$(get_libdir)/${PN}/randshlib
+	usr/$(get_libdir)/${PN}/randmain1
+	usr/$(get_libdir)/${PN}/getshlib
+	usr/$(get_libdir)/${PN}/randheap2
+	usr/$(get_libdir)/${PN}/rettofunc2x
+	usr/$(get_libdir)/${PN}/shlibdata
+	usr/$(get_libdir)/${PN}/shlibbss
+	usr/$(get_libdir)/${PN}/getmain1
+	usr/$(get_libdir)/${PN}/execdata
+	usr/$(get_libdir)/${PN}/execstack
+	usr/$(get_libdir)/${PN}/rettofunc2
+	usr/$(get_libdir)/${PN}/mprotshdata
+	usr/$(get_libdir)/${PN}/getstack1
+	usr/$(get_libdir)/${PN}/randamap
+	usr/$(get_libdir)/${PN}/rettofunc1x
+	usr/$(get_libdir)/${PN}/getheap2
+	usr/$(get_libdir)/${PN}/getheap1
+	usr/$(get_libdir)/${PN}/randheap1
+	usr/$(get_libdir)/${PN}/getstack2
+	usr/$(get_libdir)/${PN}/getmain2
+	usr/$(get_libdir)/${PN}/rettofunc1
+	usr/$(get_libdir)/${PN}/randstack2
+	usr/$(get_libdir)/${PN}/mprotshbss
+	usr/$(get_libdir)/${PN}/randstack1
+	usr/$(get_libdir)/${PN}/mprotanon
+	usr/$(get_libdir)/${PN}/randmain2
+	usr/$(get_libdir)/${PN}/writetext
+	usr/$(get_libdir)/${PN}/mprotbss
+	usr/$(get_libdir)/${PN}/anonmap
+	usr/$(get_libdir)/${PN}/execbss
+	usr/$(get_libdir)/${PN}/shlibtest.so"
+
+src_prepare() {
+	mv Makefile.psm Makefile
+	epatch "${FILESDIR}/${PN}-0.9.13-Makefile.patch"
+	sed -i "s/^CC := gcc/CC := $(tc-getCC)/" Makefile
+	sed -i "s/^LD := ld/LD := $(tc-getLD)/" Makefile
+}
+
+src_compile() {
+	emake RUNDIR=/usr/$(get_libdir)/paxtest || die
+}
+
+src_install() {
+	emake DESTDIR="${D}" BINDIR=/usr/bin RUNDIR=/usr/$(get_libdir)/paxtest install || die
+
+	newman debian/manpage.1.ex paxtest.1 || die
+	dodoc ChangeLog README || die
+}
diff --git a/app-admin/puppet-agent/Manifest b/app-admin/puppet-agent/Manifest
index 429ae4d..ebf38f7 100644
--- a/app-admin/puppet-agent/Manifest
+++ b/app-admin/puppet-agent/Manifest
@@ -2,3 +2,5 @@
 DIST puppet-agent_1.2.2-1wheezy_i386.deb 14816930 SHA256 092b8bfe1e1156322d0ab68d411487c80146bd778916409b1c907791f41a49c8 SHA512 50879ce4eebcd451dafb33cb7a12c36ee9bcaedfc29ffa0d60552efa5aa4cd66d0007061d28a80d31615c67442f8526863185e6753418772d8275e58454d6886 WHIRLPOOL 7abb0b6f52f5dd07a5ccb56b1c795c05f8c4efd18665d2ca209400e51419e4ae335e630a845c031a47df09d96ce20fbc92d7cafa082deb3872306daf74838612
 DIST puppet-agent_1.2.4-1wheezy_amd64.deb 15187770 SHA256 a711255c7b5aab5f1a653fcbe461db0934645b1da876f24595d531c7ad8c81d4 SHA512 dc7656a7f79f1f2e5144bf625b87548ed1b78290ae03c969abb850f0b1c346536c37c2b204ac0e6add830c1fd692ca4f946ea01bba50bb9794c094069f237d73 WHIRLPOOL 3809a0f9c5db1c73c6edcc344e6fdc7fb5acf340e36225611c72088175fe64ea26c3770ba126a61ed91fa275cf898828d9d192872a216a52b8345f25de1df7e6
 DIST puppet-agent_1.2.4-1wheezy_i386.deb 15122670 SHA256 33e9b16ea215089e7a89288faebd4767163e05d7c4a9d5c51ca71b041496c204 SHA512 944f6388d317fab9a2714a6cdc57e713a973d3c1df259b3358be3a0d737878df9f1d66186af8aea0cc768e55650f1dd1d3ef8682b942728fba45e7c0bca20867 WHIRLPOOL bd5710845a9c8f27fb566ead63e45649fb3854200df0259c76b9478d93792b453a9d5cf4fdc20112991d4d091c82143b7504b51be65815b2dcb67796f275303d
+DIST puppet-agent_1.2.5-1wheezy_amd64.deb 15187830 SHA256 4d557e45571df033a9e1babf406f9b8a4c387fe6dec7d3645f5e7ad5d7625f0d SHA512 25557aa4d5fa3d2ba0aa226c835d6779d075f0ef7c054cfda9826b1fedd08c90f5143630206b1bd51550f193aecdf4eef6395437f24e5fdfe10d3ed10fb4b75f WHIRLPOOL d6ef920932a708d1a143245f84380384b3a22320c0bb21e60be9807e29af1d3da6dbfef2f498fcb90fe4584618ae338546103c71eb305b743d326e9c20704f1f
+DIST puppet-agent_1.2.5-1wheezy_i386.deb 15122650 SHA256 f34a6e9c70b5276806dacf64fb2b41fd927e6875071d044f9901c5a8d9dacd1d SHA512 0989501ca3f011601bb301126ad58084571ee67eb961fbf1f5cf002eb9155bf4f8e838452ac62b45472f00c0a7538cb5c72c3e43c651675a7940d8ab9a1a309c WHIRLPOOL f9698e3154254d9931fdbccd9a75edccae8ab799f8add0e32995453d62a0d070001ad858449c5b816c1b1a448beb8b99b180558feea3b36fc84c0e730e2d5b7e
diff --git a/app-admin/puppet-agent/puppet-agent-1.2.5.ebuild b/app-admin/puppet-agent/puppet-agent-1.2.5.ebuild
new file mode 100644
index 0000000..d0c66a5
--- /dev/null
+++ b/app-admin/puppet-agent/puppet-agent-1.2.5.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils systemd unpacker
+
+DESCRIPTION="general puppet client utils along with mcollective hiera and facter"
+HOMEPAGE="https://puppetlabs.com/"
+SRC_BASE="http://apt.puppetlabs.com/pool/wheezy/PC1/${PN:0:1}/${PN}/${PN}_${PV}-1wheezy"
+SRC_URI="
+	amd64? ( ${SRC_BASE}_amd64.deb )
+	x86?   ( ${SRC_BASE}_i386.deb )
+"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="puppetdb selinux"
+RESTRICT="strip"
+
+CDEPEND="!app-admin/augeas
+	!app-admin/mcollective
+	!app-admin/puppet
+	!dev-ruby/hiera
+	!dev-ruby/facter
+	!app-emulation/virt-what"
+
+DEPEND="
+	${CDEPEND}"
+RDEPEND="${CDEPEND}
+	sys-apps/dmidecode
+	selinux? (
+		sys-libs/libselinux[ruby]
+		sec-policy/selinux-puppet
+	)
+	puppetdb? ( >=dev-ruby/puppetdb-termini-3.0.1-r2 )"
+
+S=${WORKDIR}
+
+src_install() {
+	# conf.d
+	doconfd etc/default/puppet
+	doconfd etc/default/mcollective
+	# logrotate.d
+	insinto /etc/logrotate.d
+	doins etc/logrotate.d/mcollective
+	# puppet itself
+	insinto /etc/puppetlabs
+	doins -r etc/puppetlabs/*
+	# logdir for systemd
+	dodir var/log/puppetlabs/puppet/
+	fperms 0750 var/log/puppetlabs/puppet/
+	# the rest
+	insinto /opt
+	dodir opt/puppetlabs/puppet/cache
+	doins -r opt/*
+	fperms 0750 /opt/puppetlabs/puppet/cache
+	# init
+	newinitd "${FILESDIR}/puppet.initd" puppet
+	newinitd "${FILESDIR}/mcollective.initd" mcollective
+	systemd_dounit "${FILESDIR}/puppet.service"
+	systemd_dounit "${FILESDIR}/mcollective.service"
+	systemd_newtmpfilesd "${FILESDIR}/puppet-agent.conf.tmpfilesd" puppet-agent.conf
+	# symlinks
+	chmod 0755 -R "${D}/opt/puppetlabs/puppet/bin/"
+	chmod 0755 "${D}//opt/puppetlabs/puppet/lib/virt-what/virt-what-cpuid-helper"
+	dosym /opt/puppetlabs/bin/facter /usr/bin/facter
+	dosym /opt/puppetlabs/bin/hiera /usr/bin/hiera
+	dosym /opt/puppetlabs/bin/mco /usr/bin/mco
+	dosym /opt/puppetlabs/bin/puppet /usr/bin/puppet
+	dosym /opt/puppetlabs/puppet/bin/mcollectived /usr/sbin/mcollectived
+	dosym /opt/puppetlabs/puppet/bin/virt-what /usr/bin/virt-what
+	dosym /opt/puppetlabs/puppet/bin/augparse /usr/bin/augparse
+	dosym /opt/puppetlabs/puppet/bin/augtool /usr/bin/augtool
+	dosym /opt/puppetlabs/puppet/bin/extlookup2hiera /usr/bin/extlookup2hiera
+}
diff --git a/app-admin/rsyslog/Manifest b/app-admin/rsyslog/Manifest
index d8ba9f1..fcdb484 100644
--- a/app-admin/rsyslog/Manifest
+++ b/app-admin/rsyslog/Manifest
@@ -1,6 +1,6 @@
 DIST rsyslog-8.12.0.tar.gz 2091620 SHA256 466bfeac8296e89de1eb9029880998ba7b5fc25694143197bb47167df6cb7e20 SHA512 7735f15f8a843ee41530d180d00ab3a6854ef28e9036db7ecfe0525549b3ab2b184149c2edc4553240dd4e3003ee12ebcdf47719669daa3cc6915d5a30888c72 WHIRLPOOL b96faab541fd8b53558738b7bd71d3b6acc7d66da4fb0552d781f0e214c00a11b4a74464f7b9c9a1d62bc359658f93d380a490ee78afc11d1702975a6edc6823
+DIST rsyslog-8.13.0.tar.gz 2077267 SHA256 b182bd0a7686bef093be570bfb850417191292522fb58e0ad32f2c824f754a33 SHA512 a3245e5b10ae96e6df981291f55a43fa9a8258db213e33a36d7b5a620ea7daaac04a1f93a56304105c4fd10e546f92789831f5b2188b418b4b3b248a4e7795c9 WHIRLPOOL 8473e2c272182d84c629175aafd185cfa6fcafad8a028fd212de118f2e9abf458e062c6065dc5ebb1df27e81546a37387944ad1b3f0d16a38ee25a409b51b1c7
 DIST rsyslog-8.7.0.tar.gz 2003365 SHA256 c77125b67a623569c9bdca8136b9aac013f1c6fd82fb8595e3ea267e61800f9c SHA512 53feac42c14134d76f5592ee491bb56fb2c4c33822a7a5609a5267b6911a5c5c4e73c5d66a913a666967d8826ee3077b91d8d2a1d1b60bcb3d425b35ec4677b0 WHIRLPOOL c74c401de68bb59310e307a0d9859d2f58bcbf8126d637d23d4f3979a0d6c69bce8ca850c2942b43f311ea83f47c9554f34e5dc10623d32324da1b18023d357d
-DIST rsyslog-8.9.0.tar.gz 2022294 SHA256 eab00e8e758cd9dd33b3e2cf6af80297d1951dc7db37bd723a6488a35d577adc SHA512 942cccc2cbe147572cc2d346ac330d80c86915757b2b7a380829f0b40294d7e4afd4887d5066821af1e059cd78cdb38520fc9d28b55daa7afcd0e5b2e6bd9a5d WHIRLPOOL cc072a64364f38d98187e7102e5be0277011071ce90a510a641aea6a5b3573a436e6539c5688b24d12a9654786892070c1518093e0176e5a40bea57f7dded133
 DIST rsyslog-doc-8.12.0.tar.gz 4212441 SHA256 f88517c1e5ae3a8ba129d531b5b4bb79e80f70898a8a5b72a0abd7a8a0feb8f0 SHA512 a1b3907e1a474076dd11e76b267eff35dadbd5abaf3ab802a187ce045eecc6028c854ed8e661650e10c74c79408c6ded341d16af94a05f10c529faaa8f606afb WHIRLPOOL aa21ea93536bab4c9761bdbe2e6c67f650bf181f64cb7c4a78c646d319a5472895be2a118c90d7c42548575b76f62e5dc6b0c4103cf373ab9e3704a6999c6c1b
+DIST rsyslog-doc-8.13.0.tar.gz 4147364 SHA256 3da9a1446686d1cfa82c123a610f2c30f4dc1cbfa608f44ded2baf168e86b67b SHA512 6676533b1e4884f18e583be19c5a50b8f12017ecc2c6860d54dcc72d64e7eafe20a2af3a22817226df123a7a193c7090097502f287455488dd8806b7aac0a5cd WHIRLPOOL 1231580f2bf8af42a7dd34f0a88315ff56324eb64d1259a281a5266fdbe7a472f596d66a5b6d1f5cbf19fdb6f76a2083753e0de224a07653454178128de4fead
 DIST rsyslog-doc-8.7.0.tar.gz 4105507 SHA256 f131bfb963eed4fe74d7336ee5261876b436004b78994d47523a82c0f7d666a8 SHA512 9b5b6f28a55b58c956ca614301fc9667243d02c321f8b4071264e4040dd8fe79ba7eb5a08912e2a229bdcf12f68eec24f1c65ba7b82ccd60c8e70d34267b8405 WHIRLPOOL 386ad5164768a5a4919ba5acda29f3ef670b78cc9d6845e3c8ee252b43d6622c19c7f8ec1edd7d0f1d111bf2c06d29fb5dbf9af6b46c426932ae6caa0e63c30c
-DIST rsyslog-doc-8.9.0.tar.gz 4100654 SHA256 d3c6747439fabbfa976922ca26ffa695778668e757261e00103f2444cf153afa SHA512 dbc6dfc43f3a75ba671969d2fd59080d96e411a62a2ac91444d076acba548b2c87000f9822fa0af82f22b4f5c098273d407c1e665ce4b24a52dbddfdc9ab981f WHIRLPOOL 550d499ec556a75344d25331aa1df1855f6f70e2e702c086a8ecbf1817eb1f4bc3b94224b77491f3bc1f6c758a22475c248f8afdfc25816132dfedd81c6dfee0
diff --git a/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch b/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch
deleted file mode 100644
index c74279b..0000000
--- a/app-admin/rsyslog/files/8-stable/10-respect_CFLAGS.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.old	2014-10-02 15:41:45.692471540 +0200
-+++ configure.ac	2014-10-02 15:42:11.122743182 +0200
-@@ -835,7 +835,7 @@
- AM_CONDITIONAL(ENABLE_RSYSLOGRT, test x$enable_rsyslogrt = xyes)
- RSRT_CFLAGS="\$(RSRT_CFLAGS1) \$(LIBESTR_CFLAGS) \$(JSON_C_CFLAGS)"
- if test "$GCC" = "yes"
--then RSRT_CFLAGS="$RSRT_CFLAGS -W -std=c99 -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute -g"
-+then RSRT_CFLAGS="$RSRT_CFLAGS -W -std=c99 -Wall -Wformat-security -Wshadow -Wcast-align -Wpointer-arith -Wmissing-format-attribute"
- fi
- RSRT_LIBS="\$(RSRT_LIBS1) \$(LIBESTR_LIBS) \$(JSON_C_LIBS)"
- AC_SUBST(RSRT_CFLAGS1)
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch
new file mode 100644
index 0000000..f049d53
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.12.0-fix-re_extract.patch
@@ -0,0 +1,130 @@
+From a88d67df6e55e0a5f484f6aff8aa6e9813c5c31a Mon Sep 17 00:00:00 2001
+From: Janmejay Singh <singh.janmejay@gmail.com>
+Date: Mon, 28 Sep 2015 20:38:05 +0530
+Subject: [PATCH] fixed re_extract bug, which fails the regex-compile for
+ extract as fn-init fails when fn does not have exactly 2 args
+
+
+Fixes: https://github.com/rsyslog/rsyslog/issues/499
+
+---
+ grammar/rainerscript.c                   |  2 +-
+ tests/Makefile.am                        |  6 ++++++
+ tests/rscript_re_extract.sh              | 14 ++++++++++++++
+ tests/rscript_re_match.sh                | 14 ++++++++++++++
+ tests/testsuites/rscript_re_extract.conf |  9 +++++++++
+ tests/testsuites/rscript_re_match.conf   | 10 ++++++++++
+ 6 files changed, 54 insertions(+), 1 deletion(-)
+ create mode 100755 tests/rscript_re_extract.sh
+ create mode 100755 tests/rscript_re_match.sh
+ create mode 100644 tests/testsuites/rscript_re_extract.conf
+ create mode 100644 tests/testsuites/rscript_re_match.conf
+
+diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
+index f02e1fe..17f785e 100644
+--- a/grammar/rainerscript.c
++++ b/grammar/rainerscript.c
+@@ -3747,7 +3747,7 @@ initFunc_re_match(struct cnffunc *func)
+ 	regex_t *re;
+ 	DEFiRet;
+ 
+-	if(func->nParams != 2) {
++	if(func->nParams < 2) {
+ 		parser_errmsg("rsyslog logic error in line %d of file %s\n",
+ 			__LINE__, __FILE__);
+ 		FINALIZE;
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 914d947..d77728a 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -120,6 +120,8 @@ TESTS +=  \
+ 	rscript_replace_complex.sh \
+ 	rscript_wrap2.sh \
+ 	rscript_wrap3.sh \
++	rscript_re_extract.sh \
++	rscript_re_match.sh \
+ 	rs_optimizer_pri.sh \
+ 	cee_simple.sh \
+ 	cee_diskqueue.sh \
+@@ -854,6 +856,10 @@ EXTRA_DIST= \
+ 	testsuites/stop_when_array_has_element.conf \
+ 	key_dereference_on_uninitialized_variable_space.sh \
+ 	testsuites/key_dereference_on_uninitialized_variable_space.conf \
++	rscript_re_extract.sh \
++	testsuites/rscript_re_extract.conf \
++	rscript_re_match.sh \
++	testsuites/rscript_re_match.conf \
+ 	cfg.sh
+ 
+ # TODO: re-enable
+diff --git a/tests/rscript_re_extract.sh b/tests/rscript_re_extract.sh
+new file mode 100755
+index 0000000..930448c
+--- /dev/null
++++ b/tests/rscript_re_extract.sh
+@@ -0,0 +1,14 @@
++#!/bin/bash
++# added 2015-09-29 by singh.janmejay
++# This file is part of the rsyslog project, released under ASL 2.0
++echo ===============================================================================
++echo \[rscript_re_extract.sh\]: test re_extract rscript-fn
++. $srcdir/diag.sh init
++. $srcdir/diag.sh startup rscript_re_extract.conf
++. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
++echo doing shutdown
++. $srcdir/diag.sh shutdown-when-empty
++echo wait on shutdown
++. $srcdir/diag.sh wait-shutdown 
++. $srcdir/diag.sh content-check "*Number is 19597*"
++. $srcdir/diag.sh exit
+diff --git a/tests/rscript_re_match.sh b/tests/rscript_re_match.sh
+new file mode 100755
+index 0000000..d2e212d
+--- /dev/null
++++ b/tests/rscript_re_match.sh
+@@ -0,0 +1,14 @@
++#!/bin/bash
++# added 2015-09-29 by singh.janmejay
++# This file is part of the rsyslog project, released under ASL 2.0
++echo ===============================================================================
++echo \[rscript_re_match.sh\]: test re_match rscript-fn
++. $srcdir/diag.sh init
++. $srcdir/diag.sh startup rscript_re_match.conf
++. $srcdir/diag.sh tcpflood -m 1 -I $srcdir/testsuites/date_time_msg
++echo doing shutdown
++. $srcdir/diag.sh shutdown-when-empty
++echo wait on shutdown
++. $srcdir/diag.sh wait-shutdown 
++. $srcdir/diag.sh content-check "*Matched*"
++. $srcdir/diag.sh exit
+diff --git a/tests/testsuites/rscript_re_extract.conf b/tests/testsuites/rscript_re_extract.conf
+new file mode 100644
+index 0000000..6c71e53
+--- /dev/null
++++ b/tests/testsuites/rscript_re_extract.conf
+@@ -0,0 +1,9 @@
++$IncludeConfig diag-common.conf
++template(name="outfmt" type="string" string="*Number is %$.number%*\n")
++
++module(load="../plugins/imtcp/.libs/imtcp")
++input(type="imtcp" port="13514")
++
++set $.number = re_extract($msg, '.* ([0-9]+)$', 0, 1, 'none');
++
++action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+diff --git a/tests/testsuites/rscript_re_match.conf b/tests/testsuites/rscript_re_match.conf
+new file mode 100644
+index 0000000..3e0f36f
+--- /dev/null
++++ b/tests/testsuites/rscript_re_match.conf
+@@ -0,0 +1,10 @@
++$IncludeConfig diag-common.conf
++template(name="outfmt" type="string" string="*Matched*\n")
++
++module(load="../plugins/imtcp/.libs/imtcp")
++input(type="imtcp" port="13514")
++
++if (re_match($msg, '.* ([0-9]+)$')) then {
++	 action(type="omfile" file="./rsyslog.out.log" template="outfmt")
++}
++
diff --git a/app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch
new file mode 100644
index 0000000..b426180
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/50-rsyslog-8.13.0-lookup-table-reload-bugfix.patch
@@ -0,0 +1,141 @@
+From 3a10a78edeef9725f69a24d633bb394e365145f0 Mon Sep 17 00:00:00 2001
+From: Janmejay Singh <singh.janmejay@gmail.com>
+Date: Wed, 30 Sep 2015 17:24:38 +0530
+Subject: [PATCH] Fixed lookup-table reload bug, which ignored table-length of
+ reloaded table, resulting in additional entries being invisible while
+ looking-up (binary-search would work with old-table-length). This would be a
+ security-issue or may cause a crash if reloaded table is actually smaller
+ (memory access beyond table).
+
+---
+ runtime/lookup.c                    |  1 +
+ tests/Makefile.am                   |  5 +++++
+ tests/diag.sh                       |  4 ++++
+ tests/lookup_table.sh               | 24 ++++++++++++++++++++++++
+ tests/testsuites/lookup_table.conf  |  9 +++++++++
+ tests/testsuites/xlate.lkp_tbl      |  5 +++++
+ tests/testsuites/xlate_more.lkp_tbl |  6 ++++++
+ 7 files changed, 55 insertions(+)
+ create mode 100755 tests/lookup_table.sh
+ create mode 100644 tests/testsuites/lookup_table.conf
+ create mode 100644 tests/testsuites/xlate.lkp_tbl
+ create mode 100644 tests/testsuites/xlate_more.lkp_tbl
+
+diff --git a/runtime/lookup.c b/runtime/lookup.c
+index 096bf09..5aa00b9 100644
+--- a/runtime/lookup.c
++++ b/runtime/lookup.c
+@@ -203,6 +203,7 @@ lookupReload(lookup_t *pThis)
+ 	}
+ 	free(pThis->d.strtab);
+ 	pThis->d.strtab = newlu.d.strtab; /* hand table AND ALL STRINGS over! */
++	pThis->nmemb = newlu.nmemb;
+ 	pthread_rwlock_unlock(&pThis->rwlock);
+ 	errmsg.LogError(0, RS_RET_OK, "lookup table '%s' reloaded from file '%s'",
+ 			pThis->name, pThis->filename);
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index d77728a..49cb641 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -130,6 +130,7 @@ TESTS +=  \
+ 	incltest_dir_wildcard.sh \
+ 	incltest_dir_empty_wildcard.sh \
+ 	linkedlistqueue.sh \
++	lookup_table.sh \
+ 	key_dereference_on_uninitialized_variable_space.sh
+ 
+ 
+@@ -860,6 +861,10 @@ EXTRA_DIST= \
+ 	testsuites/rscript_re_extract.conf \
+ 	rscript_re_match.sh \
+ 	testsuites/rscript_re_match.conf \
++	lookup_table.sh \
++	testsuites/lookup_table.conf \
++	testsuites/xlate.lkp_tbl \
++	testsuites/xlate_more.lkp_tbl \
+ 	cfg.sh
+ 
+ # TODO: re-enable
+diff --git a/tests/diag.sh b/tests/diag.sh
+index 95d6adb..c489fff 100755
+--- a/tests/diag.sh
++++ b/tests/diag.sh
+@@ -195,6 +195,10 @@ case $1 in
+ 			echo WaitMainQueueEmpty | ./diagtalker || . $srcdir/diag.sh error-exit  $?
+ 		fi
+ 		;;
++   'issue-HUP') # shut rsyslogd down when main queue is empty. $2 is the instance.
++		kill -HUP `cat rsyslog$2.pid`
++		./msleep 1000
++		;;
+    'shutdown-when-empty') # shut rsyslogd down when main queue is empty. $2 is the instance.
+ 		if [ "$2" == "2" ]
+ 		then
+diff --git a/tests/lookup_table.sh b/tests/lookup_table.sh
+new file mode 100755
+index 0000000..fae2fab
+--- /dev/null
++++ b/tests/lookup_table.sh
+@@ -0,0 +1,24 @@
++#!/bin/bash
++# added 2015-09-30 by singh.janmejay
++# This file is part of the rsyslog project, released under ASL 2.0
++echo ===============================================================================
++echo \[lookup_table_reload.sh\]: test for lookup-table and HUP based reloading of it
++. $srcdir/diag.sh init
++cp $srcdir/testsuites/xlate.lkp_tbl $srcdir/xlate.lkp_tbl
++. $srcdir/diag.sh startup lookup_table.conf
++. $srcdir/diag.sh injectmsg  0 3
++. $srcdir/diag.sh wait-queueempty
++. $srcdir/diag.sh content-check "msgnum:00000000: foo_old"
++. $srcdir/diag.sh content-check "msgnum:00000001: bar_old"
++. $srcdir/diag.sh assert-content-missing "baz"
++cp $srcdir/testsuites/xlate_more.lkp_tbl $srcdir/xlate.lkp_tbl
++. $srcdir/diag.sh issue-HUP
++. $srcdir/diag.sh injectmsg  0 3
++echo doing shutdown
++. $srcdir/diag.sh shutdown-when-empty
++echo wait on shutdown
++. $srcdir/diag.sh wait-shutdown 
++. $srcdir/diag.sh content-check "msgnum:00000000: foo_new"
++. $srcdir/diag.sh content-check "msgnum:00000001: bar_new"
++. $srcdir/diag.sh content-check "msgnum:00000002: baz"
++. $srcdir/diag.sh exit
+diff --git a/tests/testsuites/lookup_table.conf b/tests/testsuites/lookup_table.conf
+new file mode 100644
+index 0000000..29bd805
+--- /dev/null
++++ b/tests/testsuites/lookup_table.conf
+@@ -0,0 +1,9 @@
++$IncludeConfig diag-common.conf
++
++lookup_table(name="xlate" file="xlate.lkp_tbl")
++
++template(name="outfmt" type="string" string="- %msg% %$.lkp%\n")
++
++set $.lkp = lookup("xlate", $msg);
++
++action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+diff --git a/tests/testsuites/xlate.lkp_tbl b/tests/testsuites/xlate.lkp_tbl
+new file mode 100644
+index 0000000..30e2796
+--- /dev/null
++++ b/tests/testsuites/xlate.lkp_tbl
+@@ -0,0 +1,5 @@
++{
++  "table":[
++      {"index":" msgnum:00000000:", "value":"foo_old" },
++      {"index":" msgnum:00000001:", "value":"bar_old" }]
++}
+diff --git a/tests/testsuites/xlate_more.lkp_tbl b/tests/testsuites/xlate_more.lkp_tbl
+new file mode 100644
+index 0000000..2d3f452
+--- /dev/null
++++ b/tests/testsuites/xlate_more.lkp_tbl
+@@ -0,0 +1,6 @@
++{
++  "table":[
++      {"index":" msgnum:00000000:", "value":"foo_new" },
++      {"index":" msgnum:00000001:", "value":"bar_new" },
++      {"index":" msgnum:00000002:", "value":"baz" }]
++}
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1 b/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1
new file mode 100644
index 0000000..da48c01
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.confd-r1
@@ -0,0 +1,30 @@
+# /etc/conf.d/rsyslog
+
+# Configuration file
+#RSYSLOG_CONFIGFILE="/etc/rsyslog.conf"
+
+# PID file
+# If you should ever change this, remember to update
+# "/etc/logrotate.d/rsyslog", too.
+#RSYSLOG_PIDFILE="/run/rsyslogd.pid"
+
+# You can use this configuration option to pass additional options to the
+# start-stop-daemon, see start-stop-daemon(8) for more details.
+# Per default we wait 1000ms after we have started the service to ensure
+# that the daemon is really up and running.
+#RSYSLOG_SSDARGS="--wait 1000"
+
+# The termination timeout (start-stop-daemon parameter "retry") ensures
+# that the service will be terminated within a given time (60 + 5 seconds
+# per default) when you are stopping the service.
+# You need to increase the value when you are working with a large queue.
+# See http://www.rsyslog.com/doc/queues.html for further information.
+#RSYSLOG_TERMTIMEOUT="TERM/60/KILL/5"
+
+
+# Options to rsyslogd
+# See rsyslogd(8) for more details
+# Notes:
+# * Do not specify another PIDFILE but use the variable above to change the location
+# * Do not specify another CONFIGFILE but use the variable above to change the location
+#RSYSLOG_OPTS=""
diff --git a/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1 b/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1
new file mode 100644
index 0000000..078740d
--- /dev/null
+++ b/app-admin/rsyslog/files/8-stable/rsyslog.initd-r1
@@ -0,0 +1,73 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+RSYSLOG_CONFIGFILE=${RSYSLOG_CONFIGFILE:-"/etc/rsyslog.conf"}
+RSYSLOG_PIDFILE=${RSYSLOG_PIDFILE:-"/run/rsyslogd.pid"}
+RSYSLOG_SSDARGS=${RSYSLOG_SSDARGS:-"--wait 1000"}
+RSYSLOG_TERMTIMEOUT=${RSYSLOG_TERMTIMEOUT:-"TERM/60/KILL/5"}
+RSYSLOG_OPTS=${RSYSLOG_OPTS:-""}
+
+command="/usr/sbin/rsyslogd"
+command_args="${RSYSLOG_OPTS} -f \"${RSYSLOG_CONFIGFILE}\" -i \"${RSYSLOG_PIDFILE}\""
+start_stop_daemon_args="${RSYSLOG_SSDARGS}"
+pidfile="${RSYSLOG_PIDFILE}"
+retry="${RSYSLOG_TERMTIMEOUT}"
+
+required_files="${RSYSLOG_CONFIGFILE}"
+
+description="RSYSLOG is the rocket-fast system for log processing (syslog replacement)."
+
+extra_commands="configtest"
+extra_started_commands="rotate"
+
+description_configtest="Run rsyslogd's internal config check."
+
+description_rotate="Sends rsyslogd a signal to re-open its log files."
+
+depend() {
+	need clock hostname localmount
+	provide logger
+}
+
+start_pre() {
+	if [ "${RC_CMD}" != "restart" ]; then
+		configtest || return 1
+	fi
+}
+
+stop_pre() {
+	if [ "${RC_CMD}" = "restart" ]; then
+		configtest || return 1
+	fi
+}
+
+stop_post() {
+	if [ -f "${RSYSLOG_PIDFILE}" ]; then
+		vebegin "Removing stale PID file"
+		rm --force "${RSYSLOG_PIDFILE}"
+		veend $?
+	fi
+}
+
+configtest() {
+	local _command_args="-N 999 -f \"${RSYSLOG_CONFIGFILE}\""
+	local _retval=0
+
+	ebegin "Checking rsyslogd's configuration"
+	eval ${command} ${_command_args} >/dev/null 2>&1
+	_retval=$?
+
+	if [ ${_retval} -ne 0 ]; then
+		eval ${command} ${_command_args}
+	fi
+
+	eend ${_retval} "failed, please correct errors above"
+}
+
+rotate() {
+	ebegin "Re-opening rsyslogd logs"
+	start-stop-daemon --signal SIGHUP --pidfile "${RSYSLOG_PIDFILE}"
+	eend $?
+}
diff --git a/app-admin/rsyslog/rsyslog-8.12.0-r1.ebuild b/app-admin/rsyslog/rsyslog-8.12.0-r1.ebuild
index a7fac74..ff39a40 100644
--- a/app-admin/rsyslog/rsyslog-8.12.0-r1.ebuild
+++ b/app-admin/rsyslog/rsyslog-8.12.0-r1.ebuild
@@ -55,7 +55,10 @@
 	mysql? ( virtual/mysql )
 	normalize? (
 		>=dev-libs/libee-0.4.0
-		>=dev-libs/liblognorm-1.1.0:=
+		( || (
+			>=dev-libs/liblognorm-1.1.0:=
+			<dev-libs/liblognorm-1.1.2:=
+		) )
 	)
 	omudpspoof? ( >=net-libs/libnet-1.1.6 )
 	postgres? ( >=dev-db/postgresql-8.4.20:= )
diff --git a/app-admin/rsyslog/rsyslog-8.12.0.ebuild b/app-admin/rsyslog/rsyslog-8.12.0.ebuild
deleted file mode 100644
index 81f79c4..0000000
--- a/app-admin/rsyslog/rsyslog-8.12.0.ebuild
+++ /dev/null
@@ -1,414 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-AUTOTOOLS_AUTORECONF=1
-
-inherit autotools-utils eutils systemd
-
-DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
-HOMEPAGE="http://www.rsyslog.com/"
-
-BRANCH="8-stable"
-
-PATCHES=()
-
-if [[ ${PV} == "9999" ]]; then
-	EGIT_REPO_URI="
-		git://github.com/rsyslog/${PN}.git
-		https://github.com/rsyslog/${PN}.git
-	"
-
-	DOC_REPO_URI="
-		git://github.com/rsyslog/${PN}-doc.git
-		https://github.com/rsyslog/${PN}-doc.git
-	"
-
-	inherit git-r3
-else
-	SRC_URI="
-		http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
-		doc? ( http://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
-	"
-	KEYWORDS="~amd64 ~arm ~hppa ~x86"
-
-	PATCHES+=( "${FILESDIR}"/8-stable/40-rsyslog-fix-parallel-build-issue-479.patch )
-fi
-
-LICENSE="GPL-3 LGPL-3 Apache-2.0"
-SLOT="0"
-IUSE="dbi debug doc elasticsearch +gcrypt jemalloc kerberos mongodb mysql normalize omudpspoof
-postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools zeromq"
-
-RDEPEND="
-	>=dev-libs/json-c-0.11:=
-	>=dev-libs/libestr-0.1.9
-	>=dev-libs/liblogging-1.0.1:=[stdlog]
-	>=sys-libs/zlib-1.2.5
-	dbi? ( >=dev-db/libdbi-0.8.3 )
-	elasticsearch? ( >=net-misc/curl-7.35.0 )
-	gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
-	jemalloc? ( >=dev-libs/jemalloc-3.3.1 )
-	kerberos? ( virtual/krb5 )
-	mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
-	mysql? ( virtual/mysql )
-	normalize? (
-		>=dev-libs/libee-0.4.0
-		>=dev-libs/liblognorm-1.1.0:=
-	)
-	omudpspoof? ( >=net-libs/libnet-1.1.6 )
-	postgres? ( >=dev-db/postgresql-8.4.20:= )
-	rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
-	redis? ( >=dev-libs/hiredis-0.11.0 )
-	relp? ( >=dev-libs/librelp-1.2.5 )
-	rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
-	rfc5424hmac? ( >=dev-libs/openssl-0.9.8y:= )
-	snmp? ( >=net-analyzer/net-snmp-5.7.2 )
-	ssl? ( >=net-libs/gnutls-2.12.23 )
-	systemd? ( >=sys-apps/systemd-208 )
-	zeromq? ( >=net-libs/czmq-1.2.0 )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-if [[ ${PV} == "9999" ]]; then
-	DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
-	DEPEND+=" >=sys-devel/flex-2.5.39-r1"
-	DEPEND+=" >=sys-devel/bison-2.4.3"
-	DEPEND+=" >=dev-python/docutils-0.12"
-fi
-
-# Maitainer note : open a bug to upstream
-# showing that building in a separate dir fails
-AUTOTOOLS_IN_SOURCE_BUILD=1
-
-AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
-
-DOCS=(
-	AUTHORS
-	ChangeLog
-	"${FILESDIR}"/${BRANCH}/README.gentoo
-)
-
-src_unpack() {
-	if [[ ${PV} == "9999" ]]; then
-		git-r3_fetch
-		git-r3_checkout
-	else
-		unpack ${P}.tar.gz
-	fi
-
-	if use doc; then
-		if [[ ${PV} == "9999" ]]; then
-			local _EGIT_BRANCH=
-			if [ -n "${EGIT_BRANCH}" ]; then
-				# Cannot use rsyslog commits/branches for documentation repository
-				_EGIT_BRANCH=${EGIT_BRANCH}
-				unset EGIT_BRANCH
-			fi
-
-			git-r3_fetch "${DOC_REPO_URI}"
-			git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
-
-			if [ -n "${_EGIT_BRANCH}" ]; then
-				# Restore previous EGIT_BRANCH information
-				EGIT_BRANCH=${_EGIT_BRANCH}
-			fi
-		else
-			local doc_tarball="${PN}-doc-${PV}.tar.gz"
-
-			cd "${S}" || die "Cannot change dir into '$S'"
-			mkdir docs || die "Failed to create docs directory"
-			cd docs || die "Failed to change dir into '${S}/docs'"
-			unpack ${doc_tarball}
-		fi
-	fi
-}
-
-src_configure() {
-	# Maintainer notes:
-	# * Guardtime support is missing because libgt isn't yet available
-	#   in portage.
-	# * Hadoop's HDFS file system output module is currently not
-	#   supported in Gentoo because nobody is able to test it
-	#   (JAVA dependency).
-	# * dev-libs/hiredis doesn't provide pkg-config (see #504614,
-	#   upstream PR 129 and 136) so we need to export HIREDIS_*
-	#   variables because rsyslog's build system depends on pkg-config.
-
-	if use redis; then
-		export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
-		export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
-	fi
-
-	local myeconfargs=(
-		--disable-debug-symbols
-		--disable-generate-man-pages
-		--without-valgrind-testbench
-		$(use_enable test testbench)
-		# Input Plugins without depedencies
-		--enable-imdiag
-		--enable-imfile
-		--enable-impstats
-		--enable-imptcp
-		# Message Modificiation Plugins without depedencies
-		--enable-mmanon
-		--enable-mmaudit
-		--enable-mmfields
-		--enable-mmjsonparse
-		--enable-mmpstrucdata
-		--enable-mmsequence
-		--enable-mmutf8fix
-		# Output Modification Plugins without dependencies
-		--enable-mail
-		--enable-omprog
-		--enable-omruleset
-		--enable-omstdout
-		--enable-omuxsock
-		# Misc
-		--enable-pmaixforwardedfrom
-		--enable-pmciscoios
-		--enable-pmcisconames
-		--enable-pmlastmsg
-		--enable-pmsnare
-		# DB
-		$(use_enable dbi libdbi)
-		$(use_enable mongodb ommongodb)
-		$(use_enable mysql)
-		$(use_enable postgres pgsql)
-		$(use_enable redis omhiredis)
-		# Debug
-		$(use_enable debug)
-		$(use_enable debug diagtools)
-		$(use_enable debug memcheck)
-		$(use_enable debug rtinst)
-		$(use_enable debug valgrind)
-		# Misc
-		$(use_enable elasticsearch)
-		$(use_enable gcrypt libgcrypt)
-		$(use_enable jemalloc)
-		$(use_enable kerberos gssapi-krb5)
-		$(use_enable normalize mmnormalize)
-		$(use_enable omudpspoof)
-		$(use_enable rabbitmq omrabbitmq)
-		$(use_enable relp)
-		$(use_enable rfc3195)
-		$(use_enable rfc5424hmac mmrfc5424addhmac)
-		$(use_enable snmp)
-		$(use_enable snmp mmsnmptrapd)
-		$(use_enable ssl gnutls)
-		$(use_enable systemd imjournal)
-		$(use_enable systemd omjournal)
-		$(use_enable usertools)
-		$(use_enable zeromq imzmq3)
-		$(use_enable zeromq omzmq3)
-		"$(systemd_with_unitdir)"
-	)
-
-	autotools-utils_src_configure
-}
-
-src_compile() {
-	autotools-utils_src_compile
-
-	if use doc && [[ "${PV}" == "9999" ]]; then
-		einfo "Building documentation ..."
-		local doc_dir="${S}/docs"
-		cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
-		sphinx-build -b html source build || die "Building documentation failed!"
-	fi
-}
-
-src_test() {
-	local _has_increased_ulimit=
-
-	if ulimit -n 3072; then
-		_has_increased_ulimit="true"
-	fi
-
-	if ! emake --jobs 1 check; then
-		eerror "Test suite failed! :("
-
-		if [ -z "${_has_increased_ulimit}" ]; then
-			eerror "Probably because open file limit couldn't be set to 3072."
-		fi
-
-		if has userpriv $FEATURES; then
-			eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
-				"before you submit a bug report."
-		fi
-
-	fi
-}
-
-src_install() {
-	use doc && HTML_DOCS=( "${S}/docs/build/" )
-	autotools-utils_src_install
-
-	newconfd "${FILESDIR}/${BRANCH}/${PN}.confd" ${PN}
-	newinitd "${FILESDIR}/${BRANCH}/${PN}.initd" ${PN}
-
-	keepdir /var/empty/dev
-	keepdir /var/spool/${PN}
-	keepdir /etc/ssl/${PN}
-	keepdir /etc/${PN}.d
-
-	insinto /etc
-	newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
-
-	insinto /etc/rsyslog.d/
-	doins "${FILESDIR}/${BRANCH}/50-default.conf"
-
-	insinto /etc/logrotate.d/
-	newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
-
-	if use mysql; then
-		insinto /usr/share/doc/${PF}/scripts/mysql
-		doins plugins/ommysql/createDB.sql
-	fi
-
-	if use postgres; then
-		insinto /usr/share/doc/${PF}/scripts/pgsql
-		doins plugins/ompgsql/createDB.sql
-	fi
-}
-
-pkg_postinst() {
-	local advertise_readme=0
-
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		# This is a new installation
-
-		advertise_readme=1
-
-		if use mysql || use postgres; then
-			echo
-			elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
-			elog "  /usr/share/doc/${PF}/scripts"
-		fi
-
-		if use ssl; then
-			echo
-			elog "To create a default CA and certificates for your server and clients, run:"
-			elog "  emerge --config =${PF}"
-			elog "on your logging server. You can run it several times,"
-			elog "once for each logging client. The client certificates will be signed"
-			elog "using the CA certificate generated during the first run."
-		fi
-	fi
-
-	if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
-		# Show this message until rsyslog-8.x
-		echo
-		elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
-		elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
-
-		advertise_readme=1
-	fi
-
-	if [[ ${advertise_readme} -gt 0 ]]; then
-		# We need to show the README file location
-
-		echo ""
-		elog "Please read"
-		elog ""
-		elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
-		elog ""
-		elog "for more details."
-	fi
-}
-
-pkg_config() {
-	if ! use ssl ; then
-		einfo "There is nothing to configure for rsyslog unless you"
-		einfo "used USE=ssl to build it."
-		return 0
-	fi
-
-	# Make sure the certificates directory exists
-	CERTDIR="${EROOT}/etc/ssl/${PN}"
-	if [ ! -d "${CERTDIR}" ]; then
-		mkdir "${CERTDIR}" || die
-	fi
-	einfo "Your certificates will be stored in ${CERTDIR}"
-
-	# Create a default CA if needed
-	if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
-		einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
-		certtool --generate-privkey \
-			--outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
-
-		cat > "${T}/${PF}.$$" <<- _EOF
-		cn = Portage automated CA
-		ca
-		cert_signing_key
-		expiration_days = 3650
-		_EOF
-
-		certtool --generate-self-signed \
-			--load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
-			--outfile "${CERTDIR}/${PN}_ca.cert.pem" \
-			--template "${T}/${PF}.$$" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
-
-		# Create the server certificate
-		echo
-		einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
-		read -r CN
-
-		einfo "Creating private key and certificate for server ${CN}..."
-		certtool --generate-privkey \
-			--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
-
-		cat > "${T}/${PF}.$$" <<- _EOF
-		cn = ${CN}
-		tls_www_server
-		dns_name = ${CN}
-		expiration_days = 3650
-		_EOF
-
-		certtool --generate-certificate \
-			--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
-			--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
-			--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
-			--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
-			--template "${T}/${PF}.$$" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
-
-	else
-		einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
-	fi
-
-	# Create a client certificate
-	echo
-	einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
-	read -r CN
-
-	einfo "Creating private key and certificate for client ${CN}..."
-	certtool --generate-privkey \
-		--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
-	chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
-
-	cat > "${T}/${PF}.$$" <<- _EOF
-	cn = ${CN}
-	tls_www_client
-	dns_name = ${CN}
-	expiration_days = 3650
-	_EOF
-
-	certtool --generate-certificate \
-		--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
-		--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
-		--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
-		--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
-		--template "${T}/${PF}.$$" &>/dev/null
-	chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
-
-	rm -f "${T}/${PF}.$$"
-
-	echo
-	einfo "Here is the documentation on how to encrypt your log traffic:"
-	einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
-}
diff --git a/app-admin/rsyslog/rsyslog-8.13.0.ebuild b/app-admin/rsyslog/rsyslog-8.13.0.ebuild
new file mode 100644
index 0000000..34085ef
--- /dev/null
+++ b/app-admin/rsyslog/rsyslog-8.13.0.ebuild
@@ -0,0 +1,423 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+AUTOTOOLS_AUTORECONF=1
+
+inherit autotools-utils eutils systemd
+
+DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
+HOMEPAGE="http://www.rsyslog.com/"
+
+BRANCH="8-stable"
+
+PATCHES=()
+
+if [[ ${PV} == "9999" ]]; then
+	EGIT_REPO_URI="
+		git://github.com/rsyslog/${PN}.git
+		https://github.com/rsyslog/${PN}.git
+	"
+
+	DOC_REPO_URI="
+		git://github.com/rsyslog/${PN}-doc.git
+		https://github.com/rsyslog/${PN}-doc.git
+	"
+
+	inherit git-r3
+else
+	SRC_URI="
+		http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
+		doc? ( http://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
+	"
+	KEYWORDS="~amd64 ~arm ~hppa ~x86"
+
+	PATCHES+=( "${FILESDIR}"/${BRANCH}/50-${PN}-8.12.0-fix-re_extract.patch )
+	PATCHES+=( "${FILESDIR}"/${BRANCH}/50-${PN}-8.13.0-lookup-table-reload-bugfix.patch )
+fi
+
+LICENSE="GPL-3 LGPL-3 Apache-2.0"
+SLOT="0"
+IUSE="dbi debug doc elasticsearch +gcrypt jemalloc kerberos libressl mongodb mysql normalize omudpspoof"
+IUSE+=" postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools zeromq"
+
+RDEPEND="
+	>=dev-libs/json-c-0.11:=
+	>=dev-libs/libestr-0.1.9
+	>=dev-libs/liblogging-1.0.1:=[stdlog]
+	>=sys-libs/zlib-1.2.5
+	dbi? ( >=dev-db/libdbi-0.8.3 )
+	elasticsearch? ( >=net-misc/curl-7.35.0 )
+	gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
+	jemalloc? ( >=dev-libs/jemalloc-3.3.1 )
+	kerberos? ( virtual/krb5 )
+	mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
+	mysql? ( virtual/mysql )
+	normalize? (
+		>=dev-libs/libee-0.4.0
+		>=dev-libs/liblognorm-1.1.2:=
+	)
+	omudpspoof? ( >=net-libs/libnet-1.1.6 )
+	postgres? ( >=dev-db/postgresql-8.4.20:= )
+	rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
+	redis? ( >=dev-libs/hiredis-0.11.0 )
+	relp? ( >=dev-libs/librelp-1.2.5 )
+	rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
+	rfc5424hmac? (
+		!libressl? ( >=dev-libs/openssl-0.9.8y:0= )
+		libressl? ( dev-libs/libressl:= )
+	)
+	snmp? ( >=net-analyzer/net-snmp-5.7.2 )
+	ssl? ( >=net-libs/gnutls-2.12.23 )
+	systemd? ( >=sys-apps/systemd-208 )
+	zeromq? ( >=net-libs/czmq-1.2.0 )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+if [[ ${PV} == "9999" ]]; then
+	DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
+	DEPEND+=" >=sys-devel/flex-2.5.39-r1"
+	DEPEND+=" >=sys-devel/bison-2.4.3"
+	DEPEND+=" >=dev-python/docutils-0.12"
+fi
+
+# Maitainer note : open a bug to upstream
+# showing that building in a separate dir fails
+AUTOTOOLS_IN_SOURCE_BUILD=1
+
+AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
+
+DOCS=(
+	AUTHORS
+	ChangeLog
+	"${FILESDIR}"/${BRANCH}/README.gentoo
+)
+
+src_unpack() {
+	if [[ ${PV} == "9999" ]]; then
+		git-r3_fetch
+		git-r3_checkout
+	else
+		unpack ${P}.tar.gz
+	fi
+
+	if use doc; then
+		if [[ ${PV} == "9999" ]]; then
+			local _EGIT_BRANCH=
+			if [ -n "${EGIT_BRANCH}" ]; then
+				# Cannot use rsyslog commits/branches for documentation repository
+				_EGIT_BRANCH=${EGIT_BRANCH}
+				unset EGIT_BRANCH
+			fi
+
+			git-r3_fetch "${DOC_REPO_URI}"
+			git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
+
+			if [ -n "${_EGIT_BRANCH}" ]; then
+				# Restore previous EGIT_BRANCH information
+				EGIT_BRANCH=${_EGIT_BRANCH}
+			fi
+		else
+			local doc_tarball="${PN}-doc-${PV}.tar.gz"
+
+			cd "${S}" || die "Cannot change dir into '$S'"
+			mkdir docs || die "Failed to create docs directory"
+			cd docs || die "Failed to change dir into '${S}/docs'"
+			unpack ${doc_tarball}
+		fi
+	fi
+}
+
+src_configure() {
+	# Maintainer notes:
+	# * Guardtime support is missing because libgt isn't yet available
+	#   in portage.
+	# * Hadoop's HDFS file system output module is currently not
+	#   supported in Gentoo because nobody is able to test it
+	#   (JAVA dependency).
+	# * dev-libs/hiredis doesn't provide pkg-config (see #504614,
+	#   upstream PR 129 and 136) so we need to export HIREDIS_*
+	#   variables because rsyslog's build system depends on pkg-config.
+
+	if use redis; then
+		export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
+		export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
+	fi
+
+	local myeconfargs=(
+		--disable-debug-symbols
+		--disable-generate-man-pages
+		--without-valgrind-testbench
+		$(use_enable test testbench)
+		# Input Plugins without depedencies
+		--enable-imdiag
+		--enable-imfile
+		--enable-impstats
+		--enable-imptcp
+		# Message Modificiation Plugins without depedencies
+		--enable-mmanon
+		--enable-mmaudit
+		--enable-mmfields
+		--enable-mmjsonparse
+		--enable-mmpstrucdata
+		--enable-mmsequence
+		--enable-mmutf8fix
+		# Output Modification Plugins without dependencies
+		--enable-mail
+		--enable-omprog
+		--enable-omruleset
+		--enable-omstdout
+		--enable-omuxsock
+		# Misc
+		--enable-pmaixforwardedfrom
+		--enable-pmciscoios
+		--enable-pmcisconames
+		--enable-pmlastmsg
+		--enable-pmsnare
+		# DB
+		$(use_enable dbi libdbi)
+		$(use_enable mongodb ommongodb)
+		$(use_enable mysql)
+		$(use_enable postgres pgsql)
+		$(use_enable redis omhiredis)
+		# Debug
+		$(use_enable debug)
+		$(use_enable debug diagtools)
+		$(use_enable debug memcheck)
+		$(use_enable debug rtinst)
+		$(use_enable debug valgrind)
+		# Misc
+		$(use_enable elasticsearch)
+		$(use_enable gcrypt libgcrypt)
+		$(use_enable jemalloc)
+		$(use_enable kerberos gssapi-krb5)
+		$(use_enable normalize mmnormalize)
+		$(use_enable omudpspoof)
+		$(use_enable rabbitmq omrabbitmq)
+		$(use_enable relp)
+		$(use_enable rfc3195)
+		$(use_enable rfc5424hmac mmrfc5424addhmac)
+		$(use_enable snmp)
+		$(use_enable snmp mmsnmptrapd)
+		$(use_enable ssl gnutls)
+		$(use_enable systemd imjournal)
+		$(use_enable systemd omjournal)
+		$(use_enable usertools)
+		$(use_enable zeromq imzmq3)
+		$(use_enable zeromq omzmq3)
+		"$(systemd_with_unitdir)"
+	)
+
+	autotools-utils_src_configure
+}
+
+src_compile() {
+	autotools-utils_src_compile
+
+	if use doc && [[ "${PV}" == "9999" ]]; then
+		einfo "Building documentation ..."
+		local doc_dir="${S}/docs"
+		cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
+		sphinx-build -b html source build || die "Building documentation failed!"
+	fi
+}
+
+src_test() {
+	local _has_increased_ulimit=
+
+	# When adding new tests via patches we have to make them executable
+	einfo "Adjusting permissions of test scripts ..."
+	find "${S}"/tests -type f -name '*.sh' \! -perm -111 -exec chmod a+x '{}' \; || \
+		die "Failed to adjust test scripts permission"
+
+	if ulimit -n 3072; then
+		_has_increased_ulimit="true"
+	fi
+
+	if ! emake --jobs 1 check; then
+		eerror "Test suite failed! :("
+
+		if [ -z "${_has_increased_ulimit}" ]; then
+			eerror "Probably because open file limit couldn't be set to 3072."
+		fi
+
+		if has userpriv $FEATURES; then
+			eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
+				"before you submit a bug report."
+		fi
+
+	fi
+}
+
+src_install() {
+	use doc && HTML_DOCS=( "${S}/docs/build/" )
+	autotools-utils_src_install
+
+	newconfd "${FILESDIR}/${BRANCH}/${PN}.confd-r1" ${PN}
+	newinitd "${FILESDIR}/${BRANCH}/${PN}.initd-r1" ${PN}
+
+	keepdir /var/empty/dev
+	keepdir /var/spool/${PN}
+	keepdir /etc/ssl/${PN}
+	keepdir /etc/${PN}.d
+
+	insinto /etc
+	newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
+
+	insinto /etc/rsyslog.d/
+	doins "${FILESDIR}/${BRANCH}/50-default.conf"
+
+	insinto /etc/logrotate.d/
+	newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
+
+	if use mysql; then
+		insinto /usr/share/doc/${PF}/scripts/mysql
+		doins plugins/ommysql/createDB.sql
+	fi
+
+	if use postgres; then
+		insinto /usr/share/doc/${PF}/scripts/pgsql
+		doins plugins/ompgsql/createDB.sql
+	fi
+}
+
+pkg_postinst() {
+	local advertise_readme=0
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		# This is a new installation
+
+		advertise_readme=1
+
+		if use mysql || use postgres; then
+			echo
+			elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
+			elog "  /usr/share/doc/${PF}/scripts"
+		fi
+
+		if use ssl; then
+			echo
+			elog "To create a default CA and certificates for your server and clients, run:"
+			elog "  emerge --config =${PF}"
+			elog "on your logging server. You can run it several times,"
+			elog "once for each logging client. The client certificates will be signed"
+			elog "using the CA certificate generated during the first run."
+		fi
+	fi
+
+	if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
+		# Show this message until rsyslog-8.x
+		echo
+		elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
+		elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
+
+		advertise_readme=1
+	fi
+
+	if [[ ${advertise_readme} -gt 0 ]]; then
+		# We need to show the README file location
+
+		echo ""
+		elog "Please read"
+		elog ""
+		elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
+		elog ""
+		elog "for more details."
+	fi
+}
+
+pkg_config() {
+	if ! use ssl ; then
+		einfo "There is nothing to configure for rsyslog unless you"
+		einfo "used USE=ssl to build it."
+		return 0
+	fi
+
+	# Make sure the certificates directory exists
+	CERTDIR="${EROOT}/etc/ssl/${PN}"
+	if [ ! -d "${CERTDIR}" ]; then
+		mkdir "${CERTDIR}" || die
+	fi
+	einfo "Your certificates will be stored in ${CERTDIR}"
+
+	# Create a default CA if needed
+	if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
+		einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
+		certtool --generate-privkey \
+			--outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
+		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+		cat > "${T}/${PF}.$$" <<- _EOF
+		cn = Portage automated CA
+		ca
+		cert_signing_key
+		expiration_days = 3650
+		_EOF
+
+		certtool --generate-self-signed \
+			--load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+			--outfile "${CERTDIR}/${PN}_ca.cert.pem" \
+			--template "${T}/${PF}.$$" &>/dev/null
+		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
+
+		# Create the server certificate
+		echo
+		einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
+		read -r CN
+
+		einfo "Creating private key and certificate for server ${CN}..."
+		certtool --generate-privkey \
+			--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+		chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+		cat > "${T}/${PF}.$$" <<- _EOF
+		cn = ${CN}
+		tls_www_server
+		dns_name = ${CN}
+		expiration_days = 3650
+		_EOF
+
+		certtool --generate-certificate \
+			--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+			--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+			--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+			--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+			--template "${T}/${PF}.$$" &>/dev/null
+		chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+	else
+		einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
+	fi
+
+	# Create a client certificate
+	echo
+	einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
+	read -r CN
+
+	einfo "Creating private key and certificate for client ${CN}..."
+	certtool --generate-privkey \
+		--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
+	chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
+
+	cat > "${T}/${PF}.$$" <<- _EOF
+	cn = ${CN}
+	tls_www_client
+	dns_name = ${CN}
+	expiration_days = 3650
+	_EOF
+
+	certtool --generate-certificate \
+		--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
+		--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
+		--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
+		--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
+		--template "${T}/${PF}.$$" &>/dev/null
+	chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
+
+	rm -f "${T}/${PF}.$$"
+
+	echo
+	einfo "Here is the documentation on how to encrypt your log traffic:"
+	einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
+}
diff --git a/app-admin/rsyslog/rsyslog-8.9.0.ebuild b/app-admin/rsyslog/rsyslog-8.9.0.ebuild
deleted file mode 100644
index eca7028..0000000
--- a/app-admin/rsyslog/rsyslog-8.9.0.ebuild
+++ /dev/null
@@ -1,409 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-AUTOTOOLS_AUTORECONF=1
-
-inherit autotools-utils eutils systemd
-
-DESCRIPTION="An enhanced multi-threaded syslogd with database support and more"
-HOMEPAGE="http://www.rsyslog.com/"
-
-BRANCH="8-stable"
-
-PATCHES=(
-	"${FILESDIR}"/${BRANCH}/10-respect_CFLAGS-r1.patch
-)
-
-if [[ ${PV} == "9999" ]]; then
-	EGIT_REPO_URI="
-		git://github.com/rsyslog/${PN}.git
-		https://github.com/rsyslog/${PN}.git
-	"
-
-	DOC_REPO_URI="
-		git://github.com/rsyslog/${PN}-doc.git
-		https://github.com/rsyslog/${PN}-doc.git
-	"
-
-	inherit git-r3
-else
-	SRC_URI="
-		http://www.rsyslog.com/files/download/${PN}/${P}.tar.gz
-		doc? ( http://www.rsyslog.com/files/download/${PN}/${PN}-doc-${PV}.tar.gz )
-	"
-	KEYWORDS="~amd64 ~arm ~hppa ~x86"
-fi
-
-LICENSE="GPL-3 LGPL-3 Apache-2.0"
-SLOT="0"
-IUSE="dbi debug doc elasticsearch +gcrypt jemalloc kerberos mongodb mysql normalize omudpspoof postgres rabbitmq redis relp rfc3195 rfc5424hmac snmp ssl systemd test usertools zeromq"
-
-RDEPEND="
-	>=dev-libs/json-c-0.11:=
-	>=dev-libs/libestr-0.1.9
-	>=dev-libs/liblogging-1.0.1:=[stdlog]
-	>=sys-libs/zlib-1.2.5
-	dbi? ( >=dev-db/libdbi-0.8.3 )
-	elasticsearch? ( >=net-misc/curl-7.35.0 )
-	gcrypt? ( >=dev-libs/libgcrypt-1.5.3:= )
-	jemalloc? ( >=dev-libs/jemalloc-3.3.1 )
-	kerberos? ( virtual/krb5 )
-	mongodb? ( >=dev-libs/libmongo-client-0.1.4 )
-	mysql? ( virtual/mysql )
-	normalize? (
-		>=dev-libs/libee-0.4.0
-		>=dev-libs/liblognorm-1.1.0:=
-	)
-	omudpspoof? ( >=net-libs/libnet-1.1.6 )
-	postgres? ( >=dev-db/postgresql-8.4.20:= )
-	rabbitmq? ( >=net-libs/rabbitmq-c-0.3.0 )
-	redis? ( >=dev-libs/hiredis-0.11.0 )
-	relp? ( >=dev-libs/librelp-1.2.5 )
-	rfc3195? ( >=dev-libs/liblogging-1.0.1:=[rfc3195] )
-	rfc5424hmac? ( >=dev-libs/openssl-0.9.8y:= )
-	snmp? ( >=net-analyzer/net-snmp-5.7.2 )
-	ssl? ( >=net-libs/gnutls-2.12.23 )
-	systemd? ( >=sys-apps/systemd-208 )
-	zeromq? ( >=net-libs/czmq-1.2.0 )"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-if [[ ${PV} == "9999" ]]; then
-	DEPEND+=" doc? ( >=dev-python/sphinx-1.1.3-r7 )"
-fi
-
-# Maitainer note : open a bug to upstream
-# showing that building in a separate dir fails
-AUTOTOOLS_IN_SOURCE_BUILD=1
-
-AUTOTOOLS_PRUNE_LIBTOOL_FILES="modules"
-
-DOCS=(
-	AUTHORS
-	ChangeLog
-	"${FILESDIR}"/${BRANCH}/README.gentoo
-)
-
-src_unpack() {
-	if [[ ${PV} == "9999" ]]; then
-		git-r3_fetch
-		git-r3_checkout
-	else
-		unpack ${P}.tar.gz
-	fi
-
-	if use doc; then
-		if [[ ${PV} == "9999" ]]; then
-			local _EGIT_BRANCH=
-			if [ -n "${EGIT_BRANCH}" ]; then
-				# Cannot use rsyslog commits/branches for documentation repository
-				_EGIT_BRANCH=${EGIT_BRANCH}
-				unset EGIT_BRANCH
-			fi
-
-			git-r3_fetch "${DOC_REPO_URI}"
-			git-r3_checkout "${DOC_REPO_URI}" "${S}"/docs
-
-			if [ -n "${_EGIT_BRANCH}" ]; then
-				# Restore previous EGIT_BRANCH information
-				EGIT_BRANCH=${_EGIT_BRANCH}
-			fi
-		else
-			local doc_tarball="${PN}-doc-${PV}.tar.gz"
-
-			cd "${S}" || die "Cannot change dir into '$S'"
-			mkdir docs || die "Failed to create docs directory"
-			cd docs || die "Failed to change dir into '${S}/docs'"
-			unpack ${doc_tarball}
-		fi
-	fi
-}
-
-src_configure() {
-	# Maintainer notes:
-	# * Guardtime support is missing because libgt isn't yet available
-	#   in portage.
-	# * Hadoop's HDFS file system output module is currently not
-	#   supported in Gentoo because nobody is able to test it
-	#   (JAVA dependency).
-	# * dev-libs/hiredis doesn't provide pkg-config (see #504614,
-	#   upstream PR 129 and 136) so we need to export HIREDIS_*
-	#   variables because rsyslog's build system depends on pkg-config.
-
-	if use redis; then
-		export HIREDIS_LIBS="-L${EPREFIX}/usr/$(get_libdir) -lhiredis"
-		export HIREDIS_CFLAGS="-I${EPREFIX}/usr/include"
-	fi
-
-	local myeconfargs=(
-		--disable-generate-man-pages
-		--without-valgrind-testbench
-		$(use_enable test testbench)
-		# Input Plugins without depedencies
-		--enable-imdiag
-		--enable-imfile
-		--enable-impstats
-		--enable-imptcp
-		# Message Modificiation Plugins without depedencies
-		--enable-mmanon
-		--enable-mmaudit
-		--enable-mmfields
-		--enable-mmjsonparse
-		--enable-mmpstrucdata
-		--enable-mmsequence
-		--enable-mmutf8fix
-		# Output Modification Plugins without dependencies
-		--enable-mail
-		--enable-omprog
-		--enable-omruleset
-		--enable-omstdout
-		--enable-omuxsock
-		# Misc
-		--enable-pmaixforwardedfrom
-		--enable-pmciscoios
-		--enable-pmcisconames
-		--enable-pmlastmsg
-		--enable-pmsnare
-		# DB
-		$(use_enable dbi libdbi)
-		$(use_enable mongodb ommongodb)
-		$(use_enable mysql)
-		$(use_enable postgres pgsql)
-		$(use_enable redis omhiredis)
-		# Debug
-		$(use_enable debug)
-		$(use_enable debug diagtools)
-		$(use_enable debug memcheck)
-		$(use_enable debug rtinst)
-		$(use_enable debug valgrind)
-		# Misc
-		$(use_enable elasticsearch)
-		$(use_enable gcrypt libgcrypt)
-		$(use_enable jemalloc)
-		$(use_enable kerberos gssapi-krb5)
-		$(use_enable normalize mmnormalize)
-		$(use_enable omudpspoof)
-		$(use_enable rabbitmq omrabbitmq)
-		$(use_enable relp)
-		$(use_enable rfc3195)
-		$(use_enable rfc5424hmac mmrfc5424addhmac)
-		$(use_enable snmp)
-		$(use_enable snmp mmsnmptrapd)
-		$(use_enable ssl gnutls)
-		$(use_enable systemd imjournal)
-		$(use_enable systemd omjournal)
-		$(use_enable usertools)
-		$(use_enable zeromq imzmq3)
-		$(use_enable zeromq omzmq3)
-		"$(systemd_with_unitdir)"
-	)
-
-	autotools-utils_src_configure
-}
-
-src_compile() {
-	autotools-utils_src_compile
-
-	if use doc && [[ "${PV}" == "9999" ]]; then
-		einfo "Building documentation ..."
-		local doc_dir="${S}/docs"
-		cd "${doc_dir}" || die "Cannot chdir into \"${doc_dir}\"!"
-		sphinx-build -b html source build || die "Building documentation failed!"
-	fi
-}
-
-src_test() {
-	local _has_increased_ulimit=
-
-	if ulimit -n 3072; then
-		_has_increased_ulimit="true"
-	fi
-
-	if ! emake --jobs 1 check; then
-		eerror "Test suite failed! :("
-
-		if [ -z "${_has_increased_ulimit}" ]; then
-			eerror "Probably because open file limit couldn't be set to 3072."
-		fi
-
-		if has userpriv $FEATURES; then
-			eerror "Please try to reproduce the test suite failure with FEATURES=-userpriv " \
-				"before you submit a bug report."
-		fi
-
-	fi
-}
-
-src_install() {
-	use doc && HTML_DOCS=( "${S}/docs/build/" )
-	autotools-utils_src_install
-
-	newconfd "${FILESDIR}/${BRANCH}/${PN}.confd" ${PN}
-	newinitd "${FILESDIR}/${BRANCH}/${PN}.initd" ${PN}
-
-	keepdir /var/empty/dev
-	keepdir /var/spool/${PN}
-	keepdir /etc/ssl/${PN}
-	keepdir /etc/${PN}.d
-
-	insinto /etc
-	newins "${FILESDIR}/${BRANCH}/${PN}.conf" ${PN}.conf
-
-	insinto /etc/rsyslog.d/
-	doins "${FILESDIR}/${BRANCH}/50-default.conf"
-
-	insinto /etc/logrotate.d/
-	newins "${FILESDIR}/${BRANCH}/${PN}.logrotate" ${PN}
-
-	if use mysql; then
-		insinto /usr/share/doc/${PF}/scripts/mysql
-		doins plugins/ommysql/createDB.sql
-	fi
-
-	if use postgres; then
-		insinto /usr/share/doc/${PF}/scripts/pgsql
-		doins plugins/ompgsql/createDB.sql
-	fi
-}
-
-pkg_postinst() {
-	local advertise_readme=0
-
-	if [[ -z "${REPLACING_VERSIONS}" ]]; then
-		# This is a new installation
-
-		advertise_readme=1
-
-		if use mysql || use postgres; then
-			echo
-			elog "Sample SQL scripts for MySQL & PostgreSQL have been installed to:"
-			elog "  /usr/share/doc/${PF}/scripts"
-		fi
-
-		if use ssl; then
-			echo
-			elog "To create a default CA and certificates for your server and clients, run:"
-			elog "  emerge --config =${PF}"
-			elog "on your logging server. You can run it several times,"
-			elog "once for each logging client. The client certificates will be signed"
-			elog "using the CA certificate generated during the first run."
-		fi
-	fi
-
-	if [[ -z "${REPLACING_VERSIONS}" ]] || [[ ${REPLACING_VERSIONS} < 8.0 ]]; then
-		# Show this message until rsyslog-8.x
-		echo
-		elog "Since ${PN}-7.6.3 we no longer use the catch-all log target"
-		elog "\"/var/log/syslog\" due to its redundancy to the other log targets."
-
-		advertise_readme=1
-	fi
-
-	if [[ ${advertise_readme} -gt 0 ]]; then
-		# We need to show the README file location
-
-		echo ""
-		elog "Please read"
-		elog ""
-		elog "  ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"
-		elog ""
-		elog "for more details."
-	fi
-}
-
-pkg_config() {
-	if ! use ssl ; then
-		einfo "There is nothing to configure for rsyslog unless you"
-		einfo "used USE=ssl to build it."
-		return 0
-	fi
-
-	# Make sure the certificates directory exists
-	CERTDIR="${EROOT}/etc/ssl/${PN}"
-	if [ ! -d "${CERTDIR}" ]; then
-		mkdir "${CERTDIR}" || die
-	fi
-	einfo "Your certificates will be stored in ${CERTDIR}"
-
-	# Create a default CA if needed
-	if [ ! -f "${CERTDIR}/${PN}_ca.cert.pem" ]; then
-		einfo "No CA key and certificate found in ${CERTDIR}, creating them for you..."
-		certtool --generate-privkey \
-			--outfile "${CERTDIR}/${PN}_ca.privkey.pem" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
-
-		cat > "${T}/${PF}.$$" <<- _EOF
-		cn = Portage automated CA
-		ca
-		cert_signing_key
-		expiration_days = 3650
-		_EOF
-
-		certtool --generate-self-signed \
-			--load-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
-			--outfile "${CERTDIR}/${PN}_ca.cert.pem" \
-			--template "${T}/${PF}.$$" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_ca.privkey.pem"
-
-		# Create the server certificate
-		echo
-		einfon "Please type the Common Name of the SERVER you wish to create a certificate for: "
-		read -r CN
-
-		einfo "Creating private key and certificate for server ${CN}..."
-		certtool --generate-privkey \
-			--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
-
-		cat > "${T}/${PF}.$$" <<- _EOF
-		cn = ${CN}
-		tls_www_server
-		dns_name = ${CN}
-		expiration_days = 3650
-		_EOF
-
-		certtool --generate-certificate \
-			--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
-			--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
-			--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
-			--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
-			--template "${T}/${PF}.$$" &>/dev/null
-		chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
-
-	else
-		einfo "Found existing ${CERTDIR}/${PN}_ca.cert.pem, skipping CA and SERVER creation."
-	fi
-
-	# Create a client certificate
-	echo
-	einfon "Please type the Common Name of the CLIENT you wish to create a certificate for: "
-	read -r CN
-
-	einfo "Creating private key and certificate for client ${CN}..."
-	certtool --generate-privkey \
-		--outfile "${CERTDIR}/${PN}_${CN}.key.pem" &>/dev/null
-	chmod 400 "${CERTDIR}/${PN}_${CN}.key.pem"
-
-	cat > "${T}/${PF}.$$" <<- _EOF
-	cn = ${CN}
-	tls_www_client
-	dns_name = ${CN}
-	expiration_days = 3650
-	_EOF
-
-	certtool --generate-certificate \
-		--outfile "${CERTDIR}/${PN}_${CN}.cert.pem" \
-		--load-privkey "${CERTDIR}/${PN}_${CN}.key.pem" \
-		--load-ca-certificate "${CERTDIR}/${PN}_ca.cert.pem" \
-		--load-ca-privkey "${CERTDIR}/${PN}_ca.privkey.pem" \
-		--template "${T}/${PF}.$$" &>/dev/null
-	chmod 400 "${CERTDIR}/${PN}_${CN}.cert.pem"
-
-	rm -f "${T}/${PF}.$$"
-
-	echo
-	einfo "Here is the documentation on how to encrypt your log traffic:"
-	einfo " http://www.rsyslog.com/doc/rsyslog_tls.html"
-}
diff --git a/app-admin/syslog-ng/syslog-ng-3.7.1.ebuild b/app-admin/syslog-ng/syslog-ng-3.7.1.ebuild
index 03f6fdf..0d80c99 100644
--- a/app-admin/syslog-ng/syslog-ng-3.7.1.ebuild
+++ b/app-admin/syslog-ng/syslog-ng-3.7.1.ebuild
@@ -30,7 +30,7 @@
 	systemd? ( sys-apps/systemd )
 	tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
 	dev-libs/libpcre
-	dev-libs/openssl:=
+	dev-libs/openssl:0=
 	>=dev-libs/eventlog-0.2.12
 	>=dev-libs/glib-2.10.1:2"
 DEPEND="${RDEPEND}
diff --git a/app-admin/webapp-config/webapp-config-1.54-r1.ebuild b/app-admin/webapp-config/webapp-config-1.54-r1.ebuild
index 67a609a..b3e5802 100644
--- a/app-admin/webapp-config/webapp-config-1.54-r1.ebuild
+++ b/app-admin/webapp-config/webapp-config-1.54-r1.ebuild
@@ -9,7 +9,7 @@
 inherit distutils-r1
 
 SRC_URI="https://dev.gentoo.org/~twitch153/${PN}/${P}.tar.bz2"
-KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
+KEYWORDS="~alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ~ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
 
 DESCRIPTION="Gentoo's installer for web-based applications"
 HOMEPAGE="http://sourceforge.net/projects/webapp-config/"
diff --git a/app-antivirus/clamav/clamav-0.98.7-r1.ebuild b/app-antivirus/clamav/clamav-0.98.7-r1.ebuild
new file mode 100644
index 0000000..565b0c5
--- /dev/null
+++ b/app-antivirus/clamav/clamav-0.98.7-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic user systemd
+
+DESCRIPTION="Clam Anti-Virus Scanner"
+HOMEPAGE="http://www.clamav.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+IUSE="bzip2 clamdtop iconv ipv6 libressl milter metadata-analysis-api selinux static-libs uclibc"
+
+CDEPEND="bzip2? ( app-arch/bzip2 )
+	clamdtop? ( sys-libs/ncurses:0 )
+	iconv? ( virtual/libiconv )
+	metadata-analysis-api? ( dev-libs/json-c )
+	milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) )
+	dev-libs/libtommath
+	>=sys-libs/zlib-1.2.2
+	!libressl? ( dev-libs/openssl:0 )
+	libressl? ( dev-libs/libressl )
+	sys-devel/libtool"
+# openssl is now *required* see this link as to why
+# http://blog.clamav.net/2014/02/introducing-openssl-as-dependency-to.html
+DEPEND="${CDEPEND}
+	virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-clamav )"
+
+DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE )
+
+pkg_setup() {
+	enewgroup clamav
+	enewuser clamav -1 -1 /dev/null clamav
+}
+
+src_prepare() {
+	use ppc64 && append-flags -mminimal-toc
+	use uclibc && export ac_cv_type_error_t=yes
+}
+
+src_configure() {
+	econf \
+		--disable-experimental \
+		--disable-fanotify \
+		--enable-id-check \
+		--with-dbdir="${EPREFIX}"/var/lib/clamav \
+		--with-system-tommath \
+		--with-zlib="${EPREFIX}"/usr \
+		$(use_enable bzip2) \
+		$(use_enable clamdtop) \
+		$(use_enable ipv6) \
+		$(use_enable milter) \
+		$(use_enable static-libs static) \
+		$(use_with iconv) \
+		$(use_with metadata-analysis-api libjson /usr)
+}
+
+src_install() {
+	default
+
+	rm -rf "${ED}"/var/lib/clamav
+	newinitd "${FILESDIR}"/clamd.initd-r6 clamd
+	newconfd "${FILESDIR}"/clamd.conf-r1 clamd
+
+	systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf"
+	systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service"
+	systemd_dounit "${FILESDIR}/clamd.service"
+	systemd_dounit "${FILESDIR}/freshclamd.service"
+
+	keepdir /var/lib/clamav
+	fowners clamav:clamav /var/lib/clamav
+	keepdir /var/log/clamav
+	fowners clamav:clamav /var/log/clamav
+
+	dodir /etc/logrotate.d
+	insinto /etc/logrotate.d
+	newins "${FILESDIR}"/clamav.logrotate clamav
+
+	# Modify /etc/{clamd,freshclam}.conf to be usable out of the box
+	sed -i -e "s:^\(Example\):\# \1:" \
+		-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \
+		-e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \
+		-e "s:.*\(User\) .*:\1 clamav:" \
+		-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \
+		-e "s:^\#\(LogTime\).*:\1 yes:" \
+		-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+		"${ED}"/etc/clamd.conf.sample || die
+	sed -i -e "s:^\(Example\):\# \1:" \
+		-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \
+		-e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \
+		-e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \
+		-e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \
+		-e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \
+		-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+		"${ED}"/etc/freshclam.conf.sample || die
+
+	if use milter ; then
+		# MilterSocket one to include ' /' because there is a 2nd line for
+		# inet: which we want to leave
+		dodoc "${FILESDIR}"/clamav-milter.README.gentoo
+		sed -i -e "s:^\(Example\):\# \1:" \
+			-e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \
+			-e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \
+			-e "s:.*\(User\) .*:\1 clamav:" \
+			-e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \
+			-e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \
+			-e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \
+			"${ED}"/etc/clamav-milter.conf.sample || die
+		cat >> "${ED}"/etc/conf.d/clamd <<-EOF
+			MILTER_NICELEVEL=19
+			START_MILTER=no
+		EOF
+
+		systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service
+	fi
+
+	for i in clamd freshclam clamav-milter
+	do
+		[[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,}
+	done
+
+	prune_libtool_files --all
+}
+
+pkg_postinst() {
+	if use milter ; then
+		elog "For simple instructions how to setup the clamav-milter read the"
+		elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}"
+	fi
+	if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then
+		ewarn "You must run freshclam manually to populate the virus database files"
+		ewarn "before starting clamav for the first time.\n"
+	fi
+}
diff --git a/app-antivirus/clamav/clamav-0.98.7.ebuild b/app-antivirus/clamav/clamav-0.98.7.ebuild
index 24cf61c..59e614e 100644
--- a/app-antivirus/clamav/clamav-0.98.7.ebuild
+++ b/app-antivirus/clamav/clamav-0.98.7.ebuild
@@ -12,7 +12,7 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm ~hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
 IUSE="bzip2 clamdtop iconv ipv6 milter metadata-analysis-api selinux static-libs uclibc"
 
 CDEPEND="bzip2? ( app-arch/bzip2 )
diff --git a/app-arch/gcab/gcab-0.6.ebuild b/app-arch/gcab/gcab-0.6.ebuild
index e7c076b..f697907 100644
--- a/app-arch/gcab/gcab-0.6.ebuild
+++ b/app-arch/gcab/gcab-0.6.ebuild
@@ -14,7 +14,7 @@
 
 LICENSE="LGPL-2.1+"
 SLOT="0"
-KEYWORDS="~alpha amd64 ~arm hppa ~ppc ppc64 ~sparc x86"
+KEYWORDS="~alpha amd64 arm hppa ~ppc ppc64 ~sparc x86"
 IUSE="+introspection vala"
 REQUIRED_USE="vala? ( introspection )"
 
diff --git a/app-arch/lzip/lzip-1.18_pre1.ebuild b/app-arch/lzip/lzip-1.18_pre1.ebuild
index e51ceeb..a0f348f 100644
--- a/app-arch/lzip/lzip-1.18_pre1.ebuild
+++ b/app-arch/lzip/lzip-1.18_pre1.ebuild
@@ -12,7 +12,7 @@
 
 LICENSE="GPL-2+"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
 
 S="${WORKDIR}/${P/_/-}"
 
diff --git a/app-arch/pbzip2/pbzip2-1.1.12.ebuild b/app-arch/pbzip2/pbzip2-1.1.12.ebuild
index 62dcbde..ec2d4db 100644
--- a/app-arch/pbzip2/pbzip2-1.1.12.ebuild
+++ b/app-arch/pbzip2/pbzip2-1.1.12.ebuild
@@ -12,7 +12,7 @@
 
 LICENSE="BZIP2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
 IUSE="static symlink"
 
 LIB_DEPEND="app-arch/bzip2[static-libs(+)]"
diff --git a/app-arch/snappy/metadata.xml b/app-arch/snappy/metadata.xml
index 6dd995a..6418fc0 100644
--- a/app-arch/snappy/metadata.xml
+++ b/app-arch/snappy/metadata.xml
@@ -1,15 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
+	<herd>proxy-maintainers</herd>
 	<maintainer>
-		<email>maintainer-needed@gentoo.org</email>
+		<email>brendan@horan.hk</email>
+		<name>Brendan Horan</name>
 	</maintainer>
 	<longdescription lang="en">Snappy is a compression/decompression library. It does not aim for
 		maximum compression, or compatibility with any other compression
 		library; instead, it aims for very high speeds and reasonable
 		compression.</longdescription>
 	<upstream>
-		<remote-id type="google-code">snappy</remote-id>
 		<remote-id type="github">google/snappy</remote-id>
 	</upstream>
 </pkgmetadata>
diff --git a/app-arch/snappy/snappy-1.1.3.ebuild b/app-arch/snappy/snappy-1.1.3.ebuild
index f1b28ce..89fab9f 100644
--- a/app-arch/snappy/snappy-1.1.3.ebuild
+++ b/app-arch/snappy/snappy-1.1.3.ebuild
@@ -12,7 +12,7 @@
 
 LICENSE="BSD"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux"
 IUSE="static-libs"
 
 src_prepare() {
diff --git a/app-arch/unrar/Manifest b/app-arch/unrar/Manifest
index 17e5795..86315bf 100644
--- a/app-arch/unrar/Manifest
+++ b/app-arch/unrar/Manifest
@@ -1,4 +1,4 @@
 DIST unrarsrc-5.1.6.tar.gz 215185 SHA256 3c38eaabc655527244fd0c3ba3beff567ea24aad37d448488643242fd4cf41a5 SHA512 a7a7800ac94850320ce3e2dd24c5005694dd59360b7f3fc7886ef241153e471459b0b9397d1dacbc3adcd19044cdcb8a8a847e16d7b224af149a1455f46fcaa0 WHIRLPOOL bcb9d1b60f42357cb236cbb5e86eb19dd4ed623244036fc1e8fc3759eef3d4002e6ffc90d3cf5b5200e81fe018a2215c0238ee2aac7148e51f130e43ad3e5ea0
 DIST unrarsrc-5.2.7.tar.gz 218880 SHA256 ef14757e943787b439fedf2c564c1f38d0db315528a928e0de170860717e2fac SHA512 95e06451e2bec46a12e5b9b1423c3ea31ce86859f8086812d9c442aaa69627f72635a6a8c197b30dbc7e99bbf7c7caaa25d703caecbe03c697cc0e5b7644d638 WHIRLPOOL 49f5492a7441192d96616f892012ca2dac8a94063e806ece3c62bf13d29beb9d2d0368a186c0f0bff8814c9e6af542ba6b447a61683295f560f120ff75507379
-DIST unrarsrc-5.3.2.tar.gz 221786 SHA256 2d8712eed32367b1a404633f230f94f545c1f2ce0552f851266b00c261a786ea SHA512 ea3ee5dd3c15a52f577896bca0d5136c9a6e76a5552d6f56be519eb59c2cc137aba0dafe53dfb50c768e8e7f2e1c1c067a3e4d0c67383da3ae1da58ed68fe99b WHIRLPOOL 07454ef4e00ad8982cd4658aa35a120d8318b3bc7979360abdb7973855e1d6e78cd28473cf4127aa7673b26c27c7e379e483017f0f29b49b6c65d08271326d05
 DIST unrarsrc-5.3.3.tar.gz 221930 SHA256 099c67a2fdb76e55386e4496d28cf6fd1ffd9ac394b95c46b73926c5f69bd107 SHA512 5dffa77043992b72dab10752c547c30d2ff884a18c8b19ddbbcd711e4a9f7f82020edfeb560bd10122c18296aaf08d27c7c1db4f6b62e3ec2a4cd0c449ec7d52 WHIRLPOOL 8be0c41a1ac81d9e9a16ce6b7cbc3479929ec65df8040a58a91c0c89d9b02a8ccde584e829e6ceea6ffa645939d68998f46627ba7df54942f76595cea8f26aaf
+DIST unrarsrc-5.3.6.tar.gz 223184 SHA256 b917f2c5258ff2012008f9aa46984ad22dce21702eb264623b256bb8c2577c1b SHA512 b596f69a7d1b5f6a1e3dc0f060018589dc415463c2a9f403a365e10f8e362c09de4d295df04939f2a33c8daf88de7fbe32395043b978636ea7eaa1c1d2ad80fc WHIRLPOOL 6016b9ead3c2ef573e28ff05809c56e8037c23c01ee05fca0ef46eccbcc7e673b5fa57a0a6839ac2670cce928234c290e82a21a83471818e9a56eeff7984fb3e
diff --git a/app-arch/unrar/unrar-5.3.2.ebuild b/app-arch/unrar/unrar-5.3.2.ebuild
deleted file mode 100644
index ba3f09c..0000000
--- a/app-arch/unrar/unrar-5.3.2.ebuild
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic multilib toolchain-funcs
-
-MY_PN=${PN}src
-
-DESCRIPTION="Uncompress rar files"
-HOMEPAGE="http://www.rarlab.com/rar_add.htm"
-SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz"
-
-LICENSE="unRAR"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
-IUSE=""
-
-RDEPEND="!<=app-arch/unrar-gpl-0.0.1_p20080417"
-
-S=${WORKDIR}/unrar
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-5.0.2-build.patch
-	epatch "${FILESDIR}"/${PN}-5.2.2-no-auto-clean.patch #528218
-	local sed_args=( -e "/libunrar/s:.so:$(get_libname ${PV%.*.*}):" )
-	if [[ ${CHOST} == *-darwin* ]] ; then
-		sed_args+=( -e "s:-shared:-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/libunrar$(get_libname ${PV%.*.*}):" )
-	else
-		sed_args+=( -e "s:-shared:& -Wl,-soname -Wl,libunrar$(get_libname ${PV%.*.*}):" )
-	fi
-	sed -i "${sed_args[@]}" makefile
-}
-
-src_configure() {
-	mkdir -p build-{lib,bin}
-	printf 'VPATH = ..\ninclude ../makefile' > build-lib/Makefile || die
-	cp build-{lib,bin}/Makefile || die
-}
-
-src_compile() {
-	unrar_make() {
-		emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" STRIP=true "$@"
-	}
-
-	unrar_make CXXFLAGS+=" -fPIC" -C build-lib lib
-	ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname)
-	ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname ${PV})
-
-	unrar_make -C build-bin
-}
-
-src_install() {
-	dobin build-bin/unrar
-	dodoc readme.txt
-
-	dolib.so build-lib/libunrar*
-
-	insinto /usr/include/libunrar${PV%.*.*}
-	doins *.hpp
-	dosym libunrar${PV%.*.*} /usr/include/libunrar
-}
diff --git a/app-arch/unrar/unrar-5.3.6.ebuild b/app-arch/unrar/unrar-5.3.6.ebuild
new file mode 100644
index 0000000..71373bb
--- /dev/null
+++ b/app-arch/unrar/unrar-5.3.6.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+MY_PN=${PN}src
+
+DESCRIPTION="Uncompress rar files"
+HOMEPAGE="http://www.rarlab.com/rar_add.htm"
+SRC_URI="http://www.rarlab.com/rar/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="unRAR"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="!<=app-arch/unrar-gpl-0.0.1_p20080417"
+
+S=${WORKDIR}/unrar
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-5.0.2-build.patch
+	epatch "${FILESDIR}"/${PN}-5.2.2-no-auto-clean.patch #528218
+	local sed_args=( -e "/libunrar/s:.so:$(get_libname ${PV%.*.*}):" )
+	if [[ ${CHOST} == *-darwin* ]] ; then
+		sed_args+=( -e "s:-shared:-dynamiclib -install_name ${EPREFIX}/usr/$(get_libdir)/libunrar$(get_libname ${PV%.*.*}):" )
+	else
+		sed_args+=( -e "s:-shared:& -Wl,-soname -Wl,libunrar$(get_libname ${PV%.*.*}):" )
+	fi
+	sed -i "${sed_args[@]}" makefile || die
+}
+
+src_configure() {
+	mkdir -p build-{lib,bin}
+	printf 'VPATH = ..\ninclude ../makefile' > build-lib/Makefile || die
+	cp build-{lib,bin}/Makefile || die
+}
+
+src_compile() {
+	unrar_make() {
+		emake CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" STRIP=true "$@"
+	}
+
+	unrar_make CXXFLAGS+=" -fPIC" -C build-lib lib
+	ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname) || die
+	ln -s libunrar$(get_libname ${PV%.*.*}) build-lib/libunrar$(get_libname ${PV}) || die
+
+	unrar_make -C build-bin
+}
+
+src_install() {
+	dobin build-bin/unrar
+	dodoc readme.txt
+
+	dolib.so build-lib/libunrar*
+
+	insinto /usr/include/libunrar${PV%.*.*}
+	doins *.hpp
+	dosym libunrar${PV%.*.*} /usr/include/libunrar
+}
diff --git a/app-backup/rsnapshot/Manifest b/app-backup/rsnapshot/Manifest
index a4fd0d2..ee003b7 100644
--- a/app-backup/rsnapshot/Manifest
+++ b/app-backup/rsnapshot/Manifest
@@ -1 +1,2 @@
 DIST rsnapshot-1.3.1.tar.gz 215806 SHA256 94b6c77e40628935f42a191bdc28ad93b1f132fde456ee76ee87763f1eddc75e SHA512 a74ad0a21d213dd2e05cb577a47c491af90d8994df8f5a154195515345da438ac9c0d72b563aa02314883a0b3bb86e3c23f8b530a7078c2b55a9547a2d666c10 WHIRLPOOL 1d62658e11cbd2612b223336b5e3dbb44d1ec0b40a434bf8f65c09ff7b45c831f585046f8ef4e2ff79f034de8731435ccd2554e0d5ff4e2d1693a01b66113b00
+DIST rsnapshot-1.4.1.tar.gz 489481 SHA256 fb4a1129a7d3805c41749fd0494debfe2ca2341eba0f8b50e4f54985efe448e8 SHA512 a99e639bd706aafac82d2a4a40fc6c7fa026321c527ad5826a4fc7917cadea5962c4c7988c98efbe06833ef70db081605aa47a6d77c04dcf6077cc232c078cbf WHIRLPOOL 999979b7d438c336203298a4bce2d49fb7e6166428356d0d3ee93369244856970faa496528a673df44ab21c5ce6fa694d83df9fe45075d62436c24fb97f7a435
diff --git a/app-backup/rsnapshot/metadata.xml b/app-backup/rsnapshot/metadata.xml
index b856273..feced77 100644
--- a/app-backup/rsnapshot/metadata.xml
+++ b/app-backup/rsnapshot/metadata.xml
@@ -3,12 +3,8 @@
 <pkgmetadata>
   <herd>proxy-maintainers</herd>
   <maintainer>
-    <email>flameeyes@gentoo.org</email>
-    <name>Diego Elio Pettenò</name>
-  </maintainer>
-  <maintainer>
-    <email>erik_hahn@gmx.de</email>
-    <name>Erik Hahn</name>
+    <email>Sergiy.Borodych@gmail.com</email>
+    <name> Sergiy Borodych</name>
     <description>proxied maintainer</description>
   </maintainer>
 </pkgmetadata>
diff --git a/app-backup/rsnapshot/rsnapshot-1.3.1-r1.ebuild b/app-backup/rsnapshot/rsnapshot-1.3.1-r1.ebuild
deleted file mode 100644
index 06f52b1..0000000
--- a/app-backup/rsnapshot/rsnapshot-1.3.1-r1.ebuild
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=4
-
-inherit eutils
-
-DESCRIPTION="A filesystem backup utility based on rsync"
-HOMEPAGE="http://www.rsnapshot.org"
-SRC_URI="http://www.rsnapshot.org/downloads/${P}.tar.gz"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="alpha amd64 ppc ppc64 sparc x86"
-IUSE=""
-
-RDEPEND=">=dev-lang/perl-5.8.2
-		>=sys-apps/util-linux-2.12-r4
-		>=sys-apps/coreutils-5.0.91-r4
-		>=net-misc/openssh-3.7.1_p2-r1
-		>=net-misc/rsync-2.6.0"
-DEPEND="${RDEPEND}"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-cp_al.patch
-}
-
-src_install() {
-	# Change sysconfdir to install the template file as documentation
-	# rather than in /etc.
-	emake install DESTDIR="${D}" \
-		sysconfdir="/usr/share/doc/${PF}" \
-		|| die
-
-	dodoc README AUTHORS TODO ChangeLog \
-		docs/Upgrading_from_1.1 \
-		docs/HOWTOs/rsnapshot-{Mac,windows}-howto
-
-	docinto utils
-	dodoc utils/{README,rsnaptar,*.sh,*.pl}
-
-	docinto utils/rsnapshotdb
-	dodoc utils/rsnapshotdb/*
-}
-
-pkg_postinst() {
-	elog "The template configuration file has been installed as"
-	elog "/usr/share/doc/${PF}/rsnapshot.conf.default"
-	elog "Copy and edit the the above file as /etc/rsnapshot.conf"
-}
diff --git a/app-backup/rsnapshot/rsnapshot-1.3.1.ebuild b/app-backup/rsnapshot/rsnapshot-1.3.1.ebuild
deleted file mode 100644
index 423661e..0000000
--- a/app-backup/rsnapshot/rsnapshot-1.3.1.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-inherit eutils
-
-DESCRIPTION="A filesystem backup utility based on rsync"
-HOMEPAGE="http://www.rsnapshot.org"
-SRC_URI="http://www.rsnapshot.org/downloads/${P}.tar.gz"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="alpha amd64 ppc ppc64 sparc x86"
-IUSE=""
-
-RDEPEND=">=dev-lang/perl-5.8.2
-		>=sys-apps/util-linux-2.12-r4
-		>=sys-apps/coreutils-5.0.91-r4
-		>=net-misc/openssh-3.7.1_p2-r1
-		>=net-misc/rsync-2.6.0"
-
-src_unpack() {
-	unpack ${A}
-	epatch "${FILESDIR}"/${P}-cp_al.patch
-}
-
-src_compile() {
-	econf --prefix=/usr --sysconfdir=/etc || die
-	emake || die "emake failed"
-}
-
-src_install() {
-	make install DESTDIR="${D}" || die "make install failed"
-
-	dodoc INSTALL README AUTHORS TODO ChangeLog docs/*
-	insinto /usr/share/doc/${PF}/HOWTOs
-	doins docs/HOWTOs/*
-	docinto utils
-	dodoc utils/{README,rsnaptar,*.sh}
-	docinto utils/rsnapshotdb
-	dodoc utils/rsnapshotdb/*
-}
-
-pkg_postinst() {
-	elog
-	elog "The configuration file: /etc/rsnapshot.conf.default "
-	elog "  has been installed. "
-	elog "This is a template. "
-	elog "Copy, or move, the above file to: /etc/rsnapshot.conf "
-	elog "Note that upgrading will update the template, not real config. "
-	elog
-}
diff --git a/app-backup/rsnapshot/rsnapshot-1.4.1.ebuild b/app-backup/rsnapshot/rsnapshot-1.4.1.ebuild
new file mode 100644
index 0000000..009a331
--- /dev/null
+++ b/app-backup/rsnapshot/rsnapshot-1.4.1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A filesystem backup utility based on rsync"
+HOMEPAGE="http://www.rsnapshot.org"
+SRC_URI="http://www.rsnapshot.org/downloads/${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
+
+RDEPEND=">=dev-lang/perl-5.8.2
+		dev-perl/Lchown
+		>=sys-apps/util-linux-2.12-r4
+		>=sys-apps/coreutils-5.0.91-r4
+		>=net-misc/openssh-3.7.1_p2-r1
+		>=net-misc/rsync-2.6.0"
+DEPEND="${RDEPEND}"
+
+src_install() {
+	# Change sysconfdir to install the template file as documentation
+	# rather than in /etc.
+	emake install DESTDIR="${D}" \
+		sysconfdir="${EPREFIX}/usr/share/doc/${PF}"
+
+	dodoc README.md AUTHORS ChangeLog \
+		docs/Upgrading_from_1.1
+
+	docinto utils
+	dodoc utils/{README,rsnaptar,*.sh,*.pl}
+
+	docinto utils/rsnapshotdb
+	dodoc utils/rsnapshotdb/*
+}
+
+pkg_postinst() {
+	elog "The template configuration file has been installed as"
+	elog "/usr/share/doc/${PF}/rsnapshot.conf.default"
+	elog "Copy and edit the the above file as /etc/rsnapshot.conf"
+}
diff --git a/app-cdr/bashburn/bashburn-3.1.0.ebuild b/app-cdr/bashburn/bashburn-3.1.0.ebuild
index 4e9c800..8903968 100644
--- a/app-cdr/bashburn/bashburn-3.1.0.ebuild
+++ b/app-cdr/bashburn/bashburn-3.1.0.ebuild
@@ -32,7 +32,7 @@
 
 src_prepare() {
 	# Fix for "warning: jobserver unavailable: using -j1."
-	sed -i -e 's:make -C:$(MAKE) -C:' Makefile || die
+	sed -i -e 's:make -C:$(MAKE) -C:' Makefile || die
 }
 
 src_install() {
diff --git a/app-crypt/gcr/gcr-3.16.0.ebuild b/app-crypt/gcr/gcr-3.16.0.ebuild
index 17aeeb9..f1f3b4a 100644
--- a/app-crypt/gcr/gcr-3.16.0.ebuild
+++ b/app-crypt/gcr/gcr-3.16.0.ebuild
@@ -16,7 +16,7 @@
 SLOT="0/1" # subslot = suffix of libgcr-3
 IUSE="debug gtk +introspection vala"
 REQUIRED_USE="vala? ( introspection )"
-KEYWORDS="alpha amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ppc64 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 ~ia64 ~mips ~ppc ppc64 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~sparc-solaris ~x86-solaris"
 
 COMMON_DEPEND="
 	>=app-crypt/gnupg-2
diff --git a/app-crypt/gnupg/Manifest b/app-crypt/gnupg/Manifest
index 672fa82..cc2ac11 100644
--- a/app-crypt/gnupg/Manifest
+++ b/app-crypt/gnupg/Manifest
@@ -3,6 +3,5 @@
 DIST gnupg-2.0.27.tar.bz2 4424679 SHA256 57646d3e4b919fa1e5c8f1c0cf5fe1215333041c493a5ebc4b8f2978dbe930f2 SHA512 b05e75f5ef9881df9472818743c175cfe3254088086f36dc0fcf3d34e61f648f1775d90d404f6c622561df5066d972aadbf99ea8ec1290e5d7f7310f4ef2989e WHIRLPOOL abb353b20655002a0957e38d2b889fb5e6a47ba7b7546e1c70fc1f97cf42deeca8f2b061678983f3a160210f4eaf7529441246df1f9f1d875f5cc090456fdfb7
 DIST gnupg-2.0.28.tar.bz2 4435779 SHA256 ce092ee4ab58fd19b9fb34a460c07b06c348f4360dd5dd4886d041eb521a534c SHA512 7e786fe0648d5ea453f9c7524fec4bd7d5eec26d28f723acf3cb2f7ec9c400c339f0926a179411876c3f8e08b06942dcec643dc930caf58239bbd4932f4bd3c1 WHIRLPOOL ccf7427e54a545914e89677618055a114b4c9dc4db48669a2fc726fced98475df4ed27c93bd180f1250d147111ee663c736cdf4e1d8afdc40ed967cdffd0eb66
 DIST gnupg-2.0.29.tar.bz2 4416251 SHA256 68ed6b386ba78425b05a60e8ee22785ff0fef190bdc6f1c612f19a58819d4ac9 SHA512 23b452c740ab5c1e1e37337ae0583dd3b15df58a5bb5639c0c2aef1fb603e0a7d90a257ac99b0d9dfb68b81fa061c0c64e0bfd256c00d64e2f432192f5052f37 WHIRLPOOL f3d59a9453b4a65c726788c35b065ffc9cde0b746705080cd3491c73439786d791da29cf8f5bf1e5594a0e39cfaec214e346fe18ec3acf0b425dc396aa189f33
-DIST gnupg-2.1.6.tar.bz2 4917722 SHA256 5e599ad542199f3bd733eed2b88a539d1b4c3beda2dbab0ff69f1896f52e92fd SHA512 ae8aafe770336c83badf5610fe37f4ddc488786e3604780627893b636161d8407f3fd782538799e2b2a02e31c97468464372017fa52b5d9ed1bd31c85d9b3763 WHIRLPOOL 2136c526242a4e741c0cbc9aec102ba634234efd679d62db9aae3b2ab8fe9f8ad9b8fdb7d1f2d43982e6a072d5f5072d0744d8bb434d61f49ff24e868c902f80
-DIST gnupg-2.1.7.tar.bz2 4918583 SHA256 c18a3776d47fec98892d51d28b6574ef16bf0a25eabb0956231058aaf2e7846e SHA512 7c3efb9bd5d1509a9b2a6264293542b3d5db979bf443754f96d77322a96e18cba2ac6142665459d161eb7222fae44ce5b89eff88dca1c7abf47449fcafd3eb00 WHIRLPOOL da7ef3a02b186736c8d105ca627d2c889781465ecfdb4c4861f8af748a7d68a7c05a106c73bdfe44e7037807deb822c231d615cc1e1fcdd9b01e7632945ac094
 DIST gnupg-2.1.8.tar.bz2 4900705 SHA256 a3b8d01e4690715d42e8f289493c85413766f3fa935e4fe7e5ff5b0f6e2781a3 SHA512 80176fda032c921d3716fba3d3a264f9951464fd578a9d8d60673585efef17e20eec4d026921ab7ab2d7bd4dbf0a2b94a33a58c07acb747eebcb758e42bafd57 WHIRLPOOL 32e2e959363529cfd9ca857f823970b6cdd6497a72515aa9e75c2a680c83acea55a38d8de19b16c7327f92c0ab326e76a37952014b317afe2689c211c0d1965b
+DIST gnupg-2.1.9.tar.bz2 4925167 SHA256 1cb7633a57190beb66f9249cb7446603229b273d4d89331b75c652fa4a29f7b6 SHA512 c19b8cac42b7060caada230b77f36a0b0ed0a05efd519818c5b4057ef0fcb16602f2f3ade2409de2ef353a9e2acc3e5fa106a4449c6929a36a599a82194c0ee0 WHIRLPOOL 105b83e82330a00084a0e9f3d96c8788ac2c9e7831beea0ea42786df4e378dc9e8f2c1a31f12af9c53d363aa71810cd231afdf8f20eab424fea5f59b103033a9
diff --git a/app-crypt/gnupg/gnupg-2.0.28.ebuild b/app-crypt/gnupg/gnupg-2.0.28.ebuild
index 54433c7..fe1e949 100644
--- a/app-crypt/gnupg/gnupg-2.0.28.ebuild
+++ b/app-crypt/gnupg/gnupg-2.0.28.ebuild
@@ -13,7 +13,7 @@
 
 LICENSE="GPL-3"
 SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
 IUSE="bzip2 doc ldap nls mta readline static selinux smartcard tools usb"
 
 COMMON_DEPEND_LIBS="
diff --git a/app-crypt/gnupg/gnupg-2.1.6.ebuild b/app-crypt/gnupg/gnupg-2.1.6.ebuild
deleted file mode 100644
index 2f40259..0000000
--- a/app-crypt/gnupg/gnupg-2.1.6.ebuild
+++ /dev/null
@@ -1,170 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic toolchain-funcs
-
-DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
-HOMEPAGE="http://www.gnupg.org/"
-MY_P="${P/_/-}"
-SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
-IUSE="bzip2 doc +gnutls ldap nls readline static selinux smartcard tools usb"
-
-COMMON_DEPEND_LIBS="
-	dev-libs/npth
-	>=dev-libs/libassuan-2
-	>=dev-libs/libgcrypt-1.6.2
-	>=dev-libs/libgpg-error-1.17
-	>=dev-libs/libksba-1.0.7
-	>=net-misc/curl-7.10
-	gnutls? ( >=net-libs/gnutls-3.0 )
-	sys-libs/zlib
-	ldap? ( net-nds/openldap )
-	bzip2? ( app-arch/bzip2 )
-	readline? ( sys-libs/readline:= )
-	smartcard? ( usb? ( virtual/libusb:0 ) )
-	"
-COMMON_DEPEND_BINS="app-crypt/pinentry
-		   !app-crypt/dirmngr"
-
-# Existence of executables is checked during configuration.
-DEPEND="${COMMON_DEPEND_LIBS}
-	${COMMON_DEPEND_BINS}
-	static? (
-		>=dev-libs/libassuan-2[static-libs]
-		>=dev-libs/libgcrypt-1.6.2[static-libs]
-		>=dev-libs/libgpg-error-1.17[static-libs]
-		>=dev-libs/libksba-1.0.7[static-libs]
-		dev-libs/npth[static-libs]
-		>=net-misc/curl-7.10[static-libs]
-		sys-libs/zlib[static-libs]
-		bzip2? ( app-arch/bzip2[static-libs] )
-	)
-	nls? ( sys-devel/gettext )
-	doc? ( sys-apps/texinfo )"
-
-RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
-	${COMMON_DEPEND_BINS}
-	selinux? ( sec-policy/selinux-gpg )
-	nls? ( virtual/libintl )"
-
-REQUIRED_USE="smartcard? ( !static )"
-
-S="${WORKDIR}/${MY_P}"
-
-src_prepare() {
-	epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# 'USE=static' support was requested:
-	# gnupg1: bug #29299
-	# gnupg2: bug #159623
-	use static && append-ldflags -static
-
-	if use smartcard; then
-		myconf+=(
-			--enable-scdaemon
-			$(use_enable usb ccid-driver)
-		)
-	else
-		myconf+=( --disable-scdaemon )
-	fi
-
-	if use elibc_SunOS || use elibc_AIX; then
-		myconf+=( --disable-symcryptrun )
-	else
-		myconf+=( --enable-symcryptrun )
-	fi
-
-	# glib fails and picks up clang's internal stdint.h causing weird errors
-	[[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
-
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
-		--enable-gpg \
-		--enable-gpgsm \
-		--enable-large-secmem \
-		--without-adns \
-		"${myconf[@]}" \
-		$(use_enable bzip2) \
-		$(use_enable gnutls) \
-		$(use_with ldap) \
-		$(use_enable nls) \
-		$(use_with readline) \
-		CC_FOR_BUILD="$(tc-getBUILD_CC)"
-}
-
-src_compile() {
-	default
-
-	if use doc; then
-		cd doc
-		emake html
-	fi
-}
-
-src_install() {
-	default
-
-	use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
-		tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
-
-	emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
-	rm "${ED}"/usr/share/gnupg/help* || die
-
-	dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
-		doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
-
-	dosym gpg2 /usr/bin/gpg
-	dosym gpgv2 /usr/bin/gpgv
-	echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
-	echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
-
-	dodir /etc/env.d
-	echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
-
-	if use doc; then
-		dohtml doc/gnupg.html/* doc/*.png
-	fi
-}
-
-pkg_postinst() {
-	elog "If you wish to view images emerge:"
-	elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
-	elog "Remember to use photo-viewer option in configuration file to activate"
-	elog "the right viewer."
-	elog
-
-	if use smartcard; then
-		elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
-		use usb && elog " - a CCID-compatible reader, used directly through libusb;"
-		elog " - sys-apps/pcsc-lite and a compatible reader device;"
-		elog " - dev-libs/openct and a compatible reader device;"
-		elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
-		elog ""
-		elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
-		elog "app-crypt/ccid first."
-	fi
-
-	ewarn "Please remember to restart gpg-agent if a different version"
-	ewarn "of the agent is currently used. If you are unsure of the gpg"
-	ewarn "agent you are using please run 'killall gpg-agent',"
-	ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
-
-	if [[ -n ${REPLACING_VERSIONS} ]]; then
-		elog "If upgrading from a version prior than 2.1 you might have to re-import"
-		elog "secret keys after restarting the gpg-agent as the new version is using"
-		elog "a new storage mechanism."
-		elog "You can migrate the keys using gpg --import \$HOME/.gnupg/secring.gpg"
-	fi
-}
diff --git a/app-crypt/gnupg/gnupg-2.1.7-r1.ebuild b/app-crypt/gnupg/gnupg-2.1.7-r1.ebuild
deleted file mode 100644
index a296661..0000000
--- a/app-crypt/gnupg/gnupg-2.1.7-r1.ebuild
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic toolchain-funcs
-
-DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
-HOMEPAGE="http://www.gnupg.org/"
-MY_P="${P/_/-}"
-SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
-IUSE="bzip2 doc +gnutls ldap nls readline static selinux smartcard tools usb"
-
-COMMON_DEPEND_LIBS="
-	dev-libs/npth
-	>=dev-libs/libassuan-2
-	>=dev-libs/libgcrypt-1.6.2[threads]
-	>=dev-libs/libgpg-error-1.17
-	>=dev-libs/libksba-1.0.7
-	>=net-misc/curl-7.10
-	gnutls? ( >=net-libs/gnutls-3.0 )
-	sys-libs/zlib
-	ldap? ( net-nds/openldap )
-	bzip2? ( app-arch/bzip2 )
-	readline? ( sys-libs/readline:= )
-	smartcard? ( usb? ( virtual/libusb:0 ) )
-	"
-COMMON_DEPEND_BINS="app-crypt/pinentry
-		   !app-crypt/dirmngr"
-
-# Existence of executables is checked during configuration.
-DEPEND="${COMMON_DEPEND_LIBS}
-	${COMMON_DEPEND_BINS}
-	static? (
-		>=dev-libs/libassuan-2[static-libs]
-		>=dev-libs/libgcrypt-1.6.2[static-libs]
-		>=dev-libs/libgpg-error-1.17[static-libs]
-		>=dev-libs/libksba-1.0.7[static-libs]
-		dev-libs/npth[static-libs]
-		>=net-misc/curl-7.10[static-libs]
-		sys-libs/zlib[static-libs]
-		bzip2? ( app-arch/bzip2[static-libs] )
-	)
-	nls? ( sys-devel/gettext )
-	doc? ( sys-apps/texinfo )"
-
-RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
-	${COMMON_DEPEND_BINS}
-	selinux? ( sec-policy/selinux-gpg )
-	nls? ( virtual/libintl )"
-
-REQUIRED_USE="smartcard? ( !static )"
-
-S="${WORKDIR}/${MY_P}"
-
-src_prepare() {
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# 'USE=static' support was requested:
-	# gnupg1: bug #29299
-	# gnupg2: bug #159623
-	use static && append-ldflags -static
-
-	if use smartcard; then
-		myconf+=(
-			--enable-scdaemon
-			$(use_enable usb ccid-driver)
-		)
-	else
-		myconf+=( --disable-scdaemon )
-	fi
-
-	if use elibc_SunOS || use elibc_AIX; then
-		myconf+=( --disable-symcryptrun )
-	else
-		myconf+=( --enable-symcryptrun )
-	fi
-
-	# glib fails and picks up clang's internal stdint.h causing weird errors
-	[[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
-
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
-		--enable-gpg \
-		--enable-gpgsm \
-		--enable-large-secmem \
-		--without-adns \
-		"${myconf[@]}" \
-		$(use_enable bzip2) \
-		$(use_enable gnutls) \
-		$(use_with ldap) \
-		$(use_enable nls) \
-		$(use_with readline) \
-		CC_FOR_BUILD="$(tc-getBUILD_CC)"
-}
-
-src_compile() {
-	default
-
-	if use doc; then
-		cd doc
-		emake html
-	fi
-}
-
-src_install() {
-	default
-
-	use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
-		tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
-
-	emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
-	rm "${ED}"/usr/share/gnupg/help* || die
-
-	dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
-		doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
-
-	dosym gpg2 /usr/bin/gpg
-	dosym gpgv2 /usr/bin/gpgv
-	echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
-	echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
-
-	dodir /etc/env.d
-	echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
-
-	if use doc; then
-		dohtml doc/gnupg.html/* doc/*.png
-	fi
-}
-
-pkg_postinst() {
-	elog "If you wish to view images emerge:"
-	elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
-	elog "Remember to use photo-viewer option in configuration file to activate"
-	elog "the right viewer."
-	elog
-
-	if use smartcard; then
-		elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
-		use usb && elog " - a CCID-compatible reader, used directly through libusb;"
-		elog " - sys-apps/pcsc-lite and a compatible reader device;"
-		elog " - dev-libs/openct and a compatible reader device;"
-		elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
-		elog ""
-		elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
-		elog "app-crypt/ccid first."
-	fi
-
-	ewarn "Please remember to restart gpg-agent if a different version"
-	ewarn "of the agent is currently used. If you are unsure of the gpg"
-	ewarn "agent you are using please run 'killall gpg-agent',"
-	ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
-
-	if [[ -n ${REPLACING_VERSIONS} ]]; then
-		elog "If upgrading from a version prior than 2.1 you might have to re-import"
-		elog "secret keys after restarting the gpg-agent as the new version is using"
-		elog "a new storage mechanism."
-		elog "You can migrate the keys using gpg --import \$HOME/.gnupg/secring.gpg"
-	fi
-}
diff --git a/app-crypt/gnupg/gnupg-2.1.7.ebuild b/app-crypt/gnupg/gnupg-2.1.7.ebuild
deleted file mode 100644
index 3cb5b58..0000000
--- a/app-crypt/gnupg/gnupg-2.1.7.ebuild
+++ /dev/null
@@ -1,169 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-
-inherit eutils flag-o-matic toolchain-funcs
-
-DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
-HOMEPAGE="http://www.gnupg.org/"
-MY_P="${P/_/-}"
-SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
-IUSE="bzip2 doc +gnutls ldap nls readline static selinux smartcard tools usb"
-
-COMMON_DEPEND_LIBS="
-	dev-libs/npth
-	>=dev-libs/libassuan-2
-	>=dev-libs/libgcrypt-1.6.2
-	>=dev-libs/libgpg-error-1.17
-	>=dev-libs/libksba-1.0.7
-	>=net-misc/curl-7.10
-	gnutls? ( >=net-libs/gnutls-3.0 )
-	sys-libs/zlib
-	ldap? ( net-nds/openldap )
-	bzip2? ( app-arch/bzip2 )
-	readline? ( sys-libs/readline:= )
-	smartcard? ( usb? ( virtual/libusb:0 ) )
-	"
-COMMON_DEPEND_BINS="app-crypt/pinentry
-		   !app-crypt/dirmngr"
-
-# Existence of executables is checked during configuration.
-DEPEND="${COMMON_DEPEND_LIBS}
-	${COMMON_DEPEND_BINS}
-	static? (
-		>=dev-libs/libassuan-2[static-libs]
-		>=dev-libs/libgcrypt-1.6.2[static-libs]
-		>=dev-libs/libgpg-error-1.17[static-libs]
-		>=dev-libs/libksba-1.0.7[static-libs]
-		dev-libs/npth[static-libs]
-		>=net-misc/curl-7.10[static-libs]
-		sys-libs/zlib[static-libs]
-		bzip2? ( app-arch/bzip2[static-libs] )
-	)
-	nls? ( sys-devel/gettext )
-	doc? ( sys-apps/texinfo )"
-
-RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
-	${COMMON_DEPEND_BINS}
-	selinux? ( sec-policy/selinux-gpg )
-	nls? ( virtual/libintl )"
-
-REQUIRED_USE="smartcard? ( !static )"
-
-S="${WORKDIR}/${MY_P}"
-
-src_prepare() {
-	epatch_user
-}
-
-src_configure() {
-	local myconf=()
-
-	# 'USE=static' support was requested:
-	# gnupg1: bug #29299
-	# gnupg2: bug #159623
-	use static && append-ldflags -static
-
-	if use smartcard; then
-		myconf+=(
-			--enable-scdaemon
-			$(use_enable usb ccid-driver)
-		)
-	else
-		myconf+=( --disable-scdaemon )
-	fi
-
-	if use elibc_SunOS || use elibc_AIX; then
-		myconf+=( --disable-symcryptrun )
-	else
-		myconf+=( --enable-symcryptrun )
-	fi
-
-	# glib fails and picks up clang's internal stdint.h causing weird errors
-	[[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
-
-	econf \
-		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
-		--enable-gpg \
-		--enable-gpgsm \
-		--enable-large-secmem \
-		--without-adns \
-		"${myconf[@]}" \
-		$(use_enable bzip2) \
-		$(use_enable gnutls) \
-		$(use_with ldap) \
-		$(use_enable nls) \
-		$(use_with readline) \
-		CC_FOR_BUILD="$(tc-getBUILD_CC)"
-}
-
-src_compile() {
-	default
-
-	if use doc; then
-		cd doc
-		emake html
-	fi
-}
-
-src_install() {
-	default
-
-	use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
-		tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
-
-	emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
-	rm "${ED}"/usr/share/gnupg/help* || die
-
-	dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
-		doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
-
-	dosym gpg2 /usr/bin/gpg
-	dosym gpgv2 /usr/bin/gpgv
-	echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
-	echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
-
-	dodir /etc/env.d
-	echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
-
-	if use doc; then
-		dohtml doc/gnupg.html/* doc/*.png
-	fi
-}
-
-pkg_postinst() {
-	elog "If you wish to view images emerge:"
-	elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
-	elog "Remember to use photo-viewer option in configuration file to activate"
-	elog "the right viewer."
-	elog
-
-	if use smartcard; then
-		elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
-		use usb && elog " - a CCID-compatible reader, used directly through libusb;"
-		elog " - sys-apps/pcsc-lite and a compatible reader device;"
-		elog " - dev-libs/openct and a compatible reader device;"
-		elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
-		elog ""
-		elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
-		elog "app-crypt/ccid first."
-	fi
-
-	ewarn "Please remember to restart gpg-agent if a different version"
-	ewarn "of the agent is currently used. If you are unsure of the gpg"
-	ewarn "agent you are using please run 'killall gpg-agent',"
-	ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
-
-	if [[ -n ${REPLACING_VERSIONS} ]]; then
-		elog "If upgrading from a version prior than 2.1 you might have to re-import"
-		elog "secret keys after restarting the gpg-agent as the new version is using"
-		elog "a new storage mechanism."
-		elog "You can migrate the keys using gpg --import \$HOME/.gnupg/secring.gpg"
-	fi
-}
diff --git a/app-crypt/gnupg/gnupg-2.1.8.ebuild b/app-crypt/gnupg/gnupg-2.1.8.ebuild
index a296661..4e192a1 100644
--- a/app-crypt/gnupg/gnupg-2.1.8.ebuild
+++ b/app-crypt/gnupg/gnupg-2.1.8.ebuild
@@ -13,7 +13,7 @@
 
 LICENSE="GPL-3"
 SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
 IUSE="bzip2 doc +gnutls ldap nls readline static selinux smartcard tools usb"
 
 COMMON_DEPEND_LIBS="
diff --git a/app-crypt/gnupg/gnupg-2.1.9.ebuild b/app-crypt/gnupg/gnupg-2.1.9.ebuild
new file mode 100644
index 0000000..4e192a1
--- /dev/null
+++ b/app-crypt/gnupg/gnupg-2.1.9.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation"
+HOMEPAGE="http://www.gnupg.org/"
+MY_P="${P/_/-}"
+SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="bzip2 doc +gnutls ldap nls readline static selinux smartcard tools usb"
+
+COMMON_DEPEND_LIBS="
+	dev-libs/npth
+	>=dev-libs/libassuan-2
+	>=dev-libs/libgcrypt-1.6.2[threads]
+	>=dev-libs/libgpg-error-1.17
+	>=dev-libs/libksba-1.0.7
+	>=net-misc/curl-7.10
+	gnutls? ( >=net-libs/gnutls-3.0 )
+	sys-libs/zlib
+	ldap? ( net-nds/openldap )
+	bzip2? ( app-arch/bzip2 )
+	readline? ( sys-libs/readline:= )
+	smartcard? ( usb? ( virtual/libusb:0 ) )
+	"
+COMMON_DEPEND_BINS="app-crypt/pinentry
+		   !app-crypt/dirmngr"
+
+# Existence of executables is checked during configuration.
+DEPEND="${COMMON_DEPEND_LIBS}
+	${COMMON_DEPEND_BINS}
+	static? (
+		>=dev-libs/libassuan-2[static-libs]
+		>=dev-libs/libgcrypt-1.6.2[static-libs]
+		>=dev-libs/libgpg-error-1.17[static-libs]
+		>=dev-libs/libksba-1.0.7[static-libs]
+		dev-libs/npth[static-libs]
+		>=net-misc/curl-7.10[static-libs]
+		sys-libs/zlib[static-libs]
+		bzip2? ( app-arch/bzip2[static-libs] )
+	)
+	nls? ( sys-devel/gettext )
+	doc? ( sys-apps/texinfo )"
+
+RDEPEND="!static? ( ${COMMON_DEPEND_LIBS} )
+	${COMMON_DEPEND_BINS}
+	selinux? ( sec-policy/selinux-gpg )
+	nls? ( virtual/libintl )"
+
+REQUIRED_USE="smartcard? ( !static )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+	epatch_user
+}
+
+src_configure() {
+	local myconf=()
+
+	# 'USE=static' support was requested:
+	# gnupg1: bug #29299
+	# gnupg2: bug #159623
+	use static && append-ldflags -static
+
+	if use smartcard; then
+		myconf+=(
+			--enable-scdaemon
+			$(use_enable usb ccid-driver)
+		)
+	else
+		myconf+=( --disable-scdaemon )
+	fi
+
+	if use elibc_SunOS || use elibc_AIX; then
+		myconf+=( --disable-symcryptrun )
+	else
+		myconf+=( --enable-symcryptrun )
+	fi
+
+	# glib fails and picks up clang's internal stdint.h causing weird errors
+	[[ ${CC} == clang ]] && export gl_cv_absolute_stdint_h=/usr/include/stdint.h
+
+	econf \
+		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
+		--enable-gpg \
+		--enable-gpgsm \
+		--enable-large-secmem \
+		--without-adns \
+		"${myconf[@]}" \
+		$(use_enable bzip2) \
+		$(use_enable gnutls) \
+		$(use_with ldap) \
+		$(use_enable nls) \
+		$(use_with readline) \
+		CC_FOR_BUILD="$(tc-getBUILD_CC)"
+}
+
+src_compile() {
+	default
+
+	if use doc; then
+		cd doc
+		emake html
+	fi
+}
+
+src_install() {
+	default
+
+	use tools && dobin tools/{convert-from-106,gpg-check-pattern} \
+		tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys,make-dns-cert}
+
+	emake DESTDIR="${D}" -f doc/Makefile uninstall-nobase_dist_docDATA
+	rm "${ED}"/usr/share/gnupg/help* || die
+
+	dodoc ChangeLog NEWS README THANKS TODO VERSION doc/FAQ doc/DETAILS \
+		doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER doc/help*
+
+	dosym gpg2 /usr/bin/gpg
+	dosym gpgv2 /usr/bin/gpgv
+	echo ".so man1/gpg2.1" > "${ED}"/usr/share/man/man1/gpg.1
+	echo ".so man1/gpgv2.1" > "${ED}"/usr/share/man/man1/gpgv.1
+
+	dodir /etc/env.d
+	echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg
+
+	if use doc; then
+		dohtml doc/gnupg.html/* doc/*.png
+	fi
+}
+
+pkg_postinst() {
+	elog "If you wish to view images emerge:"
+	elog "media-gfx/xloadimage, media-gfx/xli or any other viewer"
+	elog "Remember to use photo-viewer option in configuration file to activate"
+	elog "the right viewer."
+	elog
+
+	if use smartcard; then
+		elog "To use your OpenPGP smartcard (or token) with GnuPG you need one of"
+		use usb && elog " - a CCID-compatible reader, used directly through libusb;"
+		elog " - sys-apps/pcsc-lite and a compatible reader device;"
+		elog " - dev-libs/openct and a compatible reader device;"
+		elog " - a reader device and drivers exporting either PC/SC or CT-API interfaces."
+		elog ""
+		elog "General hint: you probably want to try installing sys-apps/pcsc-lite and"
+		elog "app-crypt/ccid first."
+	fi
+
+	ewarn "Please remember to restart gpg-agent if a different version"
+	ewarn "of the agent is currently used. If you are unsure of the gpg"
+	ewarn "agent you are using please run 'killall gpg-agent',"
+	ewarn "and to start a fresh daemon just run 'gpg-agent --daemon'."
+
+	if [[ -n ${REPLACING_VERSIONS} ]]; then
+		elog "If upgrading from a version prior than 2.1 you might have to re-import"
+		elog "secret keys after restarting the gpg-agent as the new version is using"
+		elog "a new storage mechanism."
+		elog "You can migrate the keys using gpg --import \$HOME/.gnupg/secring.gpg"
+	fi
+}
diff --git a/app-crypt/keybase/Manifest b/app-crypt/keybase/Manifest
index 905946d..8c6b127 100644
--- a/app-crypt/keybase/Manifest
+++ b/app-crypt/keybase/Manifest
@@ -1,5 +1,3 @@
-DIST keybase-0.8.10.tar.gz 7055453 SHA256 ce9a22427d40341059071737ace2dacbe0a81e29e783ec2c8324e2704c1f558f SHA512 4701a0c8d88ffc90fa68f24ef4695f7c7b63ec91a41ccc1bf9d25efb182befc0750e1f9f5ec185161d65bdcbaeb3a73ab8f54f7047ab9d1efdca55b5f56957f0 WHIRLPOOL dd6d53154164ac235b89947530f7af4ed9fdc1421c26b2cef92e1721e2dcdf63e43fff054718c58c6a519f24f1766969a0e740f97d9eb17472d1ef8174e1851f
-DIST keybase-0.8.12.tar.gz 7057638 SHA256 fa6a8eb6f857d98d4d0f5c97862ba99480b0dd2c85fccd631180c0ab8f3ca97f SHA512 e8c568e0154308d3f0172a5e9b22de31c8a9b07d3a4f324a4afec57972602a3bd957220a96427eefa5df563ce0152495f5c33668536e03f3d6af9344c2061397 WHIRLPOOL e4a2431c05add26645f4ec3f2062a81d38c39ad9f9d6357f62009292f60fe072d67547d6c0a39470c130165bb9491fc7cb17cfe91a3fc1be75ad7a6377da9dad
 DIST keybase-0.8.13.tar.gz 7057750 SHA256 a485257b7302d848be41e9c0a79f7b1c0da4c8ceaee70c0cc011838cbd723fd8 SHA512 8a082ff9d61f960a0c4862fba04adf323005b3c70e6d208a38a001716bcc374e10cde315eced6730d90316466244e58a9de0f78a66ab2f9bd91326979f0ef28b WHIRLPOOL b651a48be0ced301991edd03d40182c0b900ea28e2b97630a3ad741b34266dbd95c3d370db636ca8088ce5e781a2cf609255a6b52a5b6bdbfa540b879cdcd778
 DIST keybase-0.8.18.tar.gz 7062931 SHA256 c1ef27f959401164e72fbcd5c4054d13258a3f09dcdebb0ac3c447519780d59e SHA512 2d2c019cdf0e1fef496d709f7bf17c0d30d614e017a88b54d2a2198aafcd9ad436a636e1f1de27ac98df9e3ca90432b3cc3ff0b83fbb59d7e3a9acdef589d940 WHIRLPOOL 0d80b47fa8da500ee4886f95c9bfa55f392e4988db887fa8f2fd332c185a6e1be082ed7b2fce01f98ea4fd064f27b3159cf04e19d1ee2ec985d222606f48059a
-DIST keybase-0.8.9.tar.gz 7055307 SHA256 2feb54d26afc639f4d4998fbc35aafa2100a9926a6ec4f84343ca56d0284a3dd SHA512 431b3314cf939605a56f163b67226c9027a83159aae7f6b9226a4b5ccf63ecd3f79a873cbb9ab2756d83df2191823b70f884327f160187c00f6a6954b8ca144a WHIRLPOOL 4de64969a1e8898b19903cce391ca599af09b4f3dee6bf2b6bf10fcb39d8b6f939d5aa0320a5efe4b3aaf78217c6b6d7c16f09321af3ed115b6985194a0f0c0e
+DIST keybase-0.8.22.tar.gz 7101414 SHA256 4290251ddf7d1f124211731aa8d0dd47f43ba9e1eb9b0b0f326d7986a3f87cb7 SHA512 ed75fc7fa5f97701c6a9e5880a113bdf392f21b1bdfaa63b7070231e10608d755304300b6b5208b2bc363869ffb631e2261df89747ba9b654bc98a420a0511cb WHIRLPOOL e13a4451bdf5962122b54c95d8d35d4570e0475f6012bb5126ff5ec2f48767048600da4f89f9d0ec6b70523b54262c52f5e29d7b766a83c38723ee25ce5acaab
diff --git a/app-crypt/keybase/keybase-0.8.10.ebuild b/app-crypt/keybase/keybase-0.8.10.ebuild
deleted file mode 100644
index 644ff73..0000000
--- a/app-crypt/keybase/keybase-0.8.10.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit eutils
-
-DESCRIPTION="Client for keybase.io"
-HOMEPAGE="https://keybase.io/"
-SRC_URI="https://github.com/keybase/node-client/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-RDEPEND="
-	net-libs/nodejs
-	app-crypt/gnupg"
-
-src_unpack() {
-	unpack "${P}.tar.gz"
-	mv "node-client-${PV}" "${P}"
-}
-
-src_install() {
-	dodoc CHANGELOG.md README.md SIGNED.md
-	insinto "/opt/${PN}"
-	doins -r package.json bin certs json lib node_modules sql
-	dosym "${D}/opt/${PN}/bin/main.js" "${ROOT}/usr/bin/keybase"
-	chmod 0755 "${D}/opt/${PN}/bin/main.js" || die
-}
diff --git a/app-crypt/keybase/keybase-0.8.12.ebuild b/app-crypt/keybase/keybase-0.8.22.ebuild
similarity index 100%
rename from app-crypt/keybase/keybase-0.8.12.ebuild
rename to app-crypt/keybase/keybase-0.8.22.ebuild
diff --git a/app-crypt/keybase/keybase-0.8.9.ebuild b/app-crypt/keybase/keybase-0.8.9.ebuild
deleted file mode 100644
index 644ff73..0000000
--- a/app-crypt/keybase/keybase-0.8.9.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit eutils
-
-DESCRIPTION="Client for keybase.io"
-HOMEPAGE="https://keybase.io/"
-SRC_URI="https://github.com/keybase/node-client/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-RDEPEND="
-	net-libs/nodejs
-	app-crypt/gnupg"
-
-src_unpack() {
-	unpack "${P}.tar.gz"
-	mv "node-client-${PV}" "${P}"
-}
-
-src_install() {
-	dodoc CHANGELOG.md README.md SIGNED.md
-	insinto "/opt/${PN}"
-	doins -r package.json bin certs json lib node_modules sql
-	dosym "${D}/opt/${PN}/bin/main.js" "${ROOT}/usr/bin/keybase"
-	chmod 0755 "${D}/opt/${PN}/bin/main.js" || die
-}
diff --git a/app-crypt/libsecret/libsecret-0.18.3.ebuild b/app-crypt/libsecret/libsecret-0.18.3.ebuild
index 9090414..7ed7be3 100644
--- a/app-crypt/libsecret/libsecret-0.18.3.ebuild
+++ b/app-crypt/libsecret/libsecret-0.18.3.ebuild
@@ -16,7 +16,7 @@
 SLOT="0"
 IUSE="+crypt debug +introspection test vala"
 REQUIRED_USE="vala? ( introspection )"
-KEYWORDS="alpha amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-fbsd"
+KEYWORDS="alpha amd64 arm ~arm64 ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-fbsd"
 
 RDEPEND="
 	>=dev-libs/glib-2.38:2
diff --git a/app-crypt/libykneomgr/Manifest b/app-crypt/libykneomgr/Manifest
index 847dd4f..329d29d 100644
--- a/app-crypt/libykneomgr/Manifest
+++ b/app-crypt/libykneomgr/Manifest
@@ -1,2 +1,3 @@
 DIST libykneomgr-0.1.6.tar.gz 633881 SHA256 7c0ddf2b5397e2d335da5d727c55d0be6a9ab43263c60edcac1ffe45b526ca95 SHA512 deb8deafa3c748bb888309d9d2d62f3657cd6d9d103ceee738abbc47a8e4466535e9641f104f5628657ec8924306b8d9d0a90cd2485dd5ad46dd2d8ee932fab4 WHIRLPOOL 3c9f1c53e411633b74b56eb991155a3ffbe2453a336b10b00a3e69a55f4c30b4df4ddfb50a7252ea058a76211d0683d029428bb24c839586b0277bde7297c582
 DIST libykneomgr-0.1.7.tar.gz 625509 SHA256 dcce20274976e29b63380633928e1e75e05544430fca37082465c9075ea29f5a SHA512 b97d0de0050a4dea55963403a8710fe94dbef05041ec4fc42c4f2e7fc7ebd64b94aeb8d8c0231ad7828840efff28e6bd5b392b25d6bcafbeaab469a6e52e5163 WHIRLPOOL 6af69069963859580fa03fd41e794d01895aaaefae3b87ae8a60575dfb82648eea5efb5970ac95608112969a174dbd75a7a2c8dade4c8ebffbed866ca6506fb6
+DIST libykneomgr-0.1.8.tar.gz 626257 SHA256 2749ef299a1772818e63c0ff5276f18f1694f9de2137176a087902403e5df889 SHA512 536db3a81b74d24e727cc09c5bb898723b602e6c55e249745ced59d5f9416673fdbecd80bb7ebc7031be349092c8fb4f5623c8f6972ab870ec1f50ac1bc2f795 WHIRLPOOL 8b3b6304910e0a50fe54c658fe6fa00e86e4add41a966cc0a5941410e5fa6bfba2219f86f102c1cfa170165880c9b80dd599591f45e06d61607505f8cc5b752c
diff --git a/app-crypt/libykneomgr/libykneomgr-0.1.8.ebuild b/app-crypt/libykneomgr/libykneomgr-0.1.8.ebuild
new file mode 100644
index 0000000..e6ffd1d
--- /dev/null
+++ b/app-crypt/libykneomgr/libykneomgr-0.1.8.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools-utils udev
+
+DESCRIPTION="YubiKey NEO CCID Manager C Library"
+HOMEPAGE="https://developers.yubico.com/libykneomgr/"
+SRC_URI="https://developers.yubico.com/${PN}/Releases/${P}.tar.gz"
+
+LICENSE="LGPL-3"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="kernel_linux"
+
+RDEPEND="sys-apps/pcsc-lite
+	dev-libs/libzip"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+RDEPEND="${RDEPEND}
+	>=app-crypt/ccid-1.4.18[usb]"
+
+src_configure() {
+	local myeconfargs=(
+		--with-backend=pcsc
+		--disable-static
+	)
+
+	autotools-utils_src_configure
+}
diff --git a/app-crypt/mit-krb5/mit-krb5-1.13.2-r1.ebuild b/app-crypt/mit-krb5/mit-krb5-1.13.2-r1.ebuild
new file mode 100644
index 0000000..3b425e7
--- /dev/null
+++ b/app-crypt/mit-krb5/mit-krb5-1.13.2-r1.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils flag-o-matic multilib-minimal python-any-r1 versionator
+
+MY_P="${P/mit-}"
+P_DIR=$(get_version_component_range 1-2)
+DESCRIPTION="MIT Kerberos V"
+HOMEPAGE="http://web.mit.edu/kerberos/www/"
+SRC_URI="http://web.mit.edu/kerberos/dist/krb5/${P_DIR}/${MY_P}-signed.tar"
+
+LICENSE="openafs-krb5-a BSD MIT OPENLDAP BSD-2 HPND BSD-4 ISC RSA CC-BY-SA-3.0 || ( BSD-2 GPL-2+ )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="doc +keyutils libressl openldap +pkinit selinux +threads test xinetd"
+
+CDEPEND="
+	!!app-crypt/heimdal
+	>=sys-libs/e2fsprogs-libs-1.42.9[${MULTILIB_USEDEP}]
+	|| (
+		>=dev-libs/libverto-0.2.5[libev,${MULTILIB_USEDEP}]
+		>=dev-libs/libverto-0.2.5[libevent,${MULTILIB_USEDEP}]
+		>=dev-libs/libverto-0.2.5[tevent,${MULTILIB_USEDEP}]
+	)
+	keyutils? ( >=sys-apps/keyutils-1.5.8[${MULTILIB_USEDEP}] )
+	openldap? ( >=net-nds/openldap-2.4.38-r1[${MULTILIB_USEDEP}] )
+	pkinit? (
+		!libressl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
+		libressl? ( dev-libs/libressl[${MULTILIB_USEDEP}] )
+	)
+	xinetd? ( sys-apps/xinetd )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140508-r1
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+	)"
+DEPEND="${CDEPEND}
+	${PYTHON_DEPS}
+	virtual/yacc
+	doc? ( virtual/latex-base )
+	test? (
+		${PYTHON_DEPS}
+		dev-lang/tcl:0
+		dev-util/dejagnu
+	)"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-kerberos )"
+
+S=${WORKDIR}/${MY_P}/src
+
+MULTILIB_CHOST_TOOLS=(
+	/usr/bin/krb5-config
+)
+
+src_unpack() {
+	unpack ${A}
+	unpack ./"${MY_P}".tar.gz
+}
+
+src_prepare() {
+	epatch "${FILESDIR}/${PN}-1.12_warn_cflags.patch"
+	epatch "${FILESDIR}/${PN}-config_LDFLAGS.patch"
+
+	eautoreconf
+}
+
+src_configure() {
+	append-cppflags "-I${EPREFIX}/usr/include/et"
+	# QA
+	append-flags -fno-strict-aliasing
+	append-flags -fno-strict-overflow
+
+	multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+	use keyutils || export ac_cv_header_keyutils_h=no
+	ECONF_SOURCE=${S} \
+	WARN_CFLAGS="set" \
+	econf \
+		$(use_with openldap ldap) \
+		"$(multilib_native_use_with test tcl "${EPREFIX}/usr")" \
+		$(use_enable pkinit) \
+		$(use_enable threads thread-support) \
+		--without-hesiod \
+		--enable-shared \
+		--with-system-et \
+		--with-system-ss \
+		--enable-dns-for-realm \
+		--enable-kdc-lookaside-cache \
+		--with-system-verto \
+		--disable-rpath
+}
+
+multilib_src_compile() {
+	emake -j1
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && emake -j1 check
+}
+
+multilib_src_install() {
+	emake \
+		DESTDIR="${D}" \
+		EXAMPLEDIR="${EPREFIX}/usr/share/doc/${PF}/examples" \
+		install
+}
+
+multilib_src_install_all() {
+	# default database dir
+	keepdir /var/lib/krb5kdc
+
+	cd ..
+	dodoc README
+
+	if use doc; then
+		dohtml -r doc/html/*
+		docinto pdf
+		dodoc doc/pdf/*.pdf
+	fi
+
+	newinitd "${FILESDIR}"/mit-krb5kadmind.initd-r1 mit-krb5kadmind
+	newinitd "${FILESDIR}"/mit-krb5kdc.initd-r1 mit-krb5kdc
+	newinitd "${FILESDIR}"/mit-krb5kpropd.initd-r1 mit-krb5kpropd
+
+	insinto /etc
+	newins "${ED}/usr/share/doc/${PF}/examples/krb5.conf" krb5.conf.example
+	insinto /var/lib/krb5kdc
+	newins "${ED}/usr/share/doc/${PF}/examples/kdc.conf" kdc.conf.example
+
+	if use openldap ; then
+		insinto /etc/openldap/schema
+		doins "${S}/plugins/kdb/ldap/libkdb_ldap/kerberos.schema"
+	fi
+
+	if use xinetd ; then
+		insinto /etc/xinetd.d
+		newins "${FILESDIR}/kpropd.xinetd" kpropd
+	fi
+}
+
+pkg_preinst() {
+	if has_version "<${CATEGORY}/${PN}-1.8.0" ; then
+		elog "MIT split the Kerberos applications from the base Kerberos"
+		elog "distribution.  Kerberized versions of telnet, rlogin, rsh, rcp,"
+		elog "ftp clients and telnet, ftp deamons now live in"
+		elog "\"app-crypt/mit-krb5-appl\" package."
+	fi
+}
diff --git a/app-crypt/pinentry/pinentry-0.9.5.ebuild b/app-crypt/pinentry/pinentry-0.9.5.ebuild
index 9027df6..2dff58e 100644
--- a/app-crypt/pinentry/pinentry-0.9.5.ebuild
+++ b/app-crypt/pinentry/pinentry-0.9.5.ebuild
@@ -12,7 +12,7 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
 IUSE="clipboard emacs gtk ncurses qt4 caps gnome-keyring static"
 
 RDEPEND="
diff --git a/app-crypt/qca/Manifest b/app-crypt/qca/Manifest
index 627c06d..e2549c9 100644
--- a/app-crypt/qca/Manifest
+++ b/app-crypt/qca/Manifest
@@ -1,2 +1,3 @@
 DIST qca-2.0.3.tar.bz2 4530731 SHA256 8da20c89f390954fdcfcd3c4deef379213ddb5ae9d6b5e0c917d23f5e474895f SHA512 c1120ffb373e294fbcc76e21dc2f503ebd3398b26d0ffa7ab7ee3a3e1a4228159358b59c2673ac4a1c2363771e61da54a5080b201c65d586ceda2e3b2facc1bb WHIRLPOOL 2efba46098490ab5a75dcdf95eeb7d81a5509a962403a44602caa126927ebe9e69cb043586dbaebf0b111b79e614b607ae851242d12af9fa17d2dd191e559b0e
+DIST qca-2.1.1.tar.xz 688460 SHA256 95de3e7910b5f9ec7084169989c9d98bfb527e6a4865fe17269c3b24308be983 SHA512 f077b5a4cc6539e0880f4d0a615bebcf851f634e99c6c355522598204f625e5195e0cbc8a1976593669018e57eff95796c8fef69b1301b42cb18736bc8aa1abf WHIRLPOOL 454751a76f5e59aa09d6cc979bc26a490b23a2e5308f663400f45f38a95e6ad7a34428cffb1a2a82ec6958aa0b4418e0054503a58b43e0c172201cbaa7c669f8
 DIST qca-qt5-2.1.0.3.tar.xz 685652 SHA256 ab0170696a8ff87588d38a72d36d0b4b42db9080c991d1a40ceb3f8311d289f9 SHA512 2f50c92d3ff927c83353b65ae56ff49a5c1ea439fcef94cea0092b718f04abcc18f455abd91337ac786fddedae980ff55c9d090b5743a96890174dc7eee4f3f1 WHIRLPOOL 9db2770b031dbf5c9c117d4150e0b395c94d8a0af1bda9fac5e1ee862a8a40f1c03fb0c4901e3aaba0b12e8c0b4e71cb55a872bbc54eea8331aff3fbe1fd853c
diff --git a/app-crypt/qca/qca-2.1.0.3-r2.ebuild b/app-crypt/qca/qca-2.1.0.3-r2.ebuild
new file mode 100644
index 0000000..df34a8e
--- /dev/null
+++ b/app-crypt/qca/qca-2.1.0.3-r2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multibuild qmake-utils
+
+MY_PN="${PN}-qt5"
+
+DESCRIPTION="Qt Cryptographic Architecture (QCA)"
+HOMEPAGE="http://delta.affinix.com/qca/"
+SRC_URI="mirror://kde/stable/${MY_PN}/${PV}/src/${MY_PN}-${PV}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
+
+IUSE="botan debug doc examples gcrypt gpg libressl logger nss +openssl pkcs11 +qt4 qt5 sasl softstore test"
+REQUIRED_USE="|| ( qt4 qt5 )"
+
+RDEPEND="
+	!app-crypt/qca-cyrus-sasl
+	!app-crypt/qca-gnupg
+	!app-crypt/qca-logger
+	!app-crypt/qca-ossl
+	!app-crypt/qca-pkcs11
+	botan? ( dev-libs/botan )
+	gcrypt? ( dev-libs/libgcrypt:= )
+	gpg? ( app-crypt/gnupg )
+	nss? ( dev-libs/nss )
+	openssl? (
+		!libressl? ( >=dev-libs/openssl-1.0.1:0 )
+		libressl? ( dev-libs/libressl )
+	)
+	pkcs11? (
+		!libressl? ( dev-libs/openssl:0 )
+		libressl? ( dev-libs/libressl )
+		dev-libs/pkcs11-helper
+	)
+	qt4? ( dev-qt/qtcore:4 )
+	qt5? (
+		dev-qt/qtcore:5
+		dev-qt/qtconcurrent:5
+		dev-qt/qtnetwork:5
+	)
+	sasl? ( dev-libs/cyrus-sasl:2 )
+"
+DEPEND="${RDEPEND}
+	doc? ( app-doc/doxygen )
+	test? (
+		qt4? ( dev-qt/qttest:4 )
+		qt5? ( dev-qt/qttest:5 )
+	)
+"
+
+S=${WORKDIR}/${MY_PN}-${PV}
+
+DOCS=( README TODO )
+
+PATCHES=(
+	"${FILESDIR}/${PN}-disable-pgp-test.patch"
+	"${FILESDIR}/${P}-qt55.patch"
+	"${FILESDIR}/${P}-fix-signals-slots.patch"
+)
+
+qca_plugin_use() {
+	echo -DWITH_${2:-$1}_PLUGIN=$(usex "$1")
+}
+
+pkg_setup() {
+	MULTIBUILD_VARIANTS=( $(usev qt4) $(usev qt5) )
+}
+
+src_configure() {
+	myconfigure() {
+		local mycmakeargs=(
+			-DQCA_FEATURE_INSTALL_DIR="${EPREFIX}$(${MULTIBUILD_VARIANT}_get_mkspecsdir)/features"
+			-DQCA_PLUGINS_INSTALL_DIR="${EPREFIX}$(${MULTIBUILD_VARIANT}_get_plugindir)"
+			$(qca_plugin_use botan)
+			$(qca_plugin_use gcrypt)
+			$(qca_plugin_use gpg gnupg)
+			$(qca_plugin_use logger)
+			$(qca_plugin_use nss)
+			$(qca_plugin_use openssl ossl)
+			$(qca_plugin_use pkcs11)
+			$(qca_plugin_use sasl cyrus-sasl)
+			$(qca_plugin_use softstore)
+			$(cmake-utils_use_build test TESTS)
+		)
+
+		if [[ ${MULTIBUILD_VARIANT} == qt4 ]]; then
+			mycmakeargs+=(-DQT4_BUILD=ON)
+		fi
+
+		cmake-utils_src_configure
+	}
+
+	multibuild_foreach_variant myconfigure
+}
+
+src_compile() {
+	multibuild_foreach_variant cmake-utils_src_compile
+}
+
+src_test() {
+	mytest() {
+		local -x QCA_PLUGIN_PATH="${BUILD_DIR}/lib/qca"
+		cmake-utils_src_test
+	}
+
+	multibuild_foreach_variant mytest
+}
+
+src_install() {
+	multibuild_foreach_variant cmake-utils_src_install
+
+	if use doc; then
+		pushd "${BUILD_DIR}" >/dev/null || die
+		doxygen Doxyfile.in || die
+		dodoc -r apidocs/html
+		popd >/dev/null || die
+	fi
+
+	if use examples; then
+		dodoc -r "${S}"/examples
+	fi
+}
diff --git a/app-crypt/qca/qca-2.1.1.ebuild b/app-crypt/qca/qca-2.1.1.ebuild
new file mode 100644
index 0000000..a4f34f1
--- /dev/null
+++ b/app-crypt/qca/qca-2.1.1.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit cmake-utils multibuild qmake-utils
+
+DESCRIPTION="Qt Cryptographic Architecture (QCA)"
+HOMEPAGE="http://delta.affinix.com/qca/"
+SRC_URI="mirror://kde/stable/${PN}/${PV}/src/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
+
+IUSE="botan debug doc examples gcrypt gpg libressl logger nss +openssl pkcs11 +qt4 qt5 sasl softstore test"
+REQUIRED_USE="|| ( qt4 qt5 )"
+
+RDEPEND="
+	!app-crypt/qca-cyrus-sasl
+	!app-crypt/qca-gnupg
+	!app-crypt/qca-logger
+	!app-crypt/qca-ossl
+	!app-crypt/qca-pkcs11
+	botan? ( dev-libs/botan )
+	gcrypt? ( dev-libs/libgcrypt:= )
+	gpg? ( app-crypt/gnupg )
+	nss? ( dev-libs/nss )
+	openssl? (
+		!libressl? ( >=dev-libs/openssl-1.0.1:0 )
+		libressl? ( dev-libs/libressl )
+	)
+	pkcs11? (
+		!libressl? ( dev-libs/openssl:0 )
+		libressl? ( dev-libs/libressl )
+		dev-libs/pkcs11-helper
+	)
+	qt4? ( dev-qt/qtcore:4 )
+	qt5? (
+		dev-qt/qtcore:5
+		dev-qt/qtconcurrent:5
+		dev-qt/qtnetwork:5
+	)
+	sasl? ( dev-libs/cyrus-sasl:2 )
+"
+DEPEND="${RDEPEND}
+	doc? ( app-doc/doxygen )
+	test? (
+		qt4? ( dev-qt/qttest:4 )
+		qt5? ( dev-qt/qttest:5 )
+	)
+"
+
+DOCS=( README TODO )
+
+PATCHES=(
+	"${FILESDIR}/${PN}-disable-pgp-test.patch"
+)
+
+qca_plugin_use() {
+	echo -DWITH_${2:-$1}_PLUGIN=$(usex "$1")
+}
+
+pkg_setup() {
+	MULTIBUILD_VARIANTS=( $(usev qt4) $(usev qt5) )
+}
+
+src_configure() {
+	myconfigure() {
+		local mycmakeargs=(
+			-DQCA_FEATURE_INSTALL_DIR="${EPREFIX}$(${MULTIBUILD_VARIANT}_get_mkspecsdir)/features"
+			-DQCA_PLUGINS_INSTALL_DIR="${EPREFIX}$(${MULTIBUILD_VARIANT}_get_plugindir)"
+			$(qca_plugin_use botan)
+			$(qca_plugin_use gcrypt)
+			$(qca_plugin_use gpg gnupg)
+			$(qca_plugin_use logger)
+			$(qca_plugin_use nss)
+			$(qca_plugin_use openssl ossl)
+			$(qca_plugin_use pkcs11)
+			$(qca_plugin_use sasl cyrus-sasl)
+			$(qca_plugin_use softstore)
+			$(cmake-utils_use_build test TESTS)
+		)
+
+		if [[ ${MULTIBUILD_VARIANT} == qt4 ]]; then
+			mycmakeargs+=(-DQT4_BUILD=ON)
+		fi
+
+		cmake-utils_src_configure
+	}
+
+	multibuild_foreach_variant myconfigure
+}
+
+src_compile() {
+	multibuild_foreach_variant cmake-utils_src_compile
+}
+
+src_test() {
+	mytest() {
+		local -x QCA_PLUGIN_PATH="${BUILD_DIR}/lib/qca"
+		cmake-utils_src_test
+	}
+
+	multibuild_foreach_variant mytest
+}
+
+src_install() {
+	multibuild_foreach_variant cmake-utils_src_install
+
+	if use doc; then
+		pushd "${BUILD_DIR}" >/dev/null || die
+		doxygen Doxyfile.in || die
+		dodoc -r apidocs/html
+		popd >/dev/null || die
+	fi
+
+	if use examples; then
+		dodoc -r "${S}"/examples
+	fi
+}
diff --git a/app-crypt/sign/metadata.xml b/app-crypt/sign/metadata.xml
index 22b9e39..d27c6c5 100644
--- a/app-crypt/sign/metadata.xml
+++ b/app-crypt/sign/metadata.xml
@@ -6,11 +6,6 @@
 	<name>Alice Ferrazzi</name>
 	<description>Assign bugs to me.</description>
 </maintainer>
-<maintainer>
-	<email>mrueg@gentoo.org</email>
-	<name>Manuel Rüger</name>
-	<description>CC him on bugs.</description>
-</maintainer>
 <longdescription>
 sign is a file signing and signature verification utility. It's main purpose is
 to be a simple and convenient extension to a tar/gz/bzip2 line of tools to check
diff --git a/app-crypt/trousers/trousers-0.3.13-r1.ebuild b/app-crypt/trousers/trousers-0.3.13-r1.ebuild
new file mode 100644
index 0000000..e1055d2
--- /dev/null
+++ b/app-crypt/trousers/trousers-0.3.13-r1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit autotools eutils linux-info readme.gentoo systemd user udev
+
+#MY_P="${PN}-${PV%.*}-${PV##*.}"
+
+DESCRIPTION="An open-source TCG Software Stack (TSS) v1.1 implementation"
+HOMEPAGE="http://trousers.sf.net"
+SRC_URI="mirror://sourceforge/trousers/${P}.tar.gz"
+
+LICENSE="CPL-1.0 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86"
+IUSE="doc libressl selinux" # gtk
+
+# gtk support presently does NOT compile.
+#	gtk? ( >=x11-libs/gtk+-2 )
+
+CDEPEND=">=dev-libs/glib-2
+	!libressl? ( >=dev-libs/openssl-0.9.7:0 )
+	libressl? ( dev-libs/libressl )
+"
+DEPEND="${CDEPEND}
+	virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-tcsd )"
+# S="${WORKDIR}/${P}git"
+
+DOCS="AUTHORS ChangeLog NICETOHAVES README TODO"
+
+DOC_CONTENTS="
+	If you have problems starting tcsd, please check permissions and
+	ownership on /dev/tpm* and ~tss/system.data
+"
+
+pkg_setup() {
+	# Check for driver (not sure it can be an rdep, because ot depends on the
+	# version of virtual/linux-sources... Is that supported by portage?)
+	linux-info_pkg_setup
+	local tpm_kernel_version tpm_kernel_present tpm_module
+	kernel_is ge 2 6 12 && tpm_kernel_version="yes"
+	if linux_config_exists; then
+		linux_chkconfig_present TCG_TPM && tpm_kernel_present="yes"
+	else
+		ewarn "No kernel configuration could be found."
+	fi
+	has_version app-crypt/tpm-emulator && tpm_module="yes"
+	if [[ -n "${tpm_kernel_present}" ]]; then
+		einfo "Good, you seem to have in-kernel TPM support."
+	elif [[ -n "${tpm_module}" ]]; then
+		einfo "Good, you seem to have TPM support with the external module."
+		if [[ -n "${tpm_kernel_version}" ]]; then
+			elog
+			elog "Note that since you have a >=2.6.12 kernel, you could use"
+			elog "the in-kernel driver instead of (CONFIG_TCG_TPM)."
+		fi
+	elif [[ -n "${tpm_kernel_version}" ]]; then
+		eerror
+		eerror "To use this package, you will have to activate TPM support"
+		eerror "in your kernel configuration. That's at least CONFIG_TCG_TPM,"
+		eerror "plus probably a chip specific driver (like CONFIG_TCG_ATMEL)."
+		eerror
+	else
+		eerror
+		eerror "To use this package, you should install a TPM driver."
+		eerror "You can have the following options:"
+		eerror "  - install app-crypt/tpm-emulator"
+		eerror "  - switch to a >=2.6.12 kernel and compile the kernel module"
+		eerror
+	fi
+
+	# New user/group for the daemon
+	enewgroup tss
+	enewuser tss -1 -1 /var/lib/tpm tss
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-nouseradd.patch
+	epatch "${FILESDIR}"/${P}-build.patch
+	mv configure.in configure.ac || die
+	eautoreconf
+}
+
+src_configure() {
+	# econf --with-gui=$(usex gtk gtk openssl)
+	econf --with-gui=openssl
+}
+
+src_install() {
+	keepdir /var/lib/tpm
+	default
+	use doc && dodoc doc/*
+	newinitd "${FILESDIR}"/tcsd.initd tcsd
+	newconfd "${FILESDIR}"/tcsd.confd tcsd
+	systemd_dounit "${FILESDIR}"/tcsd.service
+	udev_dorules "${FILESDIR}"/61-trousers.rules
+	fowners tss:tss /var/lib/tpm
+	prune_libtool_files
+	readme.gentoo_create_doc
+}
diff --git a/app-crypt/xca/Manifest b/app-crypt/xca/Manifest
index 855de8a..a692692 100644
--- a/app-crypt/xca/Manifest
+++ b/app-crypt/xca/Manifest
@@ -1,2 +1,4 @@
 DIST xca-1.1.0.tar.gz 854925 SHA256 997b62b523f6581f0d96a5f5ba2fa31dcdd2b3cf1ffe924f5c69a931b0dd44df SHA512 c22a594c61f63c71e8bc7c38ccdfabe05903a33bf5116630ca4c5072b725e551a128b10f624d01a464695d739fb9d77a510b3ced99fedc5d5378cb5fd563d954 WHIRLPOOL 1b58ec3dce44e0eb101265f7b1e68695ea2121c795f7d5f6a5349c812469c50f618ce34a5985991432b49a910b2c34fd3eb8e88ac735078a6e063801f1731be0
 DIST xca-1.3.0.tar.gz 883772 SHA256 ef5b6e4ed93abb02eb53925edd222bfeb5c26a3b0698af90a416d8e92869414c SHA512 af537154a26fbb8749034b8aa79d0379e5e2567ea2b4c82c8a2f77b0fec7017d01aa0974d013f0d84eb52f2dc18994b29890d9ab63939c91aa9e316f6ef93685 WHIRLPOOL 19ce637f6794b00f7fbc363263768a8b651a21d9dd564ec7ba05fc9c729240ae8edc9d323b899b3641f9bf757b325a77c11a84848606dfe5dec839678a2c0314
+DIST xca-1.3.1.tar.gz 883797 SHA256 c2dd8d79b37440126d9fe7281e8c6802b95537c50ad464f6f7799ffa81aa3d83 SHA512 186056638177a01ca2ed1ad6e6e9e142de7d9e4a057c9a6ec691a488cfa094c97b90f1cae6e083c0a92f5492c67afb285946acbab7ec59d21b791e46cf54bc79 WHIRLPOOL c61c67311d3d64d772219a2bd544a720143a6636c8136174a748cd7f8037caa702d2fab6448b717def18de0e9353758bddffbee049fd427724828014a71dcb92
+DIST xca-1.3.2.tar.gz 897947 SHA256 04f11f2148c8369c1a1b4e109956ed8cc807ec266d0d936410624ba8ee4b5ce4 SHA512 f0a9c4d47f0c20632f44364cc55293a7d2152772a746a72bc4a46622da4e48ae612bafe918c098a71c29cdfca8e6c03c27cf85a862ca0f356eddf061414c89b2 WHIRLPOOL 11a19800447fe939d1684524c4c0da90dc8dde4dfce4ff8f606d384f976b0d6f067e8455e3a90facfbf99a1cc651affdffa9397a9a8191f1fc8d302944ea730a
diff --git a/app-crypt/xca/files/xca-1.3.1-build.patch b/app-crypt/xca/files/xca-1.3.1-build.patch
new file mode 100644
index 0000000..f7b07b9
--- /dev/null
+++ b/app-crypt/xca/files/xca-1.3.1-build.patch
@@ -0,0 +1,15 @@
+diff --git a/m4/xca_compile_test.m4 b/m4/xca_compile_test.m4
+index 5d2f8ca..fd10f5d 100644
+--- a/m4/xca_compile_test.m4
++++ b/m4/xca_compile_test.m4
+@@ -2,8 +2,8 @@ AC_DEFUN([XCA_COMPILE_TEST], [
+ 
+ # Try to compile a little application
+ #####################################
+-CXXFLAGS="${CXXFLAGS} ${OPENSSL_CFLAGS}${QT_CFLAGS}"
+-LIBS="${LIBS} ${OPENSSL_LIBS}${QT_LIBS}"
++CXXFLAGS="${CXXFLAGS} ${OPENSSL_CFLAGS} ${QT_CFLAGS}"
++LIBS="${LIBS} ${OPENSSL_LIBS} ${QT_LIBS}"
+ 
+ AC_TRY_RUN([
+ #include <stdio.h>
diff --git a/app-crypt/xca/xca-1.3.1.ebuild b/app-crypt/xca/xca-1.3.1.ebuild
new file mode 100644
index 0000000..1e7a29b
--- /dev/null
+++ b/app-crypt/xca/xca-1.3.1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit autotools eutils toolchain-funcs
+
+DESCRIPTION="A GUI to OpenSSL, RSA public keys, certificates, signing requests and revokation lists"
+HOMEPAGE="http://xca.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="bindist"
+
+RDEPEND=">=dev-libs/openssl-0.9.8:*[bindist=]
+	dev-qt/qtgui:4"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-1.0.0-desktop.patch
+	epatch "${FILESDIR}"/${P}-build.patch
+	AT_M4DIR="m4" eautoreconf
+}
+
+src_configure() {
+	econf \
+		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
+		STRIP=true
+}
+
+src_compile() {
+	# enforce all to avoid the automatic silent rules
+	emake all
+}
+
+src_install() {
+	# non standard destdir
+	emake install destdir="${ED}"
+
+	insinto /etc/xca
+	doins misc/*.txt
+}
diff --git a/app-crypt/xca/xca-1.3.2.ebuild b/app-crypt/xca/xca-1.3.2.ebuild
new file mode 100644
index 0000000..8803f74
--- /dev/null
+++ b/app-crypt/xca/xca-1.3.2.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="A GUI to OpenSSL, RSA public keys, certificates, signing requests and revokation lists"
+HOMEPAGE="http://xca.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="bindist"
+
+RDEPEND=">=dev-libs/openssl-0.9.8:*[bindist=]
+	dev-qt/qtgui:4"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-1.0.0-desktop.patch
+}
+
+src_configure() {
+	econf \
+		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
+		STRIP=true
+}
+
+src_compile() {
+	# enforce all to avoid the automatic silent rules
+	emake all
+}
+
+src_install() {
+	# non standard destdir
+	emake install destdir="${ED}"
+
+	insinto /etc/xca
+	doins misc/*.txt
+}
diff --git a/app-dicts/hunspell-kk/Manifest b/app-dicts/hunspell-kk/Manifest
new file mode 100644
index 0000000..75d8402
--- /dev/null
+++ b/app-dicts/hunspell-kk/Manifest
@@ -0,0 +1 @@
+DIST hunspell-kk-1.1.2.tar.gz 310304 SHA256 a51dfd059eb660d34cf421fb6c46811d3d2609cda94d5d1bf1e30dc02d4177f0 SHA512 ed04d2d0e341b138c7a1646807d18df1044329ade16f18165dc1e70359988302314949102d6bee7a3038e1f12974966598606f0c9dfb28cdeb025460601fa91a WHIRLPOOL 06507c4abf9e2bfa89d0c118c1efbd1185ad1f9c5aff2fa2dead582289d85bbdfd5563d858dad3ad1bf88a22a9fe5496a9a2d50f0a40930b3bfb8e83cd976111
diff --git a/app-dicts/hunspell-kk/hunspell-kk-1.1.2.ebuild b/app-dicts/hunspell-kk/hunspell-kk-1.1.2.ebuild
new file mode 100644
index 0000000..0eda532
--- /dev/null
+++ b/app-dicts/hunspell-kk/hunspell-kk-1.1.2.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils git-r3 vcs-snapshot
+
+MY_P=${PN}-${PV}
+
+DESCRIPTION="Kazakh dictionaries for myspell/hunspell"
+SRC_URI="https://github.com/kergalym/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+HOMEPAGE="http://hunspell.sourceforge.net/"
+
+SLOT="0"
+LICENSE="MPL-1.1 GPL-2 LGPL-2.1"
+IUSE="ncurses nls readline static-libs"
+KEYWORDS="~x86 ~amd64"
+
+RDEPEND="
+	ncurses? ( sys-libs/ncurses:= )
+	readline? ( sys-libs/readline:= )"
+DEPEND="${RDEPEND}
+	sys-devel/gettext
+	app-text/hunspell
+	app-dicts/myspell-en
+	app-dicts/myspell-ru"
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+	dodir "/usr/share/myspell"
+	insinto "/usr/share/myspell"
+	doins "${S}/kk_KZ.aff"
+	doins "${S}/kk_noun_adj.aff"
+	doins "${S}/kk_test.aff"
+	doins "${S}/kk_noun_adj.dic"
+	doins "${S}/kk_test.dic"
+	doins "${S}/kk_KZ.dic"
+	dodoc README_kk_KZ.txt
+}
diff --git a/app-dicts/hunspell-kk/metadata.xml b/app-dicts/hunspell-kk/metadata.xml
new file mode 100644
index 0000000..86a2f54
--- /dev/null
+++ b/app-dicts/hunspell-kk/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer>
+		<email>idella4@gentoo.org</email>
+		<name>Ian Delaney</name>
+	</maintainer>
+	<maintainer>
+		<email>kegalym2@mail.ru</email>
+		<name>Galym Kerimbekov</name>
+		<description>Proxy maintainer, assign bugs to him</description>
+	</maintainer>
+</pkgmetadata>
diff --git a/app-doc/doxygen/doxygen-1.8.9.1.ebuild b/app-doc/doxygen/doxygen-1.8.9.1.ebuild
index 37cf363..30e709c 100644
--- a/app-doc/doxygen/doxygen-1.8.9.1.ebuild
+++ b/app-doc/doxygen/doxygen-1.8.9.1.ebuild
@@ -14,7 +14,7 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ~mips ppc ~ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
 IUSE="clang debug doc dot doxysearch qt4 latex sqlite"
 
 #missing SerbianCyrilic, JapaneseEn, KoreanEn, Chinesetraditional
diff --git a/app-editors/retext/Manifest b/app-editors/retext/Manifest
index eb028eb..9091eb5 100644
--- a/app-editors/retext/Manifest
+++ b/app-editors/retext/Manifest
@@ -2,3 +2,4 @@
 DIST ReText-5.0.2.tar.gz 140853 SHA256 7ef898abc8aed70502fd4d69ed7e8ab43cc978fcbe6864da5771379c1e315bdd SHA512 b28dd24aa5253106880bd6a5a3a16f96670c3145a2cb46da520407d6705f055ee52aaef9c0a8e27c2900b5fdde6a67c599cb8945f7daa6e3ef4456e1fd7c9b0f WHIRLPOOL 0ee1a7497ca3d6fef8356777d93e369d06de542b20974055ddf66cc8e12d33c7716d3b4b5f0360b40037c90d146fddbff4c3b48c96929efafd8f43e278240c0f
 DIST ReText-5.1.0.tar.gz 151833 SHA256 09b12892a0520bb8b0692f5aec7aa88911d07a5048a3402a9e9d4ac57322b5ca SHA512 3dbfe4992195119513c571291c344338dccf55c52d000cc69da63d0e51e5f2d9c5a0a2fba6570e525c96f1f9243a7465391a59b840a1fb7dd4513a0b4909ca5c WHIRLPOOL 76826184a3e8ac3ea3f5c10c31a3630ad8bc37a1bce0d771fc250f1f53acb9dd2f888aa67adf946368a5baebcdab0306100ea0e632dcd36edd81cdcd1a247838
 DIST ReText-5.2.0.tar.gz 156953 SHA256 463b524435d7b068d90304ae719f96a9c8b957323206549ae5a02ffe5fa82b17 SHA512 9a40fb0e39145ee9bc29945af488e74ea8aa5a78b220f28d1c3de5060daf6f3a6864b4e852165847bb4b5905ca4f0684d56b24864baa05f96468f5d4d0172c6b WHIRLPOOL be4b10f7158de253ac1a104e5053d80afcf5ecc6928ba8a009c8bbdac9166a735cb60d56c268c6f1651f3d7c6c4d9daac46caa4696795e68c1dbf870dc759afd
+DIST ReText-5.2.1.tar.gz 157119 SHA256 02164ae2bba6f47a2ec5e11aa06aefbcd96bea1b84a96c5673dbe18d8ccb2a69 SHA512 1d11f6824b64a082425ac2e8b67da15d4df5352539b66a8297dba0cd4f4236b7328966e97104c3fd7a641067a84023f65ba856f932d8489ff4e80722471835d8 WHIRLPOOL 24e7c756f61c210320b0ab9a67c99f43ccf5739310a01d9ee98d779e8b45b27dbc828b0c573973b2e4d2b8e07f2edd56660de685930a7a2ed8ceb50ab6fb6f91
diff --git a/app-editors/retext/metadata.xml b/app-editors/retext/metadata.xml
index ded9cf7..bfcec72 100644
--- a/app-editors/retext/metadata.xml
+++ b/app-editors/retext/metadata.xml
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
   <maintainer>
diff --git a/app-editors/retext/retext-5.2.1.ebuild b/app-editors/retext/retext-5.2.1.ebuild
new file mode 100644
index 0000000..f147eaa
--- /dev/null
+++ b/app-editors/retext/retext-5.2.1.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python3_{3,4} )
+
+PLOCALES="ca cs cy da de es et eu fr hu it ja pl pt pt_BR ru sk sr sr@latin uk zh_TW"
+
+inherit distutils-r1 l10n
+
+MY_PN="ReText"
+MY_P="${MY_PN}-${PV/_/~}"
+
+DESCRIPTION="Simple editor for Markdown and reStructuredText"
+HOMEPAGE="https://github.com/retext-project/retext https://github.com/retext-project/retext/wiki"
+SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+spell"
+
+RDEPEND="
+	dev-python/docutils[${PYTHON_USEDEP}]
+	dev-python/markdown[${PYTHON_USEDEP}]
+	dev-python/markups[${PYTHON_USEDEP}]
+	dev-python/pygments[${PYTHON_USEDEP}]
+	dev-python/PyQt5[gui,network,printsupport,webkit,widgets,${PYTHON_USEDEP}]
+	spell? ( dev-python/pyenchant[${PYTHON_USEDEP}] )
+"
+
+S="${WORKDIR}"/${MY_P}
+
+remove_locale() {
+	find "${ED}" -name "retext_${1}.qm" -delete || die "Failed to remove locale ${1}."
+}
+
+python_test() {
+	esetup.py test
+}
+
+python_install_all() {
+	distutils-r1_python_install_all
+
+	newicon {icons/,}${PN}.png
+	newicon {icons/,}${PN}.svg
+
+	l10n_for_each_disabled_locale_do remove_locale
+
+	make_desktop_entry ${PN} "${MY_PN} Editor" ${PN} "Development;Utility;TextEditor"
+}
diff --git a/app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch b/app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch
new file mode 100644
index 0000000..025a390
--- /dev/null
+++ b/app-editors/xemacs/files/xemacs-21.5.34-gcc5.patch
@@ -0,0 +1,35 @@
+diff --git a/src/lisp.h b/src/lisp.h
+--- a/src/lisp.h
++++ b/src/lisp.h
+@@ -1154,6 +1154,8 @@
+ 
+ /* ------------------------ alignment definitions ------------------- */
+ 
++#if (!defined (__STDC_VERSION__) || __STDC_VERSION__ < 201112L) && \
++    (!defined (__cplusplus) || __cplusplus < 201103L)
+ /* No type has a greater alignment requirement than max_align_t.
+    (except perhaps for types we don't use, like long double) */
+ typedef union
+@@ -1163,6 +1165,7 @@
+   struct { void (*f)(void); } f;
+   struct { double d; } d;
+ } max_align_t;
++#endif
+ 
+ /* ALIGNOF returns the required alignment of a type -- i.e. a value such
+    that data of this type must begin at a memory address which is a
+@@ -1170,7 +1173,11 @@
+    as the type itself. */
+ 
+ #ifndef ALIGNOF
+-# if defined (__GNUC__) && (__GNUC__ >= 2)
++# if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
++#  define ALIGNOF(type) _Alignof(type)
++# elif defined (__cplusplus) && __cplusplus >= 201103L
++#  define ALIGNOF(type) alignof(type)
++# elif defined (__GNUC__) && (__GNUC__ >= 2)
+ /* gcc has an extension that gives us exactly what we want. */
+ #  define ALIGNOF(type) __alignof__ (type)
+ # elif ! defined (__cplusplus)
+
+
diff --git a/app-editors/xemacs/xemacs-21.4.22-r4.ebuild b/app-editors/xemacs/xemacs-21.4.22-r4.ebuild
index e8f4a79..b4d84d6 100644
--- a/app-editors/xemacs/xemacs-21.4.22-r4.ebuild
+++ b/app-editors/xemacs/xemacs-21.4.22-r4.ebuild
@@ -45,7 +45,7 @@
 	jpeg? ( virtual/jpeg:0 )
 	canna? ( app-i18n/canna )
 	!amd64? ( freewnn? ( app-i18n/freewnn ) )
-	>=sys-libs/ncurses-5.2
+	>=sys-libs/ncurses-5.2:=
 	>=app-eselect/eselect-emacs-1.15"
 
 DEPEND="${RDEPEND}"
diff --git a/app-editors/xemacs/xemacs-21.4.24.ebuild b/app-editors/xemacs/xemacs-21.4.24.ebuild
index 31b88c5..24fd39c 100644
--- a/app-editors/xemacs/xemacs-21.4.24.ebuild
+++ b/app-editors/xemacs/xemacs-21.4.24.ebuild
@@ -18,7 +18,7 @@
 
 LICENSE="GPL-2+"
 SLOT="0"
-KEYWORDS="alpha amd64 hppa ppc ppc64 sparc ~x86"
+KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86"
 IUSE="eolconv gif gpm pop postgres ldap xface nas dnd X jpeg tiff png mule motif freewnn canna xim athena neXt Xaw3d gdbm berkdb"
 
 X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
@@ -45,7 +45,7 @@
 	jpeg? ( virtual/jpeg:0 )
 	canna? ( app-i18n/canna )
 	!amd64? ( freewnn? ( app-i18n/freewnn ) )
-	>=sys-libs/ncurses-5.2
+	>=sys-libs/ncurses-5.2:=
 	>=app-eselect/eselect-emacs-1.15"
 
 DEPEND="${RDEPEND}
diff --git a/app-editors/xemacs/xemacs-21.5.34-r3.ebuild b/app-editors/xemacs/xemacs-21.5.34-r3.ebuild
new file mode 100644
index 0000000..c5dfa22
--- /dev/null
+++ b/app-editors/xemacs/xemacs-21.5.34-r3.ebuild
@@ -0,0 +1,251 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Note: xemacs currently does not work with a hardened profile. If you
+# want to use xemacs on a hardened profile then compile with the
+# -nopie flag in CFLAGS or help fix bug #75028.
+
+EAPI=4
+
+WANT_AUTOCONF="2.5"
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="highly customizable open source text editor and application development system"
+HOMEPAGE="http://www.xemacs.org/"
+SRC_URI="http://ftp.xemacs.org/xemacs-21.5/${P}.tar.gz
+	http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
+IUSE="alsa debug eolconv gif gpm pop postgres ldap libressl xface nas dnd X jpeg tiff png mule motif freewnn canna xft xim athena neXt Xaw3d gdbm berkdb"
+
+X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
+
+RDEPEND="
+	berkdb? ( >=sys-libs/db-4 !!<sys-libs/db-4 )
+	gdbm? ( >=sys-libs/gdbm-1.8.3[berkdb(+)] )
+	>=sys-libs/zlib-1.1.4
+	!libressl? ( >=dev-libs/openssl-0.9.6:0 )
+	libressl? ( dev-libs/libressl )
+	>=media-libs/audiofile-0.2.3
+	gpm? ( >=sys-libs/gpm-1.19.6 )
+	postgres? ( dev-db/postgresql )
+	ldap? ( net-nds/openldap )
+	alsa? ( media-libs/alsa-lib )
+	nas? ( media-libs/nas )
+	X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
+	dnd? ( x11-libs/dnd )
+	motif? ( >=x11-libs/motif-2.3:0[xft=] )
+	athena? ( x11-libs/libXaw )
+	Xaw3d? ( x11-libs/libXaw3d )
+	xft? ( media-libs/freetype:2 x11-libs/libXft x11-libs/libXrender >=media-libs/fontconfig-2.5.0 )
+	neXt? ( x11-libs/neXtaw )
+	xface? ( media-libs/compface )
+	tiff? ( media-libs/tiff:0 )
+	png? ( >=media-libs/libpng-1.2:0 )
+	jpeg? ( virtual/jpeg:0 )
+	canna? ( app-i18n/canna )
+	freewnn? ( app-i18n/freewnn )
+	>=sys-libs/ncurses-5.2
+	>=app-eselect/eselect-emacs-1.15"
+
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+PDEPEND="app-xemacs/xemacs-base
+	mule? ( app-xemacs/mule-base )"
+
+src_unpack() {
+	default_src_unpack
+
+	use neXt && unpack NeXT_XEmacs.tar.gz
+}
+
+src_prepare() {
+	use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
+	find "${S}"/lisp -name '*.elc' -exec rm {} \; || die
+	epatch "${FILESDIR}/${P}-ncurses-tinfo.patch"
+
+	# Some binaries and man pages are installed under suffixed names
+	# to avoid collions with their GNU Emacs counterparts (see below).
+	# Fix internal filename references.
+	sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
+	sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
+	sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
+}
+
+src_configure() {
+	local myconf=""
+
+	if use X; then
+
+		myconf="${myconf} --with-widgets=athena"
+		myconf="${myconf} --with-dialogs=athena"
+		myconf="${myconf} --with-menubars=lucid"
+		myconf="${myconf} --with-scrollbars=lucid"
+		if use motif ; then
+			myconf="--with-widgets=motif"
+			myconf="${myconf} --with-dialogs=motif"
+			myconf="${myconf} --with-scrollbars=motif"
+			myconf="${myconf} --with-menubars=lucid"
+		fi
+		if use athena or use Xaw3d ; then
+			myconf="--with-scrollbars=athena"
+		fi
+
+		if use Xaw3d; then
+			myconf="${myconf} --with-athena=3d"
+		elif use neXt; then
+			myconf="${myconf} --with-athena=next"
+		else
+			myconf="${myconf} --with-athena=xaw"
+		fi
+
+		use dnd && myconf="${myconf} --with-dragndrop --with-offix"
+
+		myconf="${myconf} $(use_with tiff )"
+		myconf="${myconf} $(use_with png )"
+		myconf="${myconf} $(use_with jpeg )"
+		myconf="${myconf} $(use_with xface )"
+
+		use xft && myconf="${myconf} --with-xft=emacs,tabs,menubars,gauges" ||
+			myconf="${myconf} --with-xft=no"
+
+	else
+		myconf="${myconf}
+			--without-x
+			--without-xpm
+			--without-dragndrop
+			--with-xft=no
+			--with-gif=no"
+	fi
+
+	if use mule ; then
+		myconf="${myconf} --with-mule"
+
+		if use xim ; then
+			if use motif ; then
+				myconf="${myconf} --with-xim=motif"
+			else
+				myconf="${myconf} --with-xim=xlib"
+			fi
+		else
+			myconf="${myconf} --with-xim=no"
+		fi
+
+		myconf="${myconf} $(use_with canna )"
+		myconf="${myconf} $(use_with freewnn wnn )"
+	fi
+
+	# This determines the type of sounds we are playing
+	local soundconf="native"
+
+	# This determines how these sounds should be played
+	use nas	&& soundconf="${soundconf},nas"
+	use alsa && soundconf="${soundconf},alsa"
+
+	myconf="${myconf} --with-sound=${soundconf}"
+
+	if use gdbm || use berkdb ; then
+		use gdbm   && mydb="gdbm"
+		use berkdb && mydb="${mydb},berkdb"
+
+		myconf="${myconf} --with-database=${mydb}"
+	else
+		myconf="${myconf} --without-database"
+	fi
+
+	use debug && myconf="${myconf} --with-debug" ||
+		myconf="${myconf} --with-optimization"
+
+	econf ${myconf} \
+		$(use_with gif ) \
+		$(use_with gpm ) \
+		$(use_with postgres postgresql ) \
+		$(use_with ldap ) \
+		$(use_with eolconv file-coding ) \
+		$(use_with pop ) \
+		--prefix=/usr \
+		--with-ncurses \
+		--with-msw=no \
+		--with-mail-locking=flock \
+		--with-site-lisp=yes \
+		--with-site-modules=yes \
+		--with-newgc \
+		--enable-option-checking=no \
+		--with-last-packages=/usr/lib/xemacs \
+		|| die "configuration failed"
+}
+
+src_compile() {
+	emake EMACSLOADPATH="${S}"/lisp
+}
+
+src_install() {
+	emake prefix="${D}"/usr \
+		mandir="${D}"/usr/share/man/man1 \
+		infodir="${D}"/usr/share/info \
+		libdir="${D}"/usr/$(get_libdir) \
+		datadir="${D}"/usr/share \
+		install || die
+
+	# Rename some applications installed in bin so that it is clear
+	# which application installed them and so that conflicting
+	# packages (emacs) can't clobber the actual applications.
+	# Addresses bug #62991.
+	for i in b2m ctags etags gnuclient gnudoit gnuattach; do
+		mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
+	done
+
+	# rename man pages
+	for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
+		mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
+	done
+
+	# install base packages directories
+	dodir /usr/lib/xemacs/xemacs-packages/
+	dodir /usr/lib/xemacs/site-packages/
+	dodir /usr/lib/xemacs/site-modules/
+	dodir /usr/lib/xemacs/site-lisp/
+
+	if use mule;
+	then
+		dodir /usr/lib/xemacs/mule-packages
+	fi
+
+	# remove extraneous info files
+	cd "${D}"/usr/share/info
+	rm -f dir info.info texinfo* termcap* standards*
+
+	cd "${S}"
+	dodoc CHANGES-* ChangeLog INSTALL Installation PROBLEMS README*
+
+	newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
+
+	domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+	eselect emacs update ifunset
+	eselect gnuclient update ifunset
+
+	einfo "*************************************************"
+	einfo "If you are upgrading from XEmacs 21.4 you should note the following"
+	einfo "incompatibilities:"
+	einfo "- Mule-UCS is no longer supported due to proper UTF-8 support in XEmacs 21.5"
+	einfo "- The X resource class has changed from Emacs to XEmacs,"
+	einfo "  settings in your .Xdefaults file should be updated accordingly."
+
+	if use xft;
+	then
+	  einfo "You have enabled Xft font support. Xft requires font names to be provided"
+	  einfo "in a different way, so you may need to adjust your .Xdefaults accordingly."
+	fi
+}
+
+pkg_postrm() {
+	eselect emacs update ifunset
+	eselect gnuclient update ifunset
+}
diff --git a/app-editors/xemacs/xemacs-21.5.34-r4.ebuild b/app-editors/xemacs/xemacs-21.5.34-r4.ebuild
new file mode 100644
index 0000000..4756c65
--- /dev/null
+++ b/app-editors/xemacs/xemacs-21.5.34-r4.ebuild
@@ -0,0 +1,252 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Note: xemacs currently does not work with a hardened profile. If you
+# want to use xemacs on a hardened profile then compile with the
+# -nopie flag in CFLAGS or help fix bug #75028.
+
+EAPI=4
+
+WANT_AUTOCONF="2.5"
+inherit eutils flag-o-matic multilib
+
+DESCRIPTION="highly customizable open source text editor and application development system"
+HOMEPAGE="http://www.xemacs.org/"
+SRC_URI="http://ftp.xemacs.org/xemacs-21.5/${P}.tar.gz
+	http://www.malfunction.de/afterstep/files/NeXT_XEmacs.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
+IUSE="alsa debug eolconv gif gpm pop postgres ldap libressl xface nas dnd X jpeg tiff png mule motif freewnn canna xft xim athena neXt Xaw3d gdbm berkdb"
+
+X_DEPEND="x11-libs/libXt x11-libs/libXmu x11-libs/libXext x11-misc/xbitmaps"
+
+RDEPEND="
+	berkdb? ( >=sys-libs/db-4 !!<sys-libs/db-4 )
+	gdbm? ( >=sys-libs/gdbm-1.8.3[berkdb(+)] )
+	>=sys-libs/zlib-1.1.4
+	!libressl? ( >=dev-libs/openssl-0.9.6:0 )
+	libressl? ( dev-libs/libressl )
+	>=media-libs/audiofile-0.2.3
+	gpm? ( >=sys-libs/gpm-1.19.6 )
+	postgres? ( dev-db/postgresql )
+	ldap? ( net-nds/openldap )
+	alsa? ( media-libs/alsa-lib )
+	nas? ( media-libs/nas )
+	X? ( $X_DEPEND !Xaw3d? ( !neXt? ( x11-libs/libXaw ) ) )
+	dnd? ( x11-libs/dnd )
+	motif? ( >=x11-libs/motif-2.3:0[xft=] )
+	athena? ( x11-libs/libXaw )
+	Xaw3d? ( x11-libs/libXaw3d )
+	xft? ( media-libs/freetype:2 x11-libs/libXft x11-libs/libXrender >=media-libs/fontconfig-2.5.0 )
+	neXt? ( x11-libs/neXtaw )
+	xface? ( media-libs/compface )
+	tiff? ( media-libs/tiff:0 )
+	png? ( >=media-libs/libpng-1.2:0 )
+	jpeg? ( virtual/jpeg:0 )
+	canna? ( app-i18n/canna )
+	freewnn? ( app-i18n/freewnn )
+	>=sys-libs/ncurses-5.2
+	>=app-eselect/eselect-emacs-1.15"
+
+DEPEND="${RDEPEND}
+	virtual/pkgconfig"
+
+PDEPEND="app-xemacs/xemacs-base
+	mule? ( app-xemacs/mule-base )"
+
+src_unpack() {
+	default_src_unpack
+
+	use neXt && unpack NeXT_XEmacs.tar.gz
+}
+
+src_prepare() {
+	use neXt && cp "${WORKDIR}"/NeXT.XEmacs/xemacs-icons/* "${S}"/etc/toolbar/
+	find "${S}"/lisp -name '*.elc' -exec rm {} \; || die
+	epatch "${FILESDIR}/${P}-ncurses-tinfo.patch"
+	epatch "${FILESDIR}/${P}-gcc5.patch"
+
+	# Some binaries and man pages are installed under suffixed names
+	# to avoid collions with their GNU Emacs counterparts (see below).
+	# Fix internal filename references.
+	sed -i -e 's/exec gnuclient/&-xemacs/' lib-src/gnudoit || die
+	sed -i -e '/^\.so/s/etags/&-xemacs/' etc/ctags.1 || die
+	sed -i -e '/^\.so/s/gnuserv/&-xemacs/' etc/gnu{client,doit,attach}.1 || die
+}
+
+src_configure() {
+	local myconf=""
+
+	if use X; then
+
+		myconf="${myconf} --with-widgets=athena"
+		myconf="${myconf} --with-dialogs=athena"
+		myconf="${myconf} --with-menubars=lucid"
+		myconf="${myconf} --with-scrollbars=lucid"
+		if use motif ; then
+			myconf="--with-widgets=motif"
+			myconf="${myconf} --with-dialogs=motif"
+			myconf="${myconf} --with-scrollbars=motif"
+			myconf="${myconf} --with-menubars=lucid"
+		fi
+		if use athena or use Xaw3d ; then
+			myconf="--with-scrollbars=athena"
+		fi
+
+		if use Xaw3d; then
+			myconf="${myconf} --with-athena=3d"
+		elif use neXt; then
+			myconf="${myconf} --with-athena=next"
+		else
+			myconf="${myconf} --with-athena=xaw"
+		fi
+
+		use dnd && myconf="${myconf} --with-dragndrop --with-offix"
+
+		myconf="${myconf} $(use_with tiff )"
+		myconf="${myconf} $(use_with png )"
+		myconf="${myconf} $(use_with jpeg )"
+		myconf="${myconf} $(use_with xface )"
+
+		use xft && myconf="${myconf} --with-xft=emacs,tabs,menubars,gauges" ||
+			myconf="${myconf} --with-xft=no"
+
+	else
+		myconf="${myconf}
+			--without-x
+			--without-xpm
+			--without-dragndrop
+			--with-xft=no
+			--with-gif=no"
+	fi
+
+	if use mule ; then
+		myconf="${myconf} --with-mule"
+
+		if use xim ; then
+			if use motif ; then
+				myconf="${myconf} --with-xim=motif"
+			else
+				myconf="${myconf} --with-xim=xlib"
+			fi
+		else
+			myconf="${myconf} --with-xim=no"
+		fi
+
+		myconf="${myconf} $(use_with canna )"
+		myconf="${myconf} $(use_with freewnn wnn )"
+	fi
+
+	# This determines the type of sounds we are playing
+	local soundconf="native"
+
+	# This determines how these sounds should be played
+	use nas	&& soundconf="${soundconf},nas"
+	use alsa && soundconf="${soundconf},alsa"
+
+	myconf="${myconf} --with-sound=${soundconf}"
+
+	if use gdbm || use berkdb ; then
+		use gdbm   && mydb="gdbm"
+		use berkdb && mydb="${mydb},berkdb"
+
+		myconf="${myconf} --with-database=${mydb}"
+	else
+		myconf="${myconf} --without-database"
+	fi
+
+	use debug && myconf="${myconf} --with-debug" ||
+		myconf="${myconf} --with-optimization"
+
+	econf ${myconf} \
+		$(use_with gif ) \
+		$(use_with gpm ) \
+		$(use_with postgres postgresql ) \
+		$(use_with ldap ) \
+		$(use_with eolconv file-coding ) \
+		$(use_with pop ) \
+		--prefix=/usr \
+		--with-ncurses \
+		--with-msw=no \
+		--with-mail-locking=flock \
+		--with-site-lisp=yes \
+		--with-site-modules=yes \
+		--with-newgc \
+		--enable-option-checking=no \
+		--with-last-packages=/usr/lib/xemacs \
+		|| die "configuration failed"
+}
+
+src_compile() {
+	emake EMACSLOADPATH="${S}"/lisp
+}
+
+src_install() {
+	emake prefix="${D}"/usr \
+		mandir="${D}"/usr/share/man/man1 \
+		infodir="${D}"/usr/share/info \
+		libdir="${D}"/usr/$(get_libdir) \
+		datadir="${D}"/usr/share \
+		install || die
+
+	# Rename some applications installed in bin so that it is clear
+	# which application installed them and so that conflicting
+	# packages (emacs) can't clobber the actual applications.
+	# Addresses bug #62991.
+	for i in b2m ctags etags gnuclient gnudoit gnuattach; do
+		mv "${D}"/usr/bin/${i} "${D}"/usr/bin/${i}-xemacs || die "mv ${i} failed"
+	done
+
+	# rename man pages
+	for i in ctags etags gnuserv gnuclient gnudoit gnuattach; do
+		mv "${D}"/usr/share/man/man1/${i}{,-xemacs}.1 || die "mv ${i}.1 failed"
+	done
+
+	# install base packages directories
+	dodir /usr/lib/xemacs/xemacs-packages/
+	dodir /usr/lib/xemacs/site-packages/
+	dodir /usr/lib/xemacs/site-modules/
+	dodir /usr/lib/xemacs/site-lisp/
+
+	if use mule;
+	then
+		dodir /usr/lib/xemacs/mule-packages
+	fi
+
+	# remove extraneous info files
+	cd "${D}"/usr/share/info
+	rm -f dir info.info texinfo* termcap* standards*
+
+	cd "${S}"
+	dodoc CHANGES-* ChangeLog INSTALL Installation PROBLEMS README*
+
+	newicon "${S}"/etc/${PN}-icon.xpm ${PN}.xpm
+
+	domenu "${FILESDIR}"/${PN}.desktop
+}
+
+pkg_postinst() {
+	eselect emacs update ifunset
+	eselect gnuclient update ifunset
+
+	einfo "*************************************************"
+	einfo "If you are upgrading from XEmacs 21.4 you should note the following"
+	einfo "incompatibilities:"
+	einfo "- Mule-UCS is no longer supported due to proper UTF-8 support in XEmacs 21.5"
+	einfo "- The X resource class has changed from Emacs to XEmacs,"
+	einfo "  settings in your .Xdefaults file should be updated accordingly."
+
+	if use xft;
+	then
+	  einfo "You have enabled Xft font support. Xft requires font names to be provided"
+	  einfo "in a different way, so you may need to adjust your .Xdefaults accordingly."
+	fi
+}
+
+pkg_postrm() {
+	eselect emacs update ifunset
+	eselect gnuclient update ifunset
+}
diff --git a/app-emacs/ess/Manifest b/app-emacs/ess/Manifest
index f35ea15..ee6ddc8 100644
--- a/app-emacs/ess/Manifest
+++ b/app-emacs/ess/Manifest
@@ -1,3 +1,3 @@
-DIST ess-13.09.tgz 3356969 SHA256 d0625f8ac38831a05d419435d3a6ccf852878c8aea018c3f4a9c9d6bd61e71d2 SHA512 96a91a41c9b390c27646e4b95d7a41e6b22d592c82bf775f2e1b70905c7bc684c3d6645496275d245c9f882030da1b3bd5cd3ba5711acbec3a07cdb2d065a5dd WHIRLPOOL 3560d95bcb43a65ca86787274fa96106611a98041cf63905a4066223247d8557405b7557da2c468d836d4570d4e791aa36e84e76585fc9668729926ef0759598
 DIST ess-14.09.tgz 3350987 SHA256 b6f1badd065e2e42f1d9d75a4e7a04290849d6f7a2bdb8413f73e0eae4014571 SHA512 91e275810f7a8c856f3392194ad3fb3d5f5b966e887568b22c133a362164e71ff5306d1d1a70e97f9d10261fe82eecb5f14e99a0dad4a4e239f5b810d7bba8ac WHIRLPOOL 5eabe6d65d7b5d420a7c6989b82d9901ac20d7b6376223f5aee39da7212ea395d15a98ce86c49fb2782706ba524532ceb38fd23dafaae5891a55958d1c676221
 DIST ess-15.03-1.tgz 3177102 SHA256 ad2f1b48dd4671848709d226aab72427129ac2fd5f85c0c0b39b96be24eee66f SHA512 5260d8afa10e1382cac3c70a4b6f753dd77e9f24bb2f68247732605b0f5fbb1b06e090dbcb45d747a484333f0779959c9213a4792103839b11c9e239bf35534d WHIRLPOOL eb1e6917a05b7444f4c37949a51554b6b33a0841bad5dae6aa93f575a7914fb36299c7c63ec27ec24944104a39b5844ada12b1c74a64daa04a682d5e97001834
+DIST ess-15.09.tgz 3239642 SHA256 3438683af3232280d9281938ad101a1e0bb92aa7c97f330c07d8ef7d10489465 SHA512 95350c1d558ba2bc8582978441569f40ba4c59609c21cd473908cc152c8cc6e4e38b9236cc47dd73469dcf14c8a359652e54de5632a21700835350764f401d4f WHIRLPOOL 426659087f7ace498cf99bcc67502c0d83c140ae8e5576d80747ba9fe22db641e2ef48dbbb0771231d880dddfc9fcf3ca8c482578e77c15c2d1b6a114509da46
diff --git a/app-emacs/ess/ess-13.09.ebuild b/app-emacs/ess/ess-13.09.ebuild
deleted file mode 100644
index e80e2e1..0000000
--- a/app-emacs/ess/ess-13.09.ebuild
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-inherit elisp
-
-DESCRIPTION="Emacs Speaks Statistics"
-HOMEPAGE="http://ess.r-project.org/"
-SRC_URI="http://ess.r-project.org/downloads/ess/${P}.tgz"
-
-LICENSE="GPL-2+ GPL-3+ Texinfo-manual"
-SLOT="0"
-KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux ~x86-macos"
-
-DEPEND="app-text/texi2html
-	virtual/latex-base"
-
-SITEFILE="50${PN}-gentoo.el"
-
-src_compile() {
-	default
-}
-
-src_install() {
-	emake PREFIX="${ED}/usr" \
-		INFODIR="${ED}/usr/share/info" \
-		LISPDIR="${ED}${SITELISP}/ess" \
-		DOCDIR="${ED}/usr/share/doc/${PF}" \
-		install
-
-	elisp-site-file-install "${FILESDIR}/${SITEFILE}"
-
-	# Most documentation is installed by the package's build system.
-	rm -f "${ED}${SITELISP}/${PN}/ChangeLog"
-	dodoc ChangeLog *NEWS doc/{TODO,ess-intro.pdf}
-	newdoc lisp/ChangeLog ChangeLog-lisp
-}
-
-pkg_postinst() {
-	elisp-site-regen
-	elog "Please see /usr/share/doc/${PF} for the complete documentation."
-	elog "Usage hints are in ${SITELISP}/${PN}/ess-site.el ."
-}
diff --git a/app-emacs/ess/ess-15.09.ebuild b/app-emacs/ess/ess-15.09.ebuild
new file mode 100644
index 0000000..6953117
--- /dev/null
+++ b/app-emacs/ess/ess-15.09.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit readme.gentoo elisp
+
+DESCRIPTION="Emacs Speaks Statistics"
+HOMEPAGE="http://ess.r-project.org/"
+SRC_URI="http://ess.r-project.org/downloads/ess/${P}.tgz"
+
+LICENSE="GPL-2+ GPL-3+ Texinfo-manual"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x86-macos"
+
+DEPEND="app-text/texi2html
+	virtual/latex-base"
+
+SITEFILE="50${PN}-gentoo.el"
+
+src_compile() {
+	default
+}
+
+src_install() {
+	emake PREFIX="${ED}/usr" \
+		INFODIR="${ED}/usr/share/info" \
+		LISPDIR="${ED}${SITELISP}/ess" \
+		DOCDIR="${ED}/usr/share/doc/${PF}" \
+		install
+
+	elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+
+	# Most documentation is installed by the package's build system.
+	rm -f "${ED}${SITELISP}/${PN}/ChangeLog"
+	dodoc ChangeLog *NEWS doc/{TODO,ess-intro.pdf}
+	newdoc doc/ChangeLog ChangeLog-doc
+	newdoc lisp/ChangeLog ChangeLog-lisp
+
+	DOC_CONTENTS="Please see /usr/share/doc/${PF} for the complete
+		documentation. Usage hints are in ${SITELISP}/${PN}/ess-site.el ."
+	readme.gentoo_create_doc
+}
diff --git a/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild b/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild
index 589eafa..c6f28fb 100644
--- a/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild
+++ b/app-emulation/ganeti-instance-image/ganeti-instance-image-0.6.ebuild
@@ -25,7 +25,6 @@
 DEPEND=""
 RDEPEND="app-arch/dump
 	>=app-emulation/ganeti-2.0.3
-	|| ( >=sys-apps/coreutils-6.10-r1 sys-apps/mktemp )
 	app-emulation/qemu
 	sys-apps/util-linux
 	sys-fs/multipath-tools
diff --git a/app-emulation/libspectrum/metadata.xml b/app-emulation/libspectrum/metadata.xml
index 1995e49..c54cad0 100644
--- a/app-emulation/libspectrum/metadata.xml
+++ b/app-emulation/libspectrum/metadata.xml
@@ -10,7 +10,7 @@
 	<maintainer>
 		<email>jmfo1982@yahoo.es</email>
 		<description>Proxied Maintainer. Please CC on bugs.</description>
-		<name>José Manuel Ferrer Ortiz</name>
+		<name>José Manuel Ferrer Ortiz</name>
 	</maintainer>
 	<longdescription>
 libspectrum is a library designed to make the input and output of some ZX
diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
index b88b419..375998b 100644
--- a/app-emulation/libvirt/Manifest
+++ b/app-emulation/libvirt/Manifest
@@ -1,4 +1,3 @@
-DIST libvirt-1.2.15.tar.gz 29094868 SHA256 5f88041b8c212f8f687c672fe583108833240d6175b512ce4de92ab6660194c6 SHA512 c5dd3af86e89e3804d6c3b527c6dbd98c79d87d2591725a13af33530e0e9a9a2e9aeb9491844469d44ec4f4d17adb036c76391f964158ada23ec042a75556fbc WHIRLPOOL a43aad4caeff707c8d7a6872ff3c46911c96fd90ece02a7f6ceabb4ccd00e467b5341ab9d922912cc2968a2bb8826e970b253b257c5a8981b37364550f9b3616
-DIST libvirt-1.2.17.tar.gz 29320317 SHA256 e07eaf20b0590fae05ba3b53ad4dac3e5fbd771437563cc78b692f23ddd02fad SHA512 133ee2da30352d5eeb81c3e24f6eaf21c40b5afeb05abece9298956fa9c52c62ebc3468433311853cf2d65894e38e98f5c6744269d2d64fa3b3cf6f4b9b0cc46 WHIRLPOOL 4fdd6554989ea7d32600cc978d2c95582433ac223e933b55d838ba4ddffba2d6444a0d556348681ad36766e73ba2bf9788b37180c980636324b5b6fa093a2347
 DIST libvirt-1.2.18.tar.gz 29412554 SHA256 d5a5ff18af4cced21fed986d28fa0a21b782d256920326bf0ff1c7731eeb6ade SHA512 e89d494066ebec4de4c9a53089f015635b7b5ccf4a10ab9749883cc81f6f9607b18ca91a1bd01a9cdacb3a46de86223f0432fae3954106cb92dd275e5b4138c5 WHIRLPOOL dbbbd627ccb9be154bc680407898cd32dfdbc218a67f54560e6b0f0200cbc157a9aa05834de5d9d23e3b6da0625fd5943b4c8e38f8bb9a6ff920bc5820287bfc
 DIST libvirt-1.2.19.tar.gz 29644247 SHA256 282c141f03331d640020c15f81464b27400e0ee307ef4c5190393b021caedd6e SHA512 2f3f26b90120a39861683f1b5af93ac661ab561e23514c71c2ebfb1ab88da99d25acee9a5d11bec35478e38b9105f3779bffb4d4649f16a91aeccdcaa61e4aa4 WHIRLPOOL 4262beb2248495746d32bc7b16c3eec69d9cba7d4fb3870fcd560bd4d222827cf90eb9cc3df647f3fe10467d1562e72138cbf871adc5f63d4788069e1b9740ac
+DIST libvirt-1.2.20.tar.gz 29725368 SHA256 df0b5d8a150863a86b98cf809a586c91b2d49af25b74a354049ea416b0b27d30 SHA512 2c7f7995d38d15453de99cc34e63db9c39c653fc24a4fd949207e62c0241f2a5ff3ab5505909ffae77f7a91d321396372188aa29124b8271f876d93546c44d07 WHIRLPOOL 553517c8eec3f601987d9a9205668a81ffcaf9081ee0d79de847ce1d2c9bcd9115471adf2022095143d440a07f7d48059cfd88094b7dda7046a784c93c449817
diff --git a/app-emulation/libvirt/files/README.gentoo-r1 b/app-emulation/libvirt/files/README.gentoo-r1
new file mode 100644
index 0000000..74d1e77
--- /dev/null
+++ b/app-emulation/libvirt/files/README.gentoo-r1
@@ -0,0 +1,53 @@
+Important: The openrc libvirtd init script is now broken up into two
+separate services: libvirtd, that solely handles the daemon, and
+libvirt-guests, that takes care of clients during shutdown/restart of the
+host. In order to reenable client handling, edit /etc/conf.d/libvirt-guests
+and enable the service and start it:
+
+	$ rc-update add libvirt-guests
+	$ service libvirt-guests start
+
+
+For the basic networking support (bridged and routed networks) you don't
+need any extra software. For more complex network modes including but not
+limited to NATed network, you can enable the 'virt-network' USE flag. It
+will pull in required runtime dependencies
+
+
+If you are using dnsmasq on your system, you will have to configure
+/etc/dnsmasq.conf to enable the following settings:
+
+	bind-interfaces
+	interface or except-interface
+
+Otherwise you might have issues with your existing DNS server.
+
+
+For openrc users:
+
+	Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
+	libvirtd.
+
+	Use /etc/init.d/libvirt-guests to manage clients on restart/shutdown of
+	the host. The default configuration will suspend and resume running kvm
+	guests with 'managedsave'. This behavior can be changed under
+	/etc/conf.d/libvirt-guests
+
+
+For systemd users:
+
+	Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
+	to control the '--listen' parameter for libvirtd.
+
+	The configuration for the 'libvirt-guests.service' is found under
+	/etc/libvirt/libvirt-guests.conf"
+
+
+If you have built libvirt without policykit support (USE=-policykit), you
+must change the unix sock group and/or perms in /etc/libvirt/libvirtd.conf
+in order to allow normal users to connect to libvirtd.
+
+
+If libvirtd is built with USE=caps, libvirt will now start qemu/kvm VMs
+with non-root privileges. Ensure any resources your VMs use are accessible
+by qemu:qemu.
diff --git a/app-emulation/libvirt/files/libvirt-guests.init b/app-emulation/libvirt/files/libvirt-guests.init
deleted file mode 100644
index c38a0f0..0000000
--- a/app-emulation/libvirt/files/libvirt-guests.init
+++ /dev/null
@@ -1,239 +0,0 @@
-#!/sbin/runscript
-
-description="Virtual Machine Management (libvirt) Guests"
-
-depend() {
-	need libvirtd
-}
-
-# set the default to QEMU
-[ -z "${LIBVIRT_URIS}" ] && LIBVIRT_URIS="qemu:///system"
-
-# default to suspending the VM via managedsave
-case "${LIBVIRT_SHUTDOWN}" in
-	managedsave|shutdown|destroy) ;;
-	*) LIBVIRT_SHUTDOWN="managedsave" ;;
-esac
-
-# default to 500 seconds
-[ -z ${LIBVIRT_MAXWAIT} ] && LIBVIRT_MAXWAIT=500
-
-gueststatefile="/var/lib/libvirt/libvirt-guests.state"
-netstatefile="/var/lib/libvirt/libvirt-net.state"
-
-do_virsh() {
-	local hvuri=$1
-	shift
-
-	# if unset, default to qemu
-	[ -z ${hvuri} ] && hvuri="qemu:///system"
-	# if only qemu was supplied then correct the value
-	[ "xqemu" = x${hvuri} ] && hvuri="qemu:///system"
-
-	# Silence errors because virsh always throws an error about
-	# not finding the hypervisor version when connecting to libvirtd
-	# lastly strip the blank line at the end
-	LC_ALL=C virsh -c ${hvuri} "$@" 2>/dev/null | head -n -1
-}
-
-libvirtd_dom_list() {
-	# Only work with domains by their UUIDs
-	local hvuri=$1
-	shift
-
-	do_virsh "${hvuri}" list --uuid $@
-}
-
-libvirtd_dom_count() {
-	local hvuri=$1
-	shift
-
-	libvirtd_dom_list "${hvuri}" $@ | wc -l
-}
-
-libvirtd_net_list() {
-	# Only work with networks by their UUIDs
-	local hvuri=$1
-	shift
-
-	do_virsh "${hvuri}" net-list --uuid $@
-}
-
-libvirtd_net_count() {
-	local hvuri=$1
-	shift
-
-	libvirtd_net_list "${hvuri}" $@ | wc -l
-}
-
-libvirtd_dom_stop() {
-	# stops all persistent or transient domains for a given URI
-	# $1 - uri
-	# $2 - persisent/transient
-
-	local uri=$1
-	local persist=$2
-	local shutdown_type=${LIBVIRT_SHUTDOWN}
-	local counter=${LIBVIRT_MAXWAIT}
-	local dom_name=
-	local dom_as=
-	local dom_ids=
-	local uuid=
-	local dom_count=
-
-	[ "${persist}" = "--transient" ] && shutdown_type="shutdown"
-	[ -n "${counter}" ] || counter=500
-
-	einfo " Shutting down domain(s) ..."
-
-	# grab all persistent or transient domains running
-	dom_ids=$(libvirtd_dom_list ${uri} ${persist})
-
-	for uuid in ${dom_ids}; do
-		# Get the name
-		dom_name=$(do_virsh ${uri} domname ${uuid})
-		einfo "  ${dom_name}"
-		# Get autostart state
-		dom_as=$(do_virsh ${uri} dominfo ${uuid} | \
-			awk '$1 == "Autostart:" { print $2 }')
-
-		if [ "${persist}" = "--persistent" ]; then
-			# Save our running state only if LIBVIRT_IGNORE_AUTOSTART != yes
-			if  [ "x${LIBVIRT_IGNORE_AUTOSTART}" = "xyes" ] && \
-				[ ${dom_as} = "enabled" ]; then
-				:
-			else
-				echo "${uri} ${uuid}" >> ${gueststatefile}
-			fi
-
-		fi
-
-		# Now let's stop it
-		do_virsh "${uri}" ${shutdown_type} ${uuid} > /dev/null
-
-	done
-
-	dom_count="$(libvirtd_dom_count ${uri} ${persist})"
-	while [ ${dom_count} -gt 0 ] && [ ${counter} -gt 0 ] ; do
-		dom_count="$(libvirtd_dom_count ${uri} ${persist})"
-		sleep 1
-		if [ "${shutdown_type}" = "shutdown" ]; then
-			counter=$((${counter} - 1))
-		fi
-		echo -n "."
-	done
-
-	if [ "${shutdown_type}" = "shutdown" ]; then
-		# grab all domains still running
-		dom_ids=$(libvirtd_dom_list ${uri} ${persist})
-		for uuid in ${dom_ids}; do
-			dom_name=$(do_virsh ${uri} domname ${uuid})
-			eerror "  ${dom_name} forcibly stopped"
-			do_virsh "${uri}" destroy ${uuid} > /dev/null
-		done
-	fi
-}
-
-libvirtd_net_stop() {
-	# stops all persistent or transient domains for a given URI
-	# $1 - uri
-	# $2 - persisent/transient
-
-	local uri=$1
-	local persist=$2
-	local uuid=
-	local net_name=
-
-	if [ "${LIBVIRT_NET_SHUTDOWN}" != "no" ]; then
-
-		einfo " Shutting down network(s):"
-		for uuid in $(libvirtd_net_list ${uri} ${persist}); do
-			net_name=$(do_virsh ${uri} net-name ${uuid})
-			einfo "   ${net_name}"
-
-			if [ "${persist}" = "--persistent" ]; then
-				# Save our running state
-				echo "${uri} ${uuid}" >> ${netstatefile}
-
-			fi
-
-			# Actually stop the network
-			do_virsh qemu net-destroy ${uuid} > /dev/null
-		done
-
-	fi
-}
-
-start() {
-	local uri=
-	local uuid=
-	local name=
-
-	for uri in ${LIBVIRT_URIS}; do
-		do_virsh "${uri}" connect
-		if [ $? -ne 0 ]; then
-			eerror "Failed to connect to '${uri}'. Domains may not start."
-		fi
-	done
-
-	[ ! -e "${netstatefile}" ] && touch "${netstatefile}"
-	[ ! -e "${gueststatefile}" ] && touch "${gueststatefile}"
-
-	# if the user didn't want to start any guests up then respect their wish
-	[ "x${LIBVIRT_START}" = "xno" ] && return 0
-
-	# start networks
-	ebegin "Starting libvirt networks"
-	while read -r line
-	do
-		# tokenize the data
-		read -r uri uuid <<<"${line}"
-		# ignore trash
-		[ -z "${uri}" ] || [ -z "${uuid}" ] && continue
-
-		name=$(do_virsh "${uri}" net-name ${uuid})
-		einfo "  ${name}"
-		do_virsh "${uri}" net-start ${uuid} > /dev/null
-	done <"${netstatefile}"
-	eend 0
-
-	# start domains
-	ebegin "Starting libvirt domains"
-	while read -r line
-	do
-		# tokenize the data
-		read -r uri uuid <<<"${line}"
-		# ignore trash
-		[ -z "${uri}" ] || [ -z "${uuid}" ] && continue
-
-		name=$(do_virsh "${uri}" domname ${uuid})
-		einfo "  ${name}"
-		do_virsh "${uri}" start ${uuid} > /dev/null
-	done <"${gueststatefile}"
-	eend 0
-}
-
-stop() {
-	local counter=
-	local dom_name=
-	local net_name=
-	local dom_ids=
-	local uuid=
-	local dom_count=
-
-	rm -f "${gueststatefile}"
-	[ $? -ne 0 ] && eerror "Unable to save domain state"
-	rm -f "${netstatefile}"
-	[ $? -ne 0 ] && eerror "Unable to save net state"
-
-	for uri in ${LIBVIRT_URIS}; do
-		einfo "Stopping libvirt domains and networks for ${uri}"
-
-		libvirtd_dom_stop "${uri}" "--persistent"
-		libvirtd_dom_stop "${uri}" "--transient"
-		libvirtd_net_stop "${uri}" "--persistent"
-		libvirtd_net_stop "${uri}" "--transient"
-
-		einfo "Done stopping domains and networks for ${uri}"
-	done
-}
diff --git a/app-emulation/libvirt/files/libvirt-guests.init-r1 b/app-emulation/libvirt/files/libvirt-guests.init-r1
new file mode 100644
index 0000000..a8d65f8
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-guests.init-r1
@@ -0,0 +1,235 @@
+#!/sbin/runscript
+
+description="Virtual Machine Management (libvirt) Guests"
+
+depend() {
+	need libvirtd
+}
+
+# set the default to QEMU
+[ -z "${LIBVIRT_URIS}" ] && LIBVIRT_URIS="qemu:///system"
+
+# default to suspending the VM via managedsave
+case "${LIBVIRT_SHUTDOWN}" in
+	managedsave|shutdown|destroy) ;;
+	*) LIBVIRT_SHUTDOWN="managedsave" ;;
+esac
+
+# default to 500 seconds
+[ -z ${LIBVIRT_MAXWAIT} ] && LIBVIRT_MAXWAIT=500
+
+gueststatefile="/var/lib/libvirt/libvirt-guests.state"
+netstatefile="/var/lib/libvirt/libvirt-net.state"
+
+do_virsh() {
+	local hvuri=$1
+	shift
+
+	# if unset, default to qemu
+	[ -z ${hvuri} ] && hvuri="qemu:///system"
+	# if only qemu was supplied then correct the value
+	[ "xqemu" = x${hvuri} ] && hvuri="qemu:///system"
+
+	# Silence errors because virsh always throws an error about
+	# not finding the hypervisor version when connecting to libvirtd
+	# lastly strip the blank line at the end
+	LC_ALL=C virsh -c ${hvuri} "$@" 2>/dev/null | head -n -1
+}
+
+libvirtd_dom_list() {
+	# Only work with domains by their UUIDs
+	local hvuri=$1
+	shift
+
+	do_virsh "${hvuri}" list --uuid $@
+}
+
+libvirtd_dom_count() {
+	local hvuri=$1
+	shift
+
+	libvirtd_dom_list "${hvuri}" $@ | wc -l
+}
+
+libvirtd_net_list() {
+	# Only work with networks by their UUIDs
+	local hvuri=$1
+	shift
+
+	do_virsh "${hvuri}" net-list --uuid $@
+}
+
+libvirtd_net_count() {
+	local hvuri=$1
+	shift
+
+	libvirtd_net_list "${hvuri}" $@ | wc -l
+}
+
+libvirtd_dom_stop() {
+	# stops all persistent or transient domains for a given URI
+	# $1 - uri
+	# $2 - persisent/transient
+
+	local uri=$1
+	local persist=$2
+	local shutdown_type=${LIBVIRT_SHUTDOWN}
+	local counter=${LIBVIRT_MAXWAIT}
+	local dom_name=
+	local dom_as=
+	local dom_ids=
+	local uuid=
+	local dom_count=
+
+	[ "${persist}" = "--transient" ] && shutdown_type="shutdown"
+	[ -n "${counter}" ] || counter=500
+
+	einfo " Shutting down domain(s) ..."
+
+	# grab all persistent or transient domains running
+	dom_ids=$(libvirtd_dom_list ${uri} ${persist})
+
+	for uuid in ${dom_ids}; do
+		# Get the name
+		dom_name=$(do_virsh ${uri} domname ${uuid})
+		einfo "  ${dom_name}"
+		# Get autostart state
+		dom_as=$(do_virsh ${uri} dominfo ${uuid} | \
+			awk '$1 == "Autostart:" { print $2 }')
+
+		if [ "${persist}" = "--persistent" ]; then
+			# Save our running state only if LIBVIRT_IGNORE_AUTOSTART != yes
+			if  [ "x${LIBVIRT_IGNORE_AUTOSTART}" = "xyes" ] && \
+				[ ${dom_as} = "enabled" ]; then
+				:
+			else
+				echo "${uri} ${uuid}" >> ${gueststatefile}
+			fi
+
+		fi
+
+		# Now let's stop it
+		do_virsh "${uri}" ${shutdown_type} ${uuid} > /dev/null
+
+	done
+
+	dom_count="$(libvirtd_dom_count ${uri} ${persist})"
+	while [ ${dom_count} -gt 0 ] && [ ${counter} -gt 0 ] ; do
+		dom_count="$(libvirtd_dom_count ${uri} ${persist})"
+		sleep 1
+		if [ "${shutdown_type}" = "shutdown" ]; then
+			counter=$((${counter} - 1))
+		fi
+		echo -n "."
+	done
+
+	if [ "${shutdown_type}" = "shutdown" ]; then
+		# grab all domains still running
+		dom_ids=$(libvirtd_dom_list ${uri} ${persist})
+		for uuid in ${dom_ids}; do
+			dom_name=$(do_virsh ${uri} domname ${uuid})
+			eerror "  ${dom_name} forcibly stopped"
+			do_virsh "${uri}" destroy ${uuid} > /dev/null
+		done
+	fi
+}
+
+libvirtd_net_stop() {
+	# stops all persistent or transient domains for a given URI
+	# $1 - uri
+	# $2 - persisent/transient
+
+	local uri=$1
+	local persist=$2
+	local uuid=
+	local net_name=
+
+	if [ "${LIBVIRT_NET_SHUTDOWN}" != "no" ]; then
+
+		einfo " Shutting down network(s):"
+		for uuid in $(libvirtd_net_list ${uri} ${persist}); do
+			net_name=$(do_virsh ${uri} net-name ${uuid})
+			einfo "   ${net_name}"
+
+			if [ "${persist}" = "--persistent" ]; then
+				# Save our running state
+				echo "${uri} ${uuid}" >> ${netstatefile}
+
+			fi
+
+			# Actually stop the network
+			do_virsh qemu net-destroy ${uuid} > /dev/null
+		done
+
+	fi
+}
+
+start() {
+	local uri=
+	local uuid=
+	local name=
+
+	for uri in ${LIBVIRT_URIS}; do
+		do_virsh "${uri}" connect
+		if [ $? -ne 0 ]; then
+			eerror "Failed to connect to '${uri}'. Domains may not start."
+		fi
+	done
+
+	[ ! -e "${netstatefile}" ] && touch "${netstatefile}"
+	[ ! -e "${gueststatefile}" ] && touch "${gueststatefile}"
+
+	# if the user didn't want to start any guests up then respect their wish
+	[ "x${LIBVIRT_START}" = "xno" ] && return 0
+
+	# start networks
+	ebegin "Starting libvirt networks"
+	while read -r uri uuid
+	do
+		# ignore trash
+		[ -z "${uri}" ] || [ -z "${uuid}" ] && continue
+
+		name=$(do_virsh "${uri}" net-name ${uuid})
+		einfo "  ${name}"
+		do_virsh "${uri}" net-start ${uuid} > /dev/null
+	done <"${netstatefile}"
+	eend 0
+
+	# start domains
+	ebegin "Starting libvirt domains"
+	while read -r uri uuid
+	do
+		# ignore trash
+		[ -z "${uri}" ] || [ -z "${uuid}" ] && continue
+
+		name=$(do_virsh "${uri}" domname ${uuid})
+		einfo "  ${name}"
+		do_virsh "${uri}" start ${uuid} > /dev/null
+	done <"${gueststatefile}"
+	eend 0
+}
+
+stop() {
+	local counter=
+	local dom_name=
+	local net_name=
+	local dom_ids=
+	local uuid=
+	local dom_count=
+
+	rm -f "${gueststatefile}"
+	[ $? -ne 0 ] && eerror "Unable to save domain state"
+	rm -f "${netstatefile}"
+	[ $? -ne 0 ] && eerror "Unable to save net state"
+
+	for uri in ${LIBVIRT_URIS}; do
+		einfo "Stopping libvirt domains and networks for ${uri}"
+
+		libvirtd_dom_stop "${uri}" "--persistent"
+		libvirtd_dom_stop "${uri}" "--transient"
+		libvirtd_net_stop "${uri}" "--persistent"
+		libvirtd_net_stop "${uri}" "--transient"
+
+		einfo "Done stopping domains and networks for ${uri}"
+	done
+}
diff --git a/app-emulation/libvirt/libvirt-1.2.15-r1.ebuild b/app-emulation/libvirt/libvirt-1.2.15-r1.ebuild
deleted file mode 100644
index f8c4dec..0000000
--- a/app-emulation/libvirt/libvirt-1.2.15-r1.ebuild
+++ /dev/null
@@ -1,464 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-AUTOTOOLIZE=yes
-
-MY_P="${P/_rc/-rc}"
-
-inherit eutils user autotools linux-info systemd readme.gentoo
-
-BACKPORTS=""
-
-if [[ ${PV} = *9999* ]]; then
-	inherit git-r3
-	EGIT_REPO_URI="git://libvirt.org/libvirt.git"
-	SRC_URI=""
-	KEYWORDS=""
-	SLOT="0"
-else
-	# Versions with 4 numbers are stable updates:
-	if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
-		SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
-	else
-		SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
-	fi
-	SRC_URI+=" ${BACKPORTS:+
-		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
-		https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
-	KEYWORDS="amd64 x86"
-	SLOT="0/${PV}"
-fi
-S="${WORKDIR}/${P%_rc*}"
-
-DESCRIPTION="C toolkit to manipulate virtual machines"
-HOMEPAGE="http://www.libvirt.org/"
-LICENSE="LGPL-2.1"
-# TODO: Reenable IUSE wireshark-plugins
-IUSE="audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm lxc \
-	+macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
-	selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
-	elibc_glibc systemd"
-REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
-	lxc? ( caps libvirtd )
-	openvz? ( libvirtd )
-	qemu? ( libvirtd )
-	uml? ( libvirtd )
-	vepa? ( macvtap )
-	virtualbox? ( libvirtd )
-	xen? ( libvirtd )
-	virt-network? ( libvirtd )
-	firewalld? ( virt-network )"
-
-# gettext.sh command is used by the libvirt command wrappers, and it's
-# non-optional, so put it into RDEPEND.
-# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
-# package will use 3 by default. Since we don't have slot pinning in an API,
-# we must go with the most recent
-RDEPEND="sys-libs/readline:=
-	sys-libs/ncurses:0=
-	>=net-misc/curl-7.18.0
-	dev-libs/libgcrypt:0
-	>=dev-libs/libxml2-2.7.6
-	dev-libs/libnl:3
-	>=net-libs/gnutls-1.0.25
-	net-libs/libssh2
-	sys-apps/dmidecode
-	>=sys-apps/util-linux-2.17
-	sys-devel/gettext
-	>=net-analyzer/netcat6-1.0-r2
-	app-misc/scrub
-	audit? ( sys-process/audit )
-	avahi? ( >=net-dns/avahi-0.6[dbus] )
-	caps? ( sys-libs/libcap-ng )
-	fuse? ( >=sys-fs/fuse-2.8.6 )
-	glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
-	iscsi? ( sys-block/open-iscsi )
-	lxc? ( !systemd? ( sys-power/pm-utils ) )
-	lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
-	nfs? ( net-fs/nfs-utils )
-	numa? (
-		>sys-process/numactl-2.0.2
-		sys-process/numad
-	)
-	openvz? ( sys-kernel/openvz-sources:* )
-	parted? (
-		>=sys-block/parted-1.8[device-mapper]
-		sys-fs/lvm2
-	)
-	pcap? ( >=net-libs/libpcap-1.0.0 )
-	policykit? ( >=sys-auth/polkit-0.9 )
-	qemu? (
-		>=app-emulation/qemu-0.13.0
-		dev-libs/yajl
-		!systemd? ( sys-power/pm-utils )
-	)
-	rbd? ( sys-cluster/ceph )
-	sasl? ( dev-libs/cyrus-sasl )
-	selinux? ( >=sys-libs/libselinux-2.0.85 )
-	systemd? ( sys-apps/systemd )
-	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
-	wireshark-plugins? ( net-analyzer/wireshark:= )
-	xen? ( app-emulation/xen-tools app-emulation/xen )
-	udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
-	virt-network? ( net-dns/dnsmasq[script]
-		>=net-firewall/iptables-1.4.10[ipv6]
-		net-misc/radvd
-		net-firewall/ebtables
-		sys-apps/iproute2[-minimal]
-		firewalld? ( net-firewall/firewalld )
-	)
-	elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
-
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	app-text/xhtml1
-	dev-lang/perl
-	dev-perl/XML-XPath
-	dev-libs/libxslt"
-
-DOC_CONTENTS="For the basic networking support (bridged and routed networks)
-you don't need any extra software. For more complex network modes
-including but not limited to NATed network, you can enable the
-'virt-network' USE flag.\n\n
-If you are using dnsmasq on your system, you will have
-to configure /etc/dnsmasq.conf to enable the following settings:\n\n
-	bind-interfaces\n
-	interface or except-interface\n\n
-Otherwise you might have issues with your existing DNS server."
-
-LXC_CONFIG_CHECK="
-	~CGROUPS
-	~CGROUP_FREEZER
-	~CGROUP_DEVICE
-	~CGROUP_CPUACCT
-	~CGROUP_SCHED
-	~CGROUP_PERF
-	~BLK_CGROUP
-	~NET_CLS_CGROUP
-	~CGROUP_NET_PRIO
-	~CPUSETS
-	~NAMESPACES
-	~UTS_NS
-	~IPC_NS
-	~PID_NS
-	~NET_NS
-	~USER_NS
-	~DEVPTS_MULTIPLE_INSTANCES
-	~VETH
-	~MACVLAN
-	~POSIX_MQUEUE
-	~SECURITYFS
-	~!GRKERNSEC_CHROOT_MOUNT
-	~!GRKERNSEC_CHROOT_DOUBLE
-	~!GRKERNSEC_CHROOT_PIVOT
-	~!GRKERNSEC_CHROOT_CHMOD
-	~!GRKERNSEC_CHROOT_CAPS
-"
-
-VIRTNET_CONFIG_CHECK="
-	~BRIDGE_NF_EBTABLES
-	~BRIDGE_EBT_MARK_T
-	~NETFILTER_ADVANCED
-	~NETFILTER_XT_TARGET_CHECKSUM
-	~NETFILTER_XT_CONNMARK
-	~NETFILTER_XT_MARK
-"
-
-BWLMT_CONFIG_CHECK="
-	~BRIDGE_EBT_T_NAT
-	~NET_SCH_HTB
-	~NET_SCH_SFQ
-	~NET_SCH_INGRESS
-	~NET_CLS_FW
-	~NET_CLS_U32
-	~NET_ACT_POLICE
-"
-
-MACVTAP_CONFIG_CHECK=" ~MACVTAP"
-
-LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
-
-ERROR_USER_NS="Optional depending on LXC configuration."
-
-pkg_setup() {
-	enewgroup qemu 77
-	enewuser qemu 77 -1 -1 qemu kvm
-
-	# Some people used the masked ebuild which was not adding the qemu
-	# user to the kvm group originally. This results in VMs failing to
-	# start for some users. bug #430808
-	egetent group kvm | grep -q qemu
-	if [[ $? -ne 0 ]]; then
-		gpasswd -a qemu kvm
-	fi
-
-	# Handle specific kernel versions for different features
-	kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
-	kernel_is ge 3 6 &&	LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
-
-	CONFIG_CHECK=""
-	use fuse && CONFIG_CHECK+=" ~FUSE_FS"
-	use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
-	use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
-	use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
-	use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
-	# Bandwidth Limiting Support
-	use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
-	if [[ -n ${CONFIG_CHECK} ]]; then
-		linux-info_pkg_setup
-	fi
-}
-
-src_prepare() {
-	touch "${S}/.mailmap"
-
-	if [[ ${PV} = *9999* ]]; then
-		# git checkouts require bootstrapping to create the configure script.
-		# Additionally the submodules must be cloned to the right locations
-		# bug #377279
-		./bootstrap || die "bootstrap failed"
-		(
-			git submodule status | sed 's/^[ +-]//;s/ .*//'
-			git hash-object bootstrap.conf
-		) >.git-module-status
-	fi
-
-	epatch "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch
-
-	[[ -n ${BACKPORTS} ]] && \
-		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
-			EPATCH_SOURCE="${WORKDIR}/patches" epatch
-
-	epatch_user
-
-	[[ -n ${AUTOTOOLIZE} ]] && eautoreconf
-
-	# Tweak the init script
-	local avahi_init=
-	local iscsi_init=
-	local rbd_init=
-	local firewalld_init=
-	cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init"
-	use avahi && avahi_init='avahi-daemon'
-	use iscsi && iscsi_init='iscsid'
-	use rbd && rbd_init='ceph'
-	use firewalld && firewalld_init='need firewalld'
-
-	sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
-}
-
-src_configure() {
-	local myconf=""
-
-	## enable/disable daemon, otherwise client only utils
-	myconf+=" $(use_with libvirtd)"
-
-	## enable/disable the daemon using avahi to find VMs
-	myconf+=" $(use_with avahi)"
-
-	## hypervisors on the local host
-	myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
-	myconf+=" --without-xenapi"
-	if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
-		myconf+=" --with-libxl"
-	else
-		myconf+=" --without-libxl"
-	fi
-	myconf+=" $(use_with openvz)"
-	myconf+=" $(use_with lxc)"
-	if use virtualbox && has_version app-emulation/virtualbox-ose; then
-		myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
-	else
-		myconf+=" $(use_with virtualbox vbox)"
-	fi
-	myconf+=" $(use_with uml)"
-	myconf+=" $(use_with qemu)"
-	myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
-	myconf+=" $(use_with phyp)"
-	myconf+=" --with-esx"
-	myconf+=" --with-vmware"
-
-	## additional host drivers
-	myconf+=" $(use_with virt-network network)"
-	myconf+=" --with-storage-fs"
-	myconf+=" $(use_with lvm storage-lvm)"
-	myconf+=" $(use_with iscsi storage-iscsi)"
-	myconf+=" $(use_with parted storage-disk)"
-	mycond+=" $(use_with glusterfs)"
-	mycond+=" $(use_with glusterfs storage-gluster)"
-	myconf+=" $(use_with lvm storage-mpath)"
-	myconf+=" $(use_with rbd storage-rbd)"
-	myconf+=" $(use_with numa numactl)"
-	myconf+=" $(use_with numa numad)"
-	myconf+=" $(use_with selinux)"
-	myconf+=" $(use_with fuse)"
-
-	# udev for device support details
-	myconf+=" $(use_with udev)"
-	myconf+=" --without-hal"
-
-	# linux capability support so we don't need privileged accounts
-	myconf+=" $(use_with caps capng)"
-
-	## auth stuff
-	myconf+=" $(use_with policykit polkit)"
-	myconf+=" $(use_with sasl)"
-
-	# network bits
-	myconf+=" $(use_with macvtap)"
-	myconf+=" $(use_with pcap libpcap)"
-	myconf+=" $(use_with vepa virtualport)"
-	myconf+=" $(use_with firewalld)"
-
-	## other
-	myconf+=" $(use_enable nls)"
-
-	# user privilege bits fir qemu/kvm
-	if use caps; then
-		myconf+=" --with-qemu-user=qemu"
-		myconf+=" --with-qemu-group=qemu"
-	else
-		myconf+=" --with-qemu-user=root"
-		myconf+=" --with-qemu-group=root"
-	fi
-
-	# audit support
-	myconf+=" $(use_with audit)"
-
-	# wireshark dissector
-	myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
-
-	## stuff we don't yet support
-	myconf+=" --without-netcf"
-
-	# locking support
-	myconf+=" --without-sanlock"
-
-	# systemd unit files
-	myconf+=" $(use_with systemd systemd-daemon)"
-	use systemd && myconf+=" --with-init-script=systemd"
-
-	# this is a nasty trick to work around the problem in bug
-	# #275073. The reason why we don't solve this properly is that
-	# it'll require us to rebuild autotools (and we don't really want
-	# to do that right now). The proper solution has been sent
-	# upstream and should hopefully land in 0.7.7, in the mean time,
-	# mime the same functionality with this.
-	case ${CHOST} in
-		*cygwin* | *mingw* )
-			;;
-		*)
-			ac_cv_prog_WINDRES=no
-			;;
-	esac
-
-	econf \
-		${myconf} \
-		--disable-static \
-		--disable-werror \
-		--with-remote \
-		--docdir=/usr/share/doc/${PF} \
-		--localstatedir=/var
-
-	if [[ ${PV} = *9999* ]]; then
-		# Restore gnulib's config.sub and config.guess
-		# bug #377279
-		(cd .gnulib && git reset --hard > /dev/null)
-	fi
-}
-
-src_test() {
-	# Explicitly allow parallel build of tests
-	export VIR_TEST_DEBUG=1
-	HOME="${T}" emake check || die "tests failed"
-}
-
-src_install() {
-	emake install \
-		DESTDIR="${D}" \
-		HTML_DIR=/usr/share/doc/${PF}/html \
-		DOCS_DIR=/usr/share/doc/${PF} \
-		EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
-		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
-		|| die "emake install failed"
-
-	find "${D}" -name '*.la' -delete || die
-
-	# Remove bogus, empty directories. They are either not used, or
-	# libvirtd is able to create them on demand
-	rm -rf "${D}"/etc/sysconf
-	rm -rf "${D}"/var/cache
-	rm -rf "${D}"/var/run
-	rm -rf "${D}"/var/log
-
-	use libvirtd || return 0
-	# From here, only libvirtd-related instructions, be warned!
-
-	use systemd && systemd_install_serviced \
-		"${FILESDIR}"/libvirtd.service.conf libvirtd.service
-
-	systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
-
-	newinitd "${S}/libvirtd.init" libvirtd || die
-	newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
-	newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
-
-	readme.gentoo_create_doc
-}
-
-pkg_preinst() {
-	# we only ever want to generate this once
-	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
-		rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
-	fi
-
-	# We really don't want to use or support old PolicyKit cause it
-	# screws with the new polkit integration
-	if has_version sys-auth/policykit; then
-		rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
-	fi
-
-	# Only sysctl files ending in .conf work
-	dodir /etc/sysctl.d
-	mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
-}
-
-pkg_postinst() {
-	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
-		touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
-	fi
-
-	if ! use policykit; then
-		elog "To allow normal users to connect to libvirtd you must change the"
-		elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
-	fi
-
-	use libvirtd || return 0
-	# From here, only libvirtd-related instructions, be warned!
-
-	readme.gentoo_print_elog
-
-	if use caps && use qemu; then
-		elog "libvirt will now start qemu/kvm VMs with non-root privileges."
-		elog "Ensure any resources your VMs use are accessible by qemu:qemu"
-	fi
-
-	if [[ -n "${REPLACING_VERSIONS}" ]]; then
-		elog ""
-		elog "The systemd service-file configuration under /etc/sysconfig has"
-		elog "been removed. Please use"
-		elog "    /etc/systemd/system/libvirtd.service.d/00gentoo.conf"
-		elog "to control the '--listen' parameter for libvirtd. The configuration"
-		elog "for the libvirt-guests.service is now found under"
-		elog "    /etc/libvirt/libvirt-guests.conf"
-		elog "The openrc configuration has not been changed. Thus no action is"
-		elog "required for the openrc service manager."
-		elog ""
-	fi
-}
diff --git a/app-emulation/libvirt/libvirt-1.2.17-r5.ebuild b/app-emulation/libvirt/libvirt-1.2.17-r5.ebuild
deleted file mode 100644
index f60a610..0000000
--- a/app-emulation/libvirt/libvirt-1.2.17-r5.ebuild
+++ /dev/null
@@ -1,480 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-AUTOTOOLIZE=yes
-
-MY_P="${P/_rc/-rc}"
-
-inherit eutils user autotools linux-info systemd readme.gentoo
-
-BACKPORTS=""
-
-if [[ ${PV} = *9999* ]]; then
-	inherit git-r3
-	EGIT_REPO_URI="git://libvirt.org/libvirt.git"
-	SRC_URI=""
-	KEYWORDS=""
-	SLOT="0"
-else
-	# Versions with 4 numbers are stable updates:
-	if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
-		SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
-	else
-		SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
-	fi
-	SRC_URI+=" ${BACKPORTS:+
-		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
-		https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
-	KEYWORDS="~amd64 ~x86"
-	SLOT="0/${PV}"
-fi
-S="${WORKDIR}/${P%_rc*}"
-
-DESCRIPTION="C toolkit to manipulate virtual machines"
-HOMEPAGE="http://www.libvirt.org/"
-LICENSE="LGPL-2.1"
-# TODO: Reenable IUSE wireshark-plugins
-IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
-	lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
-	selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
-	elibc_glibc systemd"
-REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
-	lxc? ( caps libvirtd )
-	openvz? ( libvirtd )
-	qemu? ( libvirtd )
-	uml? ( libvirtd )
-	vepa? ( macvtap )
-	virtualbox? ( libvirtd )
-	xen? ( libvirtd )
-	virt-network? ( libvirtd )
-	firewalld? ( virt-network )"
-
-# gettext.sh command is used by the libvirt command wrappers, and it's
-# non-optional, so put it into RDEPEND.
-# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
-# package will use 3 by default. Since we don't have slot pinning in an API,
-# we must go with the most recent
-RDEPEND="sys-libs/readline:=
-	sys-libs/ncurses:0=
-	>=net-misc/curl-7.18.0
-	net-firewall/ebtables
-	>=net-firewall/iptables-1.4.10[ipv6]
-	dev-libs/libgcrypt:0
-	>=dev-libs/libxml2-2.7.6
-	dev-libs/libnl:3
-	>=net-libs/gnutls-1.0.25
-	net-libs/libssh2
-	sys-apps/dmidecode
-	>=sys-apps/util-linux-2.17
-	sys-devel/gettext
-	>=net-analyzer/netcat6-1.0-r2
-	app-misc/scrub
-	apparmor? ( sys-libs/libapparmor )
-	audit? ( sys-process/audit )
-	avahi? ( >=net-dns/avahi-0.6[dbus] )
-	caps? ( sys-libs/libcap-ng )
-	fuse? ( >=sys-fs/fuse-2.8.6 )
-	glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
-	iscsi? ( sys-block/open-iscsi )
-	lxc? ( !systemd? ( sys-power/pm-utils ) )
-	lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
-	nfs? ( net-fs/nfs-utils )
-	numa? (
-		>sys-process/numactl-2.0.2
-		sys-process/numad
-	)
-	openvz? ( sys-kernel/openvz-sources:* )
-	parted? (
-		>=sys-block/parted-1.8[device-mapper]
-		sys-fs/lvm2
-	)
-	pcap? ( >=net-libs/libpcap-1.0.0 )
-	policykit? ( >=sys-auth/polkit-0.9 )
-	qemu? (
-		>=app-emulation/qemu-0.13.0
-		dev-libs/yajl
-		!systemd? ( sys-power/pm-utils )
-	)
-	rbd? ( sys-cluster/ceph )
-	sasl? ( dev-libs/cyrus-sasl )
-	selinux? ( >=sys-libs/libselinux-2.0.85 )
-	systemd? ( sys-apps/systemd )
-	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
-	wireshark-plugins? ( net-analyzer/wireshark:= )
-	xen? ( app-emulation/xen-tools app-emulation/xen )
-	udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
-	virt-network? ( net-dns/dnsmasq[script]
-		net-misc/radvd
-		sys-apps/iproute2[-minimal]
-		firewalld? ( net-firewall/firewalld )
-	)
-	elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
-
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	app-text/xhtml1
-	dev-lang/perl
-	dev-perl/XML-XPath
-	dev-libs/libxslt"
-
-# gentoo.readme stuff:
-DISABLE_AUTOFORMATTING=true
-DOC_CONTENTS="For the basic networking support (bridged and routed networks) you don't
-need any extra software. For more complex network modes including but not
-limited to NATed network, you can enable the 'virt-network' USE flag.
-
-If you are using dnsmasq on your system, you will have to configure
-/etc/dnsmasq.conf to enable the following settings:
-	bind-interfaces
-	interface or except-interface
-Otherwise you might have issues with your existing DNS server.
-
-For openrc users:
-
-	Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
-	libvirtd.
-
-	The default configuration will suspend and resume running kvm guests
-	with 'managedsave'. This behavior can be changed under
-	/etc/conf.d/libvirtd
-
-For systemd users:
-
-	Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
-	to control the '--listen' parameter for libvirtd.
-
-	The configuration for the 'libvirt-guests.service' is found under
-	/etc/libvirt/libvirt-guests.conf"
-
-! use policykit && DOC_CONTENTS+="
-
-To allow normal users to connect to libvirtd you must change the unix sock
-group and/or perms in /etc/libvirt/libvirtd.conf"
-
-use caps && use qemu && DOC_CONTENTS+="
-
-libvirt will now start qemu/kvm VMs with non-root privileges. Ensure any
-resources your VMs use are accessible by qemu:qemu"
-
-LXC_CONFIG_CHECK="
-	~CGROUPS
-	~CGROUP_FREEZER
-	~CGROUP_DEVICE
-	~CGROUP_CPUACCT
-	~CGROUP_SCHED
-	~CGROUP_PERF
-	~BLK_CGROUP
-	~NET_CLS_CGROUP
-	~CGROUP_NET_PRIO
-	~CPUSETS
-	~NAMESPACES
-	~UTS_NS
-	~IPC_NS
-	~PID_NS
-	~NET_NS
-	~USER_NS
-	~DEVPTS_MULTIPLE_INSTANCES
-	~VETH
-	~MACVLAN
-	~POSIX_MQUEUE
-	~SECURITYFS
-	~!GRKERNSEC_CHROOT_MOUNT
-	~!GRKERNSEC_CHROOT_DOUBLE
-	~!GRKERNSEC_CHROOT_PIVOT
-	~!GRKERNSEC_CHROOT_CHMOD
-	~!GRKERNSEC_CHROOT_CAPS
-"
-
-VIRTNET_CONFIG_CHECK="
-	~BRIDGE_NF_EBTABLES
-	~BRIDGE_EBT_MARK_T
-	~NETFILTER_ADVANCED
-	~NETFILTER_XT_TARGET_CHECKSUM
-	~NETFILTER_XT_CONNMARK
-	~NETFILTER_XT_MARK
-"
-
-BWLMT_CONFIG_CHECK="
-	~BRIDGE_EBT_T_NAT
-	~NET_SCH_HTB
-	~NET_SCH_SFQ
-	~NET_SCH_INGRESS
-	~NET_CLS_FW
-	~NET_CLS_U32
-	~NET_ACT_POLICE
-"
-
-MACVTAP_CONFIG_CHECK=" ~MACVTAP"
-
-LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
-
-ERROR_USER_NS="Optional depending on LXC configuration."
-
-pkg_setup() {
-	enewgroup qemu 77
-	enewuser qemu 77 -1 -1 qemu kvm
-
-	# Some people used the masked ebuild which was not adding the qemu
-	# user to the kvm group originally. This results in VMs failing to
-	# start for some users. bug #430808
-	egetent group kvm | grep -q qemu
-	if [[ $? -ne 0 ]]; then
-		gpasswd -a qemu kvm
-	fi
-
-	# Handle specific kernel versions for different features
-	kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
-	kernel_is ge 3 6 &&	LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
-
-	CONFIG_CHECK=""
-	use fuse && CONFIG_CHECK+=" ~FUSE_FS"
-	use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
-	use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
-	use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
-	use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
-	# Bandwidth Limiting Support
-	use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
-	if [[ -n ${CONFIG_CHECK} ]]; then
-		linux-info_pkg_setup
-	fi
-}
-
-src_prepare() {
-	touch "${S}/.mailmap"
-
-	if [[ ${PV} = *9999* ]]; then
-		# git checkouts require bootstrapping to create the configure script.
-		# Additionally the submodules must be cloned to the right locations
-		# bug #377279
-		./bootstrap || die "bootstrap failed"
-		(
-			git submodule status | sed 's/^[ +-]//;s/ .*//'
-			git hash-object bootstrap.conf
-		) >.git-module-status
-	fi
-
-	epatch \
-		"${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
-		"${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
-		"${FILESDIR}"/${P}-fix_paths_for_apparmor.patch
-
-	[[ -n ${BACKPORTS} ]] && \
-		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
-			EPATCH_SOURCE="${WORKDIR}/patches" epatch
-
-	epatch_user
-
-	[[ -n ${AUTOTOOLIZE} ]] && eautoreconf
-
-	# Tweak the init script
-	local avahi_init=
-	local iscsi_init=
-	local rbd_init=
-	local firewalld_init=
-	cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init"
-	use avahi && avahi_init='avahi-daemon'
-	use iscsi && iscsi_init='iscsid'
-	use rbd && rbd_init='ceph'
-	use firewalld && firewalld_init='need firewalld'
-
-	sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
-}
-
-src_configure() {
-	local myconf=""
-
-	## enable/disable daemon, otherwise client only utils
-	myconf+=" $(use_with libvirtd)"
-
-	## enable/disable the daemon using avahi to find VMs
-	myconf+=" $(use_with avahi)"
-
-	## hypervisors on the local host
-	myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
-	myconf+=" --without-xenapi"
-	if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
-		myconf+=" --with-libxl"
-	else
-		myconf+=" --without-libxl"
-	fi
-	myconf+=" $(use_with openvz)"
-	myconf+=" $(use_with lxc)"
-	if use virtualbox && has_version app-emulation/virtualbox-ose; then
-		myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
-	else
-		myconf+=" $(use_with virtualbox vbox)"
-	fi
-	myconf+=" $(use_with uml)"
-	myconf+=" $(use_with qemu)"
-	myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
-	myconf+=" $(use_with phyp)"
-	myconf+=" --with-esx"
-	myconf+=" --with-vmware"
-
-	## additional host drivers
-	myconf+=" $(use_with apparmor)"
-	myconf+=" $(use_with apparmor apparmor-profiles)"
-	myconf+=" $(use_with virt-network network)"
-	myconf+=" --with-storage-fs"
-	myconf+=" $(use_with lvm storage-lvm)"
-	myconf+=" $(use_with iscsi storage-iscsi)"
-	myconf+=" $(use_with parted storage-disk)"
-	mycond+=" $(use_with glusterfs)"
-	mycond+=" $(use_with glusterfs storage-gluster)"
-	myconf+=" $(use_with lvm storage-mpath)"
-	myconf+=" $(use_with rbd storage-rbd)"
-	myconf+=" $(use_with numa numactl)"
-	myconf+=" $(use_with numa numad)"
-	myconf+=" $(use_with selinux)"
-	myconf+=" $(use_with fuse)"
-
-	# udev for device support details
-	myconf+=" $(use_with udev)"
-	myconf+=" --without-hal"
-
-	# linux capability support so we don't need privileged accounts
-	myconf+=" $(use_with caps capng)"
-
-	## auth stuff
-	myconf+=" $(use_with policykit polkit)"
-	myconf+=" $(use_with sasl)"
-
-	# network bits
-	myconf+=" $(use_with macvtap)"
-	myconf+=" $(use_with pcap libpcap)"
-	myconf+=" $(use_with vepa virtualport)"
-	myconf+=" $(use_with firewalld)"
-
-	## other
-	myconf+=" $(use_enable nls)"
-
-	# user privilege bits fir qemu/kvm
-	if use caps; then
-		myconf+=" --with-qemu-user=qemu"
-		myconf+=" --with-qemu-group=qemu"
-	else
-		myconf+=" --with-qemu-user=root"
-		myconf+=" --with-qemu-group=root"
-	fi
-
-	# audit support
-	myconf+=" $(use_with audit)"
-
-	# wireshark dissector
-	myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
-
-	## stuff we don't yet support
-	myconf+=" --without-netcf"
-
-	# locking support
-	myconf+=" --without-sanlock"
-
-	# systemd unit files
-	myconf+=" $(use_with systemd systemd-daemon)"
-	use systemd && myconf+=" --with-init-script=systemd"
-
-	# this is a nasty trick to work around the problem in bug
-	# #275073. The reason why we don't solve this properly is that
-	# it'll require us to rebuild autotools (and we don't really want
-	# to do that right now). The proper solution has been sent
-	# upstream and should hopefully land in 0.7.7, in the mean time,
-	# mime the same functionality with this.
-	case ${CHOST} in
-		*cygwin* | *mingw* )
-			;;
-		*)
-			ac_cv_prog_WINDRES=no
-			;;
-	esac
-
-	econf \
-		${myconf} \
-		--disable-static \
-		--disable-werror \
-		--with-remote \
-		--docdir=/usr/share/doc/${PF} \
-		--localstatedir=/var
-
-	if [[ ${PV} = *9999* ]]; then
-		# Restore gnulib's config.sub and config.guess
-		# bug #377279
-		(cd .gnulib && git reset --hard > /dev/null)
-	fi
-}
-
-src_test() {
-	# Explicitly allow parallel build of tests
-	export VIR_TEST_DEBUG=1
-	HOME="${T}" emake check || die "tests failed"
-}
-
-src_install() {
-	emake install \
-		DESTDIR="${D}" \
-		HTML_DIR=/usr/share/doc/${PF}/html \
-		DOCS_DIR=/usr/share/doc/${PF} \
-		EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
-		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
-		|| die "emake install failed"
-
-	find "${D}" -name '*.la' -delete || die
-
-	# Remove bogus, empty directories. They are either not used, or
-	# libvirtd is able to create them on demand
-	rm -rf "${D}"/etc/sysconfig
-	rm -rf "${D}"/var/cache
-	rm -rf "${D}"/var/run
-	rm -rf "${D}"/var/log
-
-	use libvirtd || return 0
-	# From here, only libvirtd-related instructions, be warned!
-
-	use systemd && systemd_install_serviced \
-		"${FILESDIR}"/libvirtd.service.conf libvirtd.service
-
-	systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
-
-	newinitd "${S}/libvirtd.init" libvirtd || die
-	newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
-	newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
-
-	readme.gentoo_create_doc
-}
-
-pkg_preinst() {
-	# we only ever want to generate this once
-	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
-		rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
-	fi
-
-	# We really don't want to use or support old PolicyKit cause it
-	# screws with the new polkit integration
-	if has_version sys-auth/policykit; then
-		rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
-	fi
-
-	# Only sysctl files ending in .conf work
-	dodir /etc/sysctl.d
-	mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
-}
-
-pkg_postinst() {
-	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
-		touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
-	fi
-
-	use libvirtd || return 0
-	# From here, only libvirtd-related instructions, be warned!
-
-	if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.17-r2 ${REPLACING_VERSIONS} ]]; then
-		FORCE_PRINT_ELOG=true
-	fi
-
-	readme.gentoo_print_elog
-}
diff --git a/app-emulation/libvirt/libvirt-1.2.18-r1.ebuild b/app-emulation/libvirt/libvirt-1.2.18-r1.ebuild
index 565007a..9ffa581 100644
--- a/app-emulation/libvirt/libvirt-1.2.18-r1.ebuild
+++ b/app-emulation/libvirt/libvirt-1.2.18-r1.ebuild
@@ -325,8 +325,8 @@
 	myconf+=" $(use_with lvm storage-lvm)"
 	myconf+=" $(use_with iscsi storage-iscsi)"
 	myconf+=" $(use_with parted storage-disk)"
-	mycond+=" $(use_with glusterfs)"
-	mycond+=" $(use_with glusterfs storage-gluster)"
+	myconf+=" $(use_with glusterfs)"
+	myconf+=" $(use_with glusterfs storage-gluster)"
 	myconf+=" $(use_with lvm storage-mpath)"
 	myconf+=" $(use_with rbd storage-rbd)"
 	myconf+=" $(use_with numa numactl)"
diff --git a/app-emulation/libvirt/libvirt-1.2.19-r1.ebuild b/app-emulation/libvirt/libvirt-1.2.19-r1.ebuild
new file mode 100644
index 0000000..cb757f0
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-1.2.19-r1.ebuild
@@ -0,0 +1,381 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user autotools-utils linux-info systemd readme.gentoo
+
+BACKPORTS=""
+
+if [[ ${PV} = *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+	SRC_URI=""
+	KEYWORDS=""
+	SLOT="0"
+else
+	# Versions with 4 numbers are stable updates:
+	if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+		SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz"
+	else
+		SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
+	fi
+	SRC_URI+=" ${BACKPORTS:+
+		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
+		https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
+	KEYWORDS="~amd64 ~x86"
+	SLOT="0/${PV}"
+fi
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
+	lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+	selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
+	xen elibc_glibc"
+
+REQUIRED_USE="
+	firewalld? ( virt-network )
+	libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+	lxc? ( caps libvirtd )
+	openvz? ( libvirtd )
+	qemu? ( libvirtd )
+	uml? ( libvirtd )
+	vepa? ( macvtap )
+	virt-network? ( libvirtd )
+	virtualbox? ( libvirtd )
+	xen? ( libvirtd )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="
+	app-misc/scrub
+	dev-libs/libgcrypt:0
+	dev-libs/libnl:3
+	>=dev-libs/libxml2-2.7.6
+	>=net-analyzer/netcat6-1.0-r2
+	>=net-libs/gnutls-1.0.25
+	net-libs/libssh2
+	>=net-misc/curl-7.18.0
+	sys-apps/dmidecode
+	>=sys-apps/util-linux-2.17
+	sys-devel/gettext
+	sys-libs/ncurses:0=
+	sys-libs/readline:=
+	apparmor? ( sys-libs/libapparmor )
+	audit? ( sys-process/audit )
+	avahi? ( >=net-dns/avahi-0.6[dbus] )
+	caps? ( sys-libs/libcap-ng )
+	firewalld? ( net-firewall/firewalld )
+	fuse? ( >=sys-fs/fuse-2.8.6 )
+	glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+	iscsi? ( sys-block/open-iscsi )
+	lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+	lxc? ( !systemd? ( sys-power/pm-utils ) )
+	nfs? ( net-fs/nfs-utils )
+	numa? (
+		>sys-process/numactl-2.0.2
+		sys-process/numad
+	)
+	openvz? ( sys-kernel/openvz-sources:* )
+	parted? (
+		>=sys-block/parted-1.8[device-mapper]
+		sys-fs/lvm2
+	)
+	pcap? ( >=net-libs/libpcap-1.0.0 )
+	policykit? ( >=sys-auth/polkit-0.9 )
+	qemu? (
+		>=app-emulation/qemu-0.13.0
+		dev-libs/yajl
+		!systemd? ( sys-power/pm-utils )
+	)
+	rbd? ( sys-cluster/ceph )
+	sasl? ( dev-libs/cyrus-sasl )
+	selinux? ( >=sys-libs/libselinux-2.0.85 )
+	systemd? ( sys-apps/systemd )
+	virt-network? (
+		net-dns/dnsmasq[script]
+		net-firewall/ebtables
+		>=net-firewall/iptables-1.4.10[ipv6]
+		net-misc/radvd
+		sys-apps/iproute2[-minimal]
+	)
+	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+	wireshark-plugins? ( net-analyzer/wireshark:= )
+	xen? (
+		app-emulation/xen
+		app-emulation/xen-tools
+	)
+	udev? (
+		virtual/udev
+		>=x11-libs/libpciaccess-0.10.9
+	)
+	elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+
+DEPEND="${RDEPEND}
+	app-text/xhtml1
+	dev-lang/perl
+	dev-libs/libxslt
+	dev-perl/XML-XPath
+	virtual/pkgconfig"
+
+pkg_setup() {
+	enewgroup qemu 77
+	enewuser qemu 77 -1 -1 qemu kvm
+
+	# Some people used the masked ebuild which was not adding the qemu
+	# user to the kvm group originally. This results in VMs failing to
+	# start for some users. bug #430808
+	egetent group kvm | grep -q qemu
+	if [[ $? -ne 0 ]]; then
+		gpasswd -a qemu kvm
+	fi
+
+	# Check kernel configuration:
+	CONFIG_CHECK=""
+	use fuse && CONFIG_CHECK+="
+		~FUSE_FS"
+
+	use lvm && CONFIG_CHECK+="
+		~BLK_DEV_DM
+		~DM_MULTIPATH
+		~DM_SNAPSHOT"
+
+	use lxc && CONFIG_CHECK+="
+		~BLK_CGROUP
+		~CGROUP_CPUACCT
+		~CGROUP_DEVICE
+		~CGROUP_FREEZER
+		~CGROUP_NET_PRIO
+		~CGROUP_PERF
+		~CGROUPS
+		~CGROUP_SCHED
+		~CPUSETS
+		~DEVPTS_MULTIPLE_INSTANCES
+		~IPC_NS
+		~MACVLAN
+		~NAMESPACES
+		~NET_CLS_CGROUP
+		~NET_NS
+		~PID_NS
+		~POSIX_MQUEUE
+		~SECURITYFS
+		~USER_NS
+		~UTS_NS
+		~VETH
+		~!GRKERNSEC_CHROOT_MOUNT
+		~!GRKERNSEC_CHROOT_DOUBLE
+		~!GRKERNSEC_CHROOT_PIVOT
+		~!GRKERNSEC_CHROOT_CHMOD
+		~!GRKERNSEC_CHROOT_CAPS"
+	# Handle specific kernel versions for different features
+	kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+	kernel_is ge 3 6 && CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+	use macvtap && CONFIG_CHECK+="
+		~MACVTAP"
+
+	use virt-network && CONFIG_CHECK+="
+		~BRIDGE_EBT_MARK_T
+		~BRIDGE_NF_EBTABLES
+		~NETFILTER_ADVANCED
+		~NETFILTER_XT_CONNMARK
+		~NETFILTER_XT_MARK
+		~NETFILTER_XT_TARGET_CHECKSUM"
+	# Bandwidth Limiting Support
+	use virt-network && CONFIG_CHECK+="
+		~BRIDGE_EBT_T_NAT
+		~NET_ACT_POLICE
+		~NET_CLS_FW
+		~NET_CLS_U32
+		~NET_SCH_HTB
+		~NET_SCH_INGRESS
+		~NET_SCH_SFQ"
+
+	ERROR_USER_NS="Optional depending on LXC configuration."
+
+	if [[ -n ${CONFIG_CHECK} ]]; then
+		linux-info_pkg_setup
+	fi
+}
+
+src_prepare() {
+	touch "${S}/.mailmap"
+
+	if [[ ${PV} = *9999* ]]; then
+		# git checkouts require bootstrapping to create the configure script.
+		# Additionally the submodules must be cloned to the right locations
+		# bug #377279
+		./bootstrap || die "bootstrap failed"
+		(
+			git submodule status | sed 's/^[ +-]//;s/ .*//'
+			git hash-object bootstrap.conf
+		) >.git-module-status
+	fi
+
+	epatch \
+		"${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
+		"${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
+		"${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch
+
+	[[ -n ${BACKPORTS} ]] &&
+		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
+			EPATCH_SOURCE="${WORKDIR}/patches" epatch
+
+	epatch_user
+
+	# Tweak the init script:
+	cp "${FILESDIR}/libvirtd.init-r15" "${S}/libvirtd.init" || die
+	sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
+		-e "s/USE_FLAG_AVAHI/$(usex avahi avahi-daemon '')/" \
+		-e "s/USE_FLAG_ISCSI/$(usex iscsi iscsid '')/" \
+		-e "s/USE_FLAG_RBD/$(usex rbd  ceph '')/" \
+		-i "${S}/libvirtd.init" || die "sed failed"
+
+	AUTOTOOLS_AUTORECONF=true
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	local myeconfargs=(
+		$(use_with apparmor)
+		$(use_with apparmor apparmor-profiles)
+		$(use_with audit)
+		$(use_with avahi)
+		$(use_with caps capng)
+		$(use_with firewalld)
+		$(use_with fuse)
+		$(use_with glusterfs)
+		$(use_with glusterfs storage-gluster)
+		$(use_with iscsi storage-iscsi)
+		$(use_with libvirtd)
+		$(use_with lvm storage-lvm)
+		$(use_with lvm storage-mpath)
+		$(use_with lxc)
+		$(use_with macvtap)
+		$(use_enable nls)
+		$(use_with numa numactl)
+		$(use_with numa numad)
+		$(use_with openvz)
+		$(use_with parted storage-disk)
+		$(use_with pcap libpcap)
+		$(use_with phyp)
+		$(use_with policykit polkit)
+		$(use_with qemu)
+		$(use_with qemu yajl)
+		$(use_with rbd storage-rbd)
+		$(use_with sasl)
+		$(use_with selinux)
+		$(use_with systemd systemd-daemon)
+		$(usex systemd --with-init-script=systemd '')
+		$(use_with udev)
+		$(use_with uml)
+		$(use_with vepa virtualport)
+		$(use_with virt-network network)
+		$(use_with wireshark-plugins wireshark-dissector)
+		$(use_with xen)
+		$(use_with xen xen-inotify)
+		$(usex xen --with-libxl '')
+
+		--without-hal
+		--without-netcf
+		--without-sanlock
+		--without-xenapi
+		--with-esx
+		--with-qemu-group=$(usex caps qemu root)
+		--with-qemu-user=$(usex caps qemu root)
+		--with-remote
+		--with-storage-fs
+		--with-vmware
+
+		--disable-static
+		--disable-werror
+
+		--docdir=/usr/share/doc/${PF}
+		--htmldir=/usr/share/doc/${PF}/html
+		--localstatedir=/var
+	)
+
+	if use virtualbox && has_version app-emulation/virtualbox-ose; then
+		myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
+	else
+		myeconfargs+=( $(use_with virtualbox vbox) )
+	fi
+
+	autotools-utils_src_configure
+
+	if [[ ${PV} = *9999* ]]; then
+		# Restore gnulib's config.sub and config.guess
+		# bug #377279
+		(cd .gnulib && git reset --hard > /dev/null)
+	fi
+}
+
+src_test() {
+	# Explicitly allow parallel build of tests
+	export VIR_TEST_DEBUG=1
+	HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+	autotools-utils_src_compile install \
+		DESTDIR="${D}" \
+		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
+
+	find "${D}" -name '*.la' -delete || die
+
+	# Remove bogus, empty directories. They are either not used, or
+	# libvirtd is able to create them on demand
+	rm -rf "${D}"/etc/sysconfig
+	rm -rf "${D}"/var/cache
+	rm -rf "${D}"/var/run
+	rm -rf "${D}"/var/log
+
+	use libvirtd || return 0
+	# From here, only libvirtd-related instructions, be warned!
+
+	use systemd && systemd_install_serviced \
+		"${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+	systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+	newinitd "${S}/libvirtd.init" libvirtd || die
+	newinitd "${FILESDIR}/libvirt-guests.init-r1" libvirt-guests || die
+	newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+
+	newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
+	newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
+	DISABLE_AUTOFORMATTING=true
+	readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+	# we only ever want to generate this once
+	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+		rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+	fi
+}
+
+pkg_postinst() {
+	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+		touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+	fi
+
+	use libvirtd || return 0
+	# From here, only libvirtd-related instructions, be warned!
+
+	if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
+		FORCE_PRINT_ELOG=true
+	fi
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
+	DISABLE_AUTOFORMATTING=true
+	readme.gentoo_print_elog
+}
diff --git a/app-emulation/libvirt/libvirt-1.2.19.ebuild b/app-emulation/libvirt/libvirt-1.2.19.ebuild
deleted file mode 100644
index 55fb80d..0000000
--- a/app-emulation/libvirt/libvirt-1.2.19.ebuild
+++ /dev/null
@@ -1,492 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-AUTOTOOLIZE=yes
-
-MY_P="${P/_rc/-rc}"
-
-inherit eutils user autotools linux-info systemd readme.gentoo
-
-BACKPORTS=""
-
-if [[ ${PV} = *9999* ]]; then
-	inherit git-r3
-	EGIT_REPO_URI="git://libvirt.org/libvirt.git"
-	SRC_URI=""
-	KEYWORDS=""
-	SLOT="0"
-else
-	# Versions with 4 numbers are stable updates:
-	if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
-		SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
-	else
-		SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
-	fi
-	SRC_URI+=" ${BACKPORTS:+
-		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
-		https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
-	KEYWORDS="~amd64 ~x86"
-	SLOT="0/${PV}"
-fi
-S="${WORKDIR}/${P%_rc*}"
-
-DESCRIPTION="C toolkit to manipulate virtual machines"
-HOMEPAGE="http://www.libvirt.org/"
-LICENSE="LGPL-2.1"
-# TODO: Reenable IUSE wireshark-plugins
-IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
-	lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
-	selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
-	elibc_glibc systemd"
-REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
-	lxc? ( caps libvirtd )
-	openvz? ( libvirtd )
-	qemu? ( libvirtd )
-	uml? ( libvirtd )
-	vepa? ( macvtap )
-	virtualbox? ( libvirtd )
-	xen? ( libvirtd )
-	virt-network? ( libvirtd )
-	firewalld? ( virt-network )"
-
-# gettext.sh command is used by the libvirt command wrappers, and it's
-# non-optional, so put it into RDEPEND.
-# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
-# package will use 3 by default. Since we don't have slot pinning in an API,
-# we must go with the most recent
-RDEPEND="sys-libs/readline:=
-	sys-libs/ncurses:0=
-	>=net-misc/curl-7.18.0
-	net-firewall/ebtables
-	>=net-firewall/iptables-1.4.10[ipv6]
-	dev-libs/libgcrypt:0
-	>=dev-libs/libxml2-2.7.6
-	dev-libs/libnl:3
-	>=net-libs/gnutls-1.0.25
-	net-libs/libssh2
-	sys-apps/dmidecode
-	>=sys-apps/util-linux-2.17
-	sys-devel/gettext
-	>=net-analyzer/netcat6-1.0-r2
-	app-misc/scrub
-	apparmor? ( sys-libs/libapparmor )
-	audit? ( sys-process/audit )
-	avahi? ( >=net-dns/avahi-0.6[dbus] )
-	caps? ( sys-libs/libcap-ng )
-	fuse? ( >=sys-fs/fuse-2.8.6 )
-	glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
-	iscsi? ( sys-block/open-iscsi )
-	lxc? ( !systemd? ( sys-power/pm-utils ) )
-	lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
-	nfs? ( net-fs/nfs-utils )
-	numa? (
-		>sys-process/numactl-2.0.2
-		sys-process/numad
-	)
-	openvz? ( sys-kernel/openvz-sources:* )
-	parted? (
-		>=sys-block/parted-1.8[device-mapper]
-		sys-fs/lvm2
-	)
-	pcap? ( >=net-libs/libpcap-1.0.0 )
-	policykit? ( >=sys-auth/polkit-0.9 )
-	qemu? (
-		>=app-emulation/qemu-0.13.0
-		dev-libs/yajl
-		!systemd? ( sys-power/pm-utils )
-	)
-	rbd? ( sys-cluster/ceph )
-	sasl? ( dev-libs/cyrus-sasl )
-	selinux? ( >=sys-libs/libselinux-2.0.85 )
-	systemd? ( sys-apps/systemd )
-	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
-	wireshark-plugins? ( net-analyzer/wireshark:= )
-	xen? ( app-emulation/xen-tools app-emulation/xen )
-	udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
-	virt-network? ( net-dns/dnsmasq[script]
-		net-misc/radvd
-		sys-apps/iproute2[-minimal]
-		firewalld? ( net-firewall/firewalld )
-	)
-	elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
-
-DEPEND="${RDEPEND}
-	virtual/pkgconfig
-	app-text/xhtml1
-	dev-lang/perl
-	dev-perl/XML-XPath
-	dev-libs/libxslt"
-
-# gentoo.readme stuff:
-DISABLE_AUTOFORMATTING=true
-DOC_CONTENTS="Important: The openrc libvirtd init script is now broken up into two
-separate services: libvirtd, that solely handles the daemon, and
-libvirt-guests, that takes care of clients during shutdown/restart of the
-host. In order to reenable client handling, edit /etc/conf.d/libvirt-guests
-and enable the service and start it:
-	$ rc-update add libvirt-guests
-	$ service libvirt-guests start
-
-For the basic networking support (bridged and routed networks) you don't
-need any extra software. For more complex network modes including but not
-limited to NATed network, you can enable the 'virt-network' USE flag.
-
-If you are using dnsmasq on your system, you will have to configure
-/etc/dnsmasq.conf to enable the following settings:
-	bind-interfaces
-	interface or except-interface
-Otherwise you might have issues with your existing DNS server.
-
-For openrc users:
-
-	Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
-	libvirtd.
-
-	Use /etc/init.d/libvirt-guests to manage clients on restart/shutdown of
-	the host. The default configuration will suspend and resume running kvm
-	guests with 'managedsave'. This behavior can be changed under
-	/etc/conf.d/libvirt-guests
-
-For systemd users:
-
-	Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
-	to control the '--listen' parameter for libvirtd.
-
-	The configuration for the 'libvirt-guests.service' is found under
-	/etc/libvirt/libvirt-guests.conf"
-
-! use policykit && DOC_CONTENTS+="
-
-To allow normal users to connect to libvirtd you must change the unix sock
-group and/or perms in /etc/libvirt/libvirtd.conf"
-
-use caps && use qemu && DOC_CONTENTS+="
-
-libvirt will now start qemu/kvm VMs with non-root privileges. Ensure any
-resources your VMs use are accessible by qemu:qemu"
-
-LXC_CONFIG_CHECK="
-	~CGROUPS
-	~CGROUP_FREEZER
-	~CGROUP_DEVICE
-	~CGROUP_CPUACCT
-	~CGROUP_SCHED
-	~CGROUP_PERF
-	~BLK_CGROUP
-	~NET_CLS_CGROUP
-	~CGROUP_NET_PRIO
-	~CPUSETS
-	~NAMESPACES
-	~UTS_NS
-	~IPC_NS
-	~PID_NS
-	~NET_NS
-	~USER_NS
-	~DEVPTS_MULTIPLE_INSTANCES
-	~VETH
-	~MACVLAN
-	~POSIX_MQUEUE
-	~SECURITYFS
-	~!GRKERNSEC_CHROOT_MOUNT
-	~!GRKERNSEC_CHROOT_DOUBLE
-	~!GRKERNSEC_CHROOT_PIVOT
-	~!GRKERNSEC_CHROOT_CHMOD
-	~!GRKERNSEC_CHROOT_CAPS
-"
-
-VIRTNET_CONFIG_CHECK="
-	~BRIDGE_NF_EBTABLES
-	~BRIDGE_EBT_MARK_T
-	~NETFILTER_ADVANCED
-	~NETFILTER_XT_TARGET_CHECKSUM
-	~NETFILTER_XT_CONNMARK
-	~NETFILTER_XT_MARK
-"
-
-BWLMT_CONFIG_CHECK="
-	~BRIDGE_EBT_T_NAT
-	~NET_SCH_HTB
-	~NET_SCH_SFQ
-	~NET_SCH_INGRESS
-	~NET_CLS_FW
-	~NET_CLS_U32
-	~NET_ACT_POLICE
-"
-
-MACVTAP_CONFIG_CHECK=" ~MACVTAP"
-
-LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
-
-ERROR_USER_NS="Optional depending on LXC configuration."
-
-pkg_setup() {
-	enewgroup qemu 77
-	enewuser qemu 77 -1 -1 qemu kvm
-
-	# Some people used the masked ebuild which was not adding the qemu
-	# user to the kvm group originally. This results in VMs failing to
-	# start for some users. bug #430808
-	egetent group kvm | grep -q qemu
-	if [[ $? -ne 0 ]]; then
-		gpasswd -a qemu kvm
-	fi
-
-	# Handle specific kernel versions for different features
-	kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
-	kernel_is ge 3 6 &&	LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
-
-	CONFIG_CHECK=""
-	use fuse && CONFIG_CHECK+=" ~FUSE_FS"
-	use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
-	use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
-	use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
-	use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
-	# Bandwidth Limiting Support
-	use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
-	if [[ -n ${CONFIG_CHECK} ]]; then
-		linux-info_pkg_setup
-	fi
-}
-
-src_prepare() {
-	touch "${S}/.mailmap"
-
-	if [[ ${PV} = *9999* ]]; then
-		# git checkouts require bootstrapping to create the configure script.
-		# Additionally the submodules must be cloned to the right locations
-		# bug #377279
-		./bootstrap || die "bootstrap failed"
-		(
-			git submodule status | sed 's/^[ +-]//;s/ .*//'
-			git hash-object bootstrap.conf
-		) >.git-module-status
-	fi
-
-	epatch \
-		"${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
-		"${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
-		"${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch
-
-	[[ -n ${BACKPORTS} ]] && \
-		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
-			EPATCH_SOURCE="${WORKDIR}/patches" epatch
-
-	epatch_user
-
-	[[ -n ${AUTOTOOLIZE} ]] && eautoreconf
-
-	# Tweak the init script
-	local avahi_init=
-	local iscsi_init=
-	local rbd_init=
-	local firewalld_init=
-	cp "${FILESDIR}/libvirtd.init-r15" "${S}/libvirtd.init"
-	use avahi && avahi_init='avahi-daemon'
-	use iscsi && iscsi_init='iscsid'
-	use rbd && rbd_init='ceph'
-	use firewalld && firewalld_init='need firewalld'
-
-	sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
-}
-
-src_configure() {
-	local myconf=""
-
-	## enable/disable daemon, otherwise client only utils
-	myconf+=" $(use_with libvirtd)"
-
-	## enable/disable the daemon using avahi to find VMs
-	myconf+=" $(use_with avahi)"
-
-	## hypervisors on the local host
-	myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
-	myconf+=" --without-xenapi"
-	if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
-		myconf+=" --with-libxl"
-	else
-		myconf+=" --without-libxl"
-	fi
-	myconf+=" $(use_with openvz)"
-	myconf+=" $(use_with lxc)"
-	if use virtualbox && has_version app-emulation/virtualbox-ose; then
-		myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
-	else
-		myconf+=" $(use_with virtualbox vbox)"
-	fi
-	myconf+=" $(use_with uml)"
-	myconf+=" $(use_with qemu)"
-	myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
-	myconf+=" $(use_with phyp)"
-	myconf+=" --with-esx"
-	myconf+=" --with-vmware"
-
-	## additional host drivers
-	myconf+=" $(use_with apparmor)"
-	myconf+=" $(use_with apparmor apparmor-profiles)"
-	myconf+=" $(use_with virt-network network)"
-	myconf+=" --with-storage-fs"
-	myconf+=" $(use_with lvm storage-lvm)"
-	myconf+=" $(use_with iscsi storage-iscsi)"
-	myconf+=" $(use_with parted storage-disk)"
-	mycond+=" $(use_with glusterfs)"
-	mycond+=" $(use_with glusterfs storage-gluster)"
-	myconf+=" $(use_with lvm storage-mpath)"
-	myconf+=" $(use_with rbd storage-rbd)"
-	myconf+=" $(use_with numa numactl)"
-	myconf+=" $(use_with numa numad)"
-	myconf+=" $(use_with selinux)"
-	myconf+=" $(use_with fuse)"
-
-	# udev for device support details
-	myconf+=" $(use_with udev)"
-	myconf+=" --without-hal"
-
-	# linux capability support so we don't need privileged accounts
-	myconf+=" $(use_with caps capng)"
-
-	## auth stuff
-	myconf+=" $(use_with policykit polkit)"
-	myconf+=" $(use_with sasl)"
-
-	# network bits
-	myconf+=" $(use_with macvtap)"
-	myconf+=" $(use_with pcap libpcap)"
-	myconf+=" $(use_with vepa virtualport)"
-	myconf+=" $(use_with firewalld)"
-
-	## other
-	myconf+=" $(use_enable nls)"
-
-	# user privilege bits fir qemu/kvm
-	if use caps; then
-		myconf+=" --with-qemu-user=qemu"
-		myconf+=" --with-qemu-group=qemu"
-	else
-		myconf+=" --with-qemu-user=root"
-		myconf+=" --with-qemu-group=root"
-	fi
-
-	# audit support
-	myconf+=" $(use_with audit)"
-
-	# wireshark dissector
-	myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
-
-	## stuff we don't yet support
-	myconf+=" --without-netcf"
-
-	# locking support
-	myconf+=" --without-sanlock"
-
-	# systemd unit files
-	myconf+=" $(use_with systemd systemd-daemon)"
-	use systemd && myconf+=" --with-init-script=systemd"
-
-	# this is a nasty trick to work around the problem in bug
-	# #275073. The reason why we don't solve this properly is that
-	# it'll require us to rebuild autotools (and we don't really want
-	# to do that right now). The proper solution has been sent
-	# upstream and should hopefully land in 0.7.7, in the mean time,
-	# mime the same functionality with this.
-	case ${CHOST} in
-		*cygwin* | *mingw* )
-			;;
-		*)
-			ac_cv_prog_WINDRES=no
-			;;
-	esac
-
-	econf \
-		${myconf} \
-		--disable-static \
-		--disable-werror \
-		--with-remote \
-		--docdir=/usr/share/doc/${PF} \
-		--localstatedir=/var
-
-	if [[ ${PV} = *9999* ]]; then
-		# Restore gnulib's config.sub and config.guess
-		# bug #377279
-		(cd .gnulib && git reset --hard > /dev/null)
-	fi
-}
-
-src_test() {
-	# Explicitly allow parallel build of tests
-	export VIR_TEST_DEBUG=1
-	HOME="${T}" emake check || die "tests failed"
-}
-
-src_install() {
-	emake install \
-		DESTDIR="${D}" \
-		HTML_DIR=/usr/share/doc/${PF}/html \
-		DOCS_DIR=/usr/share/doc/${PF} \
-		EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
-		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
-		|| die "emake install failed"
-
-	find "${D}" -name '*.la' -delete || die
-
-	# Remove bogus, empty directories. They are either not used, or
-	# libvirtd is able to create them on demand
-	rm -rf "${D}"/etc/sysconfig
-	rm -rf "${D}"/var/cache
-	rm -rf "${D}"/var/run
-	rm -rf "${D}"/var/log
-
-	use libvirtd || return 0
-	# From here, only libvirtd-related instructions, be warned!
-
-	use systemd && systemd_install_serviced \
-		"${FILESDIR}"/libvirtd.service.conf libvirtd.service
-
-	systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
-
-	newinitd "${S}/libvirtd.init" libvirtd || die
-	newinitd "${FILESDIR}/libvirt-guests.init" libvirt-guests || die
-	newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
-
-	newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
-	newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
-
-	readme.gentoo_create_doc
-}
-
-pkg_preinst() {
-	# we only ever want to generate this once
-	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
-		rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
-	fi
-
-	# We really don't want to use or support old PolicyKit cause it
-	# screws with the new polkit integration
-	if has_version sys-auth/policykit; then
-		rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
-	fi
-
-	# Only sysctl files ending in .conf work
-	dodir /etc/sysctl.d
-	mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
-}
-
-pkg_postinst() {
-	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
-		touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
-	fi
-
-	use libvirtd || return 0
-	# From here, only libvirtd-related instructions, be warned!
-
-	if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
-		FORCE_PRINT_ELOG=true
-	fi
-
-	readme.gentoo_print_elog
-}
diff --git a/app-emulation/libvirt/libvirt-1.2.20.ebuild b/app-emulation/libvirt/libvirt-1.2.20.ebuild
new file mode 100644
index 0000000..cb757f0
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-1.2.20.ebuild
@@ -0,0 +1,381 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils user autotools-utils linux-info systemd readme.gentoo
+
+BACKPORTS=""
+
+if [[ ${PV} = *9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+	SRC_URI=""
+	KEYWORDS=""
+	SLOT="0"
+else
+	# Versions with 4 numbers are stable updates:
+	if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+		SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz"
+	else
+		SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
+	fi
+	SRC_URI+=" ${BACKPORTS:+
+		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
+		https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
+	KEYWORDS="~amd64 ~x86"
+	SLOT="0/${PV}"
+fi
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
+	lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+	selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
+	xen elibc_glibc"
+
+REQUIRED_USE="
+	firewalld? ( virt-network )
+	libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+	lxc? ( caps libvirtd )
+	openvz? ( libvirtd )
+	qemu? ( libvirtd )
+	uml? ( libvirtd )
+	vepa? ( macvtap )
+	virt-network? ( libvirtd )
+	virtualbox? ( libvirtd )
+	xen? ( libvirtd )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="
+	app-misc/scrub
+	dev-libs/libgcrypt:0
+	dev-libs/libnl:3
+	>=dev-libs/libxml2-2.7.6
+	>=net-analyzer/netcat6-1.0-r2
+	>=net-libs/gnutls-1.0.25
+	net-libs/libssh2
+	>=net-misc/curl-7.18.0
+	sys-apps/dmidecode
+	>=sys-apps/util-linux-2.17
+	sys-devel/gettext
+	sys-libs/ncurses:0=
+	sys-libs/readline:=
+	apparmor? ( sys-libs/libapparmor )
+	audit? ( sys-process/audit )
+	avahi? ( >=net-dns/avahi-0.6[dbus] )
+	caps? ( sys-libs/libcap-ng )
+	firewalld? ( net-firewall/firewalld )
+	fuse? ( >=sys-fs/fuse-2.8.6 )
+	glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+	iscsi? ( sys-block/open-iscsi )
+	lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+	lxc? ( !systemd? ( sys-power/pm-utils ) )
+	nfs? ( net-fs/nfs-utils )
+	numa? (
+		>sys-process/numactl-2.0.2
+		sys-process/numad
+	)
+	openvz? ( sys-kernel/openvz-sources:* )
+	parted? (
+		>=sys-block/parted-1.8[device-mapper]
+		sys-fs/lvm2
+	)
+	pcap? ( >=net-libs/libpcap-1.0.0 )
+	policykit? ( >=sys-auth/polkit-0.9 )
+	qemu? (
+		>=app-emulation/qemu-0.13.0
+		dev-libs/yajl
+		!systemd? ( sys-power/pm-utils )
+	)
+	rbd? ( sys-cluster/ceph )
+	sasl? ( dev-libs/cyrus-sasl )
+	selinux? ( >=sys-libs/libselinux-2.0.85 )
+	systemd? ( sys-apps/systemd )
+	virt-network? (
+		net-dns/dnsmasq[script]
+		net-firewall/ebtables
+		>=net-firewall/iptables-1.4.10[ipv6]
+		net-misc/radvd
+		sys-apps/iproute2[-minimal]
+	)
+	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+	wireshark-plugins? ( net-analyzer/wireshark:= )
+	xen? (
+		app-emulation/xen
+		app-emulation/xen-tools
+	)
+	udev? (
+		virtual/udev
+		>=x11-libs/libpciaccess-0.10.9
+	)
+	elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+
+DEPEND="${RDEPEND}
+	app-text/xhtml1
+	dev-lang/perl
+	dev-libs/libxslt
+	dev-perl/XML-XPath
+	virtual/pkgconfig"
+
+pkg_setup() {
+	enewgroup qemu 77
+	enewuser qemu 77 -1 -1 qemu kvm
+
+	# Some people used the masked ebuild which was not adding the qemu
+	# user to the kvm group originally. This results in VMs failing to
+	# start for some users. bug #430808
+	egetent group kvm | grep -q qemu
+	if [[ $? -ne 0 ]]; then
+		gpasswd -a qemu kvm
+	fi
+
+	# Check kernel configuration:
+	CONFIG_CHECK=""
+	use fuse && CONFIG_CHECK+="
+		~FUSE_FS"
+
+	use lvm && CONFIG_CHECK+="
+		~BLK_DEV_DM
+		~DM_MULTIPATH
+		~DM_SNAPSHOT"
+
+	use lxc && CONFIG_CHECK+="
+		~BLK_CGROUP
+		~CGROUP_CPUACCT
+		~CGROUP_DEVICE
+		~CGROUP_FREEZER
+		~CGROUP_NET_PRIO
+		~CGROUP_PERF
+		~CGROUPS
+		~CGROUP_SCHED
+		~CPUSETS
+		~DEVPTS_MULTIPLE_INSTANCES
+		~IPC_NS
+		~MACVLAN
+		~NAMESPACES
+		~NET_CLS_CGROUP
+		~NET_NS
+		~PID_NS
+		~POSIX_MQUEUE
+		~SECURITYFS
+		~USER_NS
+		~UTS_NS
+		~VETH
+		~!GRKERNSEC_CHROOT_MOUNT
+		~!GRKERNSEC_CHROOT_DOUBLE
+		~!GRKERNSEC_CHROOT_PIVOT
+		~!GRKERNSEC_CHROOT_CHMOD
+		~!GRKERNSEC_CHROOT_CAPS"
+	# Handle specific kernel versions for different features
+	kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+	kernel_is ge 3 6 && CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+	use macvtap && CONFIG_CHECK+="
+		~MACVTAP"
+
+	use virt-network && CONFIG_CHECK+="
+		~BRIDGE_EBT_MARK_T
+		~BRIDGE_NF_EBTABLES
+		~NETFILTER_ADVANCED
+		~NETFILTER_XT_CONNMARK
+		~NETFILTER_XT_MARK
+		~NETFILTER_XT_TARGET_CHECKSUM"
+	# Bandwidth Limiting Support
+	use virt-network && CONFIG_CHECK+="
+		~BRIDGE_EBT_T_NAT
+		~NET_ACT_POLICE
+		~NET_CLS_FW
+		~NET_CLS_U32
+		~NET_SCH_HTB
+		~NET_SCH_INGRESS
+		~NET_SCH_SFQ"
+
+	ERROR_USER_NS="Optional depending on LXC configuration."
+
+	if [[ -n ${CONFIG_CHECK} ]]; then
+		linux-info_pkg_setup
+	fi
+}
+
+src_prepare() {
+	touch "${S}/.mailmap"
+
+	if [[ ${PV} = *9999* ]]; then
+		# git checkouts require bootstrapping to create the configure script.
+		# Additionally the submodules must be cloned to the right locations
+		# bug #377279
+		./bootstrap || die "bootstrap failed"
+		(
+			git submodule status | sed 's/^[ +-]//;s/ .*//'
+			git hash-object bootstrap.conf
+		) >.git-module-status
+	fi
+
+	epatch \
+		"${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
+		"${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
+		"${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch
+
+	[[ -n ${BACKPORTS} ]] &&
+		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
+			EPATCH_SOURCE="${WORKDIR}/patches" epatch
+
+	epatch_user
+
+	# Tweak the init script:
+	cp "${FILESDIR}/libvirtd.init-r15" "${S}/libvirtd.init" || die
+	sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
+		-e "s/USE_FLAG_AVAHI/$(usex avahi avahi-daemon '')/" \
+		-e "s/USE_FLAG_ISCSI/$(usex iscsi iscsid '')/" \
+		-e "s/USE_FLAG_RBD/$(usex rbd  ceph '')/" \
+		-i "${S}/libvirtd.init" || die "sed failed"
+
+	AUTOTOOLS_AUTORECONF=true
+	autotools-utils_src_prepare
+}
+
+src_configure() {
+	local myeconfargs=(
+		$(use_with apparmor)
+		$(use_with apparmor apparmor-profiles)
+		$(use_with audit)
+		$(use_with avahi)
+		$(use_with caps capng)
+		$(use_with firewalld)
+		$(use_with fuse)
+		$(use_with glusterfs)
+		$(use_with glusterfs storage-gluster)
+		$(use_with iscsi storage-iscsi)
+		$(use_with libvirtd)
+		$(use_with lvm storage-lvm)
+		$(use_with lvm storage-mpath)
+		$(use_with lxc)
+		$(use_with macvtap)
+		$(use_enable nls)
+		$(use_with numa numactl)
+		$(use_with numa numad)
+		$(use_with openvz)
+		$(use_with parted storage-disk)
+		$(use_with pcap libpcap)
+		$(use_with phyp)
+		$(use_with policykit polkit)
+		$(use_with qemu)
+		$(use_with qemu yajl)
+		$(use_with rbd storage-rbd)
+		$(use_with sasl)
+		$(use_with selinux)
+		$(use_with systemd systemd-daemon)
+		$(usex systemd --with-init-script=systemd '')
+		$(use_with udev)
+		$(use_with uml)
+		$(use_with vepa virtualport)
+		$(use_with virt-network network)
+		$(use_with wireshark-plugins wireshark-dissector)
+		$(use_with xen)
+		$(use_with xen xen-inotify)
+		$(usex xen --with-libxl '')
+
+		--without-hal
+		--without-netcf
+		--without-sanlock
+		--without-xenapi
+		--with-esx
+		--with-qemu-group=$(usex caps qemu root)
+		--with-qemu-user=$(usex caps qemu root)
+		--with-remote
+		--with-storage-fs
+		--with-vmware
+
+		--disable-static
+		--disable-werror
+
+		--docdir=/usr/share/doc/${PF}
+		--htmldir=/usr/share/doc/${PF}/html
+		--localstatedir=/var
+	)
+
+	if use virtualbox && has_version app-emulation/virtualbox-ose; then
+		myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
+	else
+		myeconfargs+=( $(use_with virtualbox vbox) )
+	fi
+
+	autotools-utils_src_configure
+
+	if [[ ${PV} = *9999* ]]; then
+		# Restore gnulib's config.sub and config.guess
+		# bug #377279
+		(cd .gnulib && git reset --hard > /dev/null)
+	fi
+}
+
+src_test() {
+	# Explicitly allow parallel build of tests
+	export VIR_TEST_DEBUG=1
+	HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+	autotools-utils_src_compile install \
+		DESTDIR="${D}" \
+		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
+
+	find "${D}" -name '*.la' -delete || die
+
+	# Remove bogus, empty directories. They are either not used, or
+	# libvirtd is able to create them on demand
+	rm -rf "${D}"/etc/sysconfig
+	rm -rf "${D}"/var/cache
+	rm -rf "${D}"/var/run
+	rm -rf "${D}"/var/log
+
+	use libvirtd || return 0
+	# From here, only libvirtd-related instructions, be warned!
+
+	use systemd && systemd_install_serviced \
+		"${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+	systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+	newinitd "${S}/libvirtd.init" libvirtd || die
+	newinitd "${FILESDIR}/libvirt-guests.init-r1" libvirt-guests || die
+	newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+
+	newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
+	newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
+	DISABLE_AUTOFORMATTING=true
+	readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+	# we only ever want to generate this once
+	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+		rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+	fi
+}
+
+pkg_postinst() {
+	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+		touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+	fi
+
+	use libvirtd || return 0
+	# From here, only libvirtd-related instructions, be warned!
+
+	if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
+		FORCE_PRINT_ELOG=true
+	fi
+
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
+	DISABLE_AUTOFORMATTING=true
+	readme.gentoo_print_elog
+}
diff --git a/app-emulation/libvirt/libvirt-9999.ebuild b/app-emulation/libvirt/libvirt-9999.ebuild
index 051c953..cb757f0 100644
--- a/app-emulation/libvirt/libvirt-9999.ebuild
+++ b/app-emulation/libvirt/libvirt-9999.ebuild
@@ -4,11 +4,7 @@
 
 EAPI=5
 
-AUTOTOOLIZE=yes
-
-MY_P="${P/_rc/-rc}"
-
-inherit eutils user autotools linux-info systemd readme.gentoo
+inherit eutils user autotools-utils linux-info systemd readme.gentoo
 
 BACKPORTS=""
 
@@ -21,9 +17,9 @@
 else
 	# Versions with 4 numbers are stable updates:
 	if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
-		SRC_URI="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz"
+		SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz"
 	else
-		SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz"
+		SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
 	fi
 	SRC_URI+=" ${BACKPORTS:+
 		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
@@ -31,56 +27,56 @@
 	KEYWORDS="~amd64 ~x86"
 	SLOT="0/${PV}"
 fi
-S="${WORKDIR}/${P%_rc*}"
 
 DESCRIPTION="C toolkit to manipulate virtual machines"
 HOMEPAGE="http://www.libvirt.org/"
 LICENSE="LGPL-2.1"
-# TODO: Reenable IUSE wireshark-plugins
 IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
 	lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
-	selinux +udev uml +vepa virtualbox virt-network wireshark-plugins xen \
-	elibc_glibc systemd"
-REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+	selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
+	xen elibc_glibc"
+
+REQUIRED_USE="
+	firewalld? ( virt-network )
+	libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
 	lxc? ( caps libvirtd )
 	openvz? ( libvirtd )
 	qemu? ( libvirtd )
 	uml? ( libvirtd )
 	vepa? ( macvtap )
-	virtualbox? ( libvirtd )
-	xen? ( libvirtd )
 	virt-network? ( libvirtd )
-	firewalld? ( virt-network )"
+	virtualbox? ( libvirtd )
+	xen? ( libvirtd )"
 
 # gettext.sh command is used by the libvirt command wrappers, and it's
 # non-optional, so put it into RDEPEND.
 # We can use both libnl:1.1 and libnl:3, but if you have both installed, the
 # package will use 3 by default. Since we don't have slot pinning in an API,
 # we must go with the most recent
-RDEPEND="sys-libs/readline:=
-	sys-libs/ncurses:0=
-	>=net-misc/curl-7.18.0
-	net-firewall/ebtables
-	>=net-firewall/iptables-1.4.10[ipv6]
+RDEPEND="
+	app-misc/scrub
 	dev-libs/libgcrypt:0
-	>=dev-libs/libxml2-2.7.6
 	dev-libs/libnl:3
+	>=dev-libs/libxml2-2.7.6
+	>=net-analyzer/netcat6-1.0-r2
 	>=net-libs/gnutls-1.0.25
 	net-libs/libssh2
+	>=net-misc/curl-7.18.0
 	sys-apps/dmidecode
 	>=sys-apps/util-linux-2.17
 	sys-devel/gettext
-	>=net-analyzer/netcat6-1.0-r2
-	app-misc/scrub
+	sys-libs/ncurses:0=
+	sys-libs/readline:=
 	apparmor? ( sys-libs/libapparmor )
 	audit? ( sys-process/audit )
 	avahi? ( >=net-dns/avahi-0.6[dbus] )
 	caps? ( sys-libs/libcap-ng )
+	firewalld? ( net-firewall/firewalld )
 	fuse? ( >=sys-fs/fuse-2.8.6 )
 	glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
 	iscsi? ( sys-block/open-iscsi )
-	lxc? ( !systemd? ( sys-power/pm-utils ) )
 	lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+	lxc? ( !systemd? ( sys-power/pm-utils ) )
 	nfs? ( net-fs/nfs-utils )
 	numa? (
 		>sys-process/numactl-2.0.2
@@ -102,124 +98,31 @@
 	sasl? ( dev-libs/cyrus-sasl )
 	selinux? ( >=sys-libs/libselinux-2.0.85 )
 	systemd? ( sys-apps/systemd )
-	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
-	wireshark-plugins? ( net-analyzer/wireshark:= )
-	xen? ( app-emulation/xen-tools app-emulation/xen )
-	udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
-	virt-network? ( net-dns/dnsmasq[script]
+	virt-network? (
+		net-dns/dnsmasq[script]
+		net-firewall/ebtables
+		>=net-firewall/iptables-1.4.10[ipv6]
 		net-misc/radvd
 		sys-apps/iproute2[-minimal]
-		firewalld? ( net-firewall/firewalld )
+	)
+	virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+	wireshark-plugins? ( net-analyzer/wireshark:= )
+	xen? (
+		app-emulation/xen
+		app-emulation/xen-tools
+	)
+	udev? (
+		virtual/udev
+		>=x11-libs/libpciaccess-0.10.9
 	)
 	elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
 
 DEPEND="${RDEPEND}
-	virtual/pkgconfig
 	app-text/xhtml1
 	dev-lang/perl
+	dev-libs/libxslt
 	dev-perl/XML-XPath
-	dev-libs/libxslt"
-
-# gentoo.readme stuff:
-DISABLE_AUTOFORMATTING=true
-DOC_CONTENTS="Important: The openrc libvirtd init script is now broken up into two
-separate services: libvirtd, that solely handles the daemon, and
-libvirt-guests, that takes care of clients during shutdown/restart of the
-host. In order to reenable client handling, edit /etc/conf.d/libvirt-guests
-and enable the service:
-	$ rc-update add libvirt-guests
-
-For the basic networking support (bridged and routed networks) you don't
-need any extra software. For more complex network modes including but not
-limited to NATed network, you can enable the 'virt-network' USE flag.
-
-If you are using dnsmasq on your system, you will have to configure
-/etc/dnsmasq.conf to enable the following settings:
-	bind-interfaces
-	interface or except-interface
-Otherwise you might have issues with your existing DNS server.
-
-For openrc users:
-
-	Please use /etc/conf.d/libvirtd to control the '--listen' parameter for
-	libvirtd.
-
-	Use /etc/init.d/libvirt-guests to manage clients on restart/shutdown of
-	the host. The default configuration will suspend and resume running kvm
-	guests with 'managedsave'. This behavior can be changed under
-	/etc/conf.d/libvirt-guests
-
-For systemd users:
-
-	Please use /etc/systemd/system/libvirtd.service.d/00gentoo.conf
-	to control the '--listen' parameter for libvirtd.
-
-	The configuration for the 'libvirt-guests.service' is found under
-	/etc/libvirt/libvirt-guests.conf"
-
-! use policykit && DOC_CONTENTS+="
-
-To allow normal users to connect to libvirtd you must change the unix sock
-group and/or perms in /etc/libvirt/libvirtd.conf"
-
-use caps && use qemu && DOC_CONTENTS+="
-
-libvirt will now start qemu/kvm VMs with non-root privileges. Ensure any
-resources your VMs use are accessible by qemu:qemu"
-
-LXC_CONFIG_CHECK="
-	~CGROUPS
-	~CGROUP_FREEZER
-	~CGROUP_DEVICE
-	~CGROUP_CPUACCT
-	~CGROUP_SCHED
-	~CGROUP_PERF
-	~BLK_CGROUP
-	~NET_CLS_CGROUP
-	~CGROUP_NET_PRIO
-	~CPUSETS
-	~NAMESPACES
-	~UTS_NS
-	~IPC_NS
-	~PID_NS
-	~NET_NS
-	~USER_NS
-	~DEVPTS_MULTIPLE_INSTANCES
-	~VETH
-	~MACVLAN
-	~POSIX_MQUEUE
-	~SECURITYFS
-	~!GRKERNSEC_CHROOT_MOUNT
-	~!GRKERNSEC_CHROOT_DOUBLE
-	~!GRKERNSEC_CHROOT_PIVOT
-	~!GRKERNSEC_CHROOT_CHMOD
-	~!GRKERNSEC_CHROOT_CAPS
-"
-
-VIRTNET_CONFIG_CHECK="
-	~BRIDGE_NF_EBTABLES
-	~BRIDGE_EBT_MARK_T
-	~NETFILTER_ADVANCED
-	~NETFILTER_XT_TARGET_CHECKSUM
-	~NETFILTER_XT_CONNMARK
-	~NETFILTER_XT_MARK
-"
-
-BWLMT_CONFIG_CHECK="
-	~BRIDGE_EBT_T_NAT
-	~NET_SCH_HTB
-	~NET_SCH_SFQ
-	~NET_SCH_INGRESS
-	~NET_CLS_FW
-	~NET_CLS_U32
-	~NET_ACT_POLICE
-"
-
-MACVTAP_CONFIG_CHECK=" ~MACVTAP"
-
-LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
-
-ERROR_USER_NS="Optional depending on LXC configuration."
+	virtual/pkgconfig"
 
 pkg_setup() {
 	enewgroup qemu 77
@@ -233,18 +136,69 @@
 		gpasswd -a qemu kvm
 	fi
 
-	# Handle specific kernel versions for different features
-	kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
-	kernel_is ge 3 6 &&	LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
-
+	# Check kernel configuration:
 	CONFIG_CHECK=""
-	use fuse && CONFIG_CHECK+=" ~FUSE_FS"
-	use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
-	use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
-	use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
-	use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
+	use fuse && CONFIG_CHECK+="
+		~FUSE_FS"
+
+	use lvm && CONFIG_CHECK+="
+		~BLK_DEV_DM
+		~DM_MULTIPATH
+		~DM_SNAPSHOT"
+
+	use lxc && CONFIG_CHECK+="
+		~BLK_CGROUP
+		~CGROUP_CPUACCT
+		~CGROUP_DEVICE
+		~CGROUP_FREEZER
+		~CGROUP_NET_PRIO
+		~CGROUP_PERF
+		~CGROUPS
+		~CGROUP_SCHED
+		~CPUSETS
+		~DEVPTS_MULTIPLE_INSTANCES
+		~IPC_NS
+		~MACVLAN
+		~NAMESPACES
+		~NET_CLS_CGROUP
+		~NET_NS
+		~PID_NS
+		~POSIX_MQUEUE
+		~SECURITYFS
+		~USER_NS
+		~UTS_NS
+		~VETH
+		~!GRKERNSEC_CHROOT_MOUNT
+		~!GRKERNSEC_CHROOT_DOUBLE
+		~!GRKERNSEC_CHROOT_PIVOT
+		~!GRKERNSEC_CHROOT_CHMOD
+		~!GRKERNSEC_CHROOT_CAPS"
+	# Handle specific kernel versions for different features
+	kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+	kernel_is ge 3 6 && CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+	use macvtap && CONFIG_CHECK+="
+		~MACVTAP"
+
+	use virt-network && CONFIG_CHECK+="
+		~BRIDGE_EBT_MARK_T
+		~BRIDGE_NF_EBTABLES
+		~NETFILTER_ADVANCED
+		~NETFILTER_XT_CONNMARK
+		~NETFILTER_XT_MARK
+		~NETFILTER_XT_TARGET_CHECKSUM"
 	# Bandwidth Limiting Support
-	use virt-network && CONFIG_CHECK+="${BWLMT_CONFIG_CHECK}"
+	use virt-network && CONFIG_CHECK+="
+		~BRIDGE_EBT_T_NAT
+		~NET_ACT_POLICE
+		~NET_CLS_FW
+		~NET_CLS_U32
+		~NET_SCH_HTB
+		~NET_SCH_INGRESS
+		~NET_SCH_SFQ"
+
+	ERROR_USER_NS="Optional depending on LXC configuration."
+
 	if [[ -n ${CONFIG_CHECK} ]]; then
 		linux-info_pkg_setup
 	fi
@@ -269,145 +223,91 @@
 		"${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
 		"${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch
 
-	[[ -n ${BACKPORTS} ]] && \
+	[[ -n ${BACKPORTS} ]] &&
 		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
 			EPATCH_SOURCE="${WORKDIR}/patches" epatch
 
 	epatch_user
 
-	[[ -n ${AUTOTOOLIZE} ]] && eautoreconf
+	# Tweak the init script:
+	cp "${FILESDIR}/libvirtd.init-r15" "${S}/libvirtd.init" || die
+	sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
+		-e "s/USE_FLAG_AVAHI/$(usex avahi avahi-daemon '')/" \
+		-e "s/USE_FLAG_ISCSI/$(usex iscsi iscsid '')/" \
+		-e "s/USE_FLAG_RBD/$(usex rbd  ceph '')/" \
+		-i "${S}/libvirtd.init" || die "sed failed"
 
-	# Tweak the init script
-	local avahi_init=
-	local iscsi_init=
-	local rbd_init=
-	local firewalld_init=
-	cp "${FILESDIR}/libvirtd.init-r15" "${S}/libvirtd.init"
-	use avahi && avahi_init='avahi-daemon'
-	use iscsi && iscsi_init='iscsid'
-	use rbd && rbd_init='ceph'
-	use firewalld && firewalld_init='need firewalld'
-
-	sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
-	sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
+	AUTOTOOLS_AUTORECONF=true
+	autotools-utils_src_prepare
 }
 
 src_configure() {
-	local myconf=""
+	local myeconfargs=(
+		$(use_with apparmor)
+		$(use_with apparmor apparmor-profiles)
+		$(use_with audit)
+		$(use_with avahi)
+		$(use_with caps capng)
+		$(use_with firewalld)
+		$(use_with fuse)
+		$(use_with glusterfs)
+		$(use_with glusterfs storage-gluster)
+		$(use_with iscsi storage-iscsi)
+		$(use_with libvirtd)
+		$(use_with lvm storage-lvm)
+		$(use_with lvm storage-mpath)
+		$(use_with lxc)
+		$(use_with macvtap)
+		$(use_enable nls)
+		$(use_with numa numactl)
+		$(use_with numa numad)
+		$(use_with openvz)
+		$(use_with parted storage-disk)
+		$(use_with pcap libpcap)
+		$(use_with phyp)
+		$(use_with policykit polkit)
+		$(use_with qemu)
+		$(use_with qemu yajl)
+		$(use_with rbd storage-rbd)
+		$(use_with sasl)
+		$(use_with selinux)
+		$(use_with systemd systemd-daemon)
+		$(usex systemd --with-init-script=systemd '')
+		$(use_with udev)
+		$(use_with uml)
+		$(use_with vepa virtualport)
+		$(use_with virt-network network)
+		$(use_with wireshark-plugins wireshark-dissector)
+		$(use_with xen)
+		$(use_with xen xen-inotify)
+		$(usex xen --with-libxl '')
 
-	## enable/disable daemon, otherwise client only utils
-	myconf+=" $(use_with libvirtd)"
+		--without-hal
+		--without-netcf
+		--without-sanlock
+		--without-xenapi
+		--with-esx
+		--with-qemu-group=$(usex caps qemu root)
+		--with-qemu-user=$(usex caps qemu root)
+		--with-remote
+		--with-storage-fs
+		--with-vmware
 
-	## enable/disable the daemon using avahi to find VMs
-	myconf+=" $(use_with avahi)"
+		--disable-static
+		--disable-werror
 
-	## hypervisors on the local host
-	myconf+=" $(use_with xen) $(use_with xen xen-inotify)"
-	myconf+=" --without-xenapi"
-	if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
-		myconf+=" --with-libxl"
-	else
-		myconf+=" --without-libxl"
-	fi
-	myconf+=" $(use_with openvz)"
-	myconf+=" $(use_with lxc)"
-	if use virtualbox && has_version app-emulation/virtualbox-ose; then
-		myconf+=" --with-vbox=/usr/lib/virtualbox-ose/"
-	else
-		myconf+=" $(use_with virtualbox vbox)"
-	fi
-	myconf+=" $(use_with uml)"
-	myconf+=" $(use_with qemu)"
-	myconf+=" $(use_with qemu yajl)" # Use QMP over HMP
-	myconf+=" $(use_with phyp)"
-	myconf+=" --with-esx"
-	myconf+=" --with-vmware"
-
-	## additional host drivers
-	myconf+=" $(use_with apparmor)"
-	myconf+=" $(use_with apparmor apparmor-profiles)"
-	myconf+=" $(use_with virt-network network)"
-	myconf+=" --with-storage-fs"
-	myconf+=" $(use_with lvm storage-lvm)"
-	myconf+=" $(use_with iscsi storage-iscsi)"
-	myconf+=" $(use_with parted storage-disk)"
-	mycond+=" $(use_with glusterfs)"
-	mycond+=" $(use_with glusterfs storage-gluster)"
-	myconf+=" $(use_with lvm storage-mpath)"
-	myconf+=" $(use_with rbd storage-rbd)"
-	myconf+=" $(use_with numa numactl)"
-	myconf+=" $(use_with numa numad)"
-	myconf+=" $(use_with selinux)"
-	myconf+=" $(use_with fuse)"
-
-	# udev for device support details
-	myconf+=" $(use_with udev)"
-	myconf+=" --without-hal"
-
-	# linux capability support so we don't need privileged accounts
-	myconf+=" $(use_with caps capng)"
-
-	## auth stuff
-	myconf+=" $(use_with policykit polkit)"
-	myconf+=" $(use_with sasl)"
-
-	# network bits
-	myconf+=" $(use_with macvtap)"
-	myconf+=" $(use_with pcap libpcap)"
-	myconf+=" $(use_with vepa virtualport)"
-	myconf+=" $(use_with firewalld)"
-
-	## other
-	myconf+=" $(use_enable nls)"
-
-	# user privilege bits fir qemu/kvm
-	if use caps; then
-		myconf+=" --with-qemu-user=qemu"
-		myconf+=" --with-qemu-group=qemu"
-	else
-		myconf+=" --with-qemu-user=root"
-		myconf+=" --with-qemu-group=root"
-	fi
-
-	# audit support
-	myconf+=" $(use_with audit)"
-
-	# wireshark dissector
-	myconf+=" $(use_with wireshark-plugins wireshark-dissector)"
-
-	## stuff we don't yet support
-	myconf+=" --without-netcf"
-
-	# locking support
-	myconf+=" --without-sanlock"
-
-	# systemd unit files
-	myconf+=" $(use_with systemd systemd-daemon)"
-	use systemd && myconf+=" --with-init-script=systemd"
-
-	# this is a nasty trick to work around the problem in bug
-	# #275073. The reason why we don't solve this properly is that
-	# it'll require us to rebuild autotools (and we don't really want
-	# to do that right now). The proper solution has been sent
-	# upstream and should hopefully land in 0.7.7, in the mean time,
-	# mime the same functionality with this.
-	case ${CHOST} in
-		*cygwin* | *mingw* )
-			;;
-		*)
-			ac_cv_prog_WINDRES=no
-			;;
-	esac
-
-	econf \
-		${myconf} \
-		--disable-static \
-		--disable-werror \
-		--with-remote \
-		--docdir=/usr/share/doc/${PF} \
+		--docdir=/usr/share/doc/${PF}
+		--htmldir=/usr/share/doc/${PF}/html
 		--localstatedir=/var
+	)
+
+	if use virtualbox && has_version app-emulation/virtualbox-ose; then
+		myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
+	else
+		myeconfargs+=( $(use_with virtualbox vbox) )
+	fi
+
+	autotools-utils_src_configure
 
 	if [[ ${PV} = *9999* ]]; then
 		# Restore gnulib's config.sub and config.guess
@@ -423,13 +323,9 @@
 }
 
 src_install() {
-	emake install \
+	autotools-utils_src_compile install \
 		DESTDIR="${D}" \
-		HTML_DIR=/usr/share/doc/${PF}/html \
-		DOCS_DIR=/usr/share/doc/${PF} \
-		EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
-		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
-		|| die "emake install failed"
+		SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
 
 	find "${D}" -name '*.la' -delete || die
 
@@ -449,12 +345,14 @@
 	systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
 
 	newinitd "${S}/libvirtd.init" libvirtd || die
-	newinitd "${FILESDIR}/libvirt-guests.init" libvirt-guests || die
+	newinitd "${FILESDIR}/libvirt-guests.init-r1" libvirt-guests || die
 	newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
 
 	newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
 	newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
 
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
+	DISABLE_AUTOFORMATTING=true
 	readme.gentoo_create_doc
 }
 
@@ -463,16 +361,6 @@
 	if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
 		rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
 	fi
-
-	# We really don't want to use or support old PolicyKit cause it
-	# screws with the new polkit integration
-	if has_version sys-auth/policykit; then
-		rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
-	fi
-
-	# Only sysctl files ending in .conf work
-	dodir /etc/sysctl.d
-	mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
 }
 
 pkg_postinst() {
@@ -487,5 +375,7 @@
 		FORCE_PRINT_ELOG=true
 	fi
 
+	DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
+	DISABLE_AUTOFORMATTING=true
 	readme.gentoo_print_elog
 }
diff --git a/app-emulation/libvirt/metadata.xml b/app-emulation/libvirt/metadata.xml
index 34d90a3..7a316de 100644
--- a/app-emulation/libvirt/metadata.xml
+++ b/app-emulation/libvirt/metadata.xml
@@ -55,7 +55,6 @@
 	</flag>
 	<!-- Miscellaneous flags -->
 	<flag name="apparmor">Enable AppArmor support</flag>
-	<flag name="audit">support <pkg>sys-process/audit</pkg></flag>
 	<flag name="fuse">Allow LXC to use <pkg>sys-fs/fuse</pkg> for mount
 		points</flag>
 	<flag name="numa">
diff --git a/app-emulation/lxc/lxc-1.0.6-r1.ebuild b/app-emulation/lxc/lxc-1.0.6-r1.ebuild
index a9b43e5..5fcb857 100644
--- a/app-emulation/lxc/lxc-1.0.6-r1.ebuild
+++ b/app-emulation/lxc/lxc-1.0.6-r1.ebuild
@@ -56,6 +56,7 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:	needed for pts inside container"
@@ -77,6 +78,7 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT=":CONFIG_GRKERNSEC_CHROOT_PIVOT	some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD=":CONFIG_GRKERNSEC_CHROOT_CHMOD	some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS=":CONFIG_GRKERNSEC_CHROOT_CAPS	some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC=":CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxc/lxc-1.0.7.ebuild b/app-emulation/lxc/lxc-1.0.7.ebuild
index b671442..bec1ea9 100644
--- a/app-emulation/lxc/lxc-1.0.7.ebuild
+++ b/app-emulation/lxc/lxc-1.0.7.ebuild
@@ -56,6 +56,7 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:	needed for pts inside container"
@@ -77,6 +78,7 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT=":CONFIG_GRKERNSEC_CHROOT_PIVOT	some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD=":CONFIG_GRKERNSEC_CHROOT_CHMOD	some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS=":CONFIG_GRKERNSEC_CHROOT_CAPS	some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC=":CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxc/lxc-1.1.0-r6.ebuild b/app-emulation/lxc/lxc-1.1.0-r6.ebuild
index 5551bc9..3976c1f 100644
--- a/app-emulation/lxc/lxc-1.1.0-r6.ebuild
+++ b/app-emulation/lxc/lxc-1.1.0-r6.ebuild
@@ -61,6 +61,8 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
+	~!GRKERNSEC_SYSFS_RESTRICT
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:  needed for pts inside container"
@@ -89,6 +91,8 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS:  some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxc/lxc-1.1.1-r1.ebuild b/app-emulation/lxc/lxc-1.1.1-r1.ebuild
index fbdb089..a4f137c 100644
--- a/app-emulation/lxc/lxc-1.1.1-r1.ebuild
+++ b/app-emulation/lxc/lxc-1.1.1-r1.ebuild
@@ -61,6 +61,8 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
+	~!GRKERNSEC_SYSFS_RESTRICT
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:  needed for pts inside container"
@@ -89,6 +91,8 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS:  some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxc/lxc-1.1.2-r1.ebuild b/app-emulation/lxc/lxc-1.1.2-r1.ebuild
index 8dd8dd2..6e09da1 100644
--- a/app-emulation/lxc/lxc-1.1.2-r1.ebuild
+++ b/app-emulation/lxc/lxc-1.1.2-r1.ebuild
@@ -61,6 +61,8 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
+	~!GRKERNSEC_SYSFS_RESTRICT
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:  needed for pts inside container"
@@ -89,6 +91,8 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS:  some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxc/lxc-1.1.2-r2.ebuild b/app-emulation/lxc/lxc-1.1.2-r2.ebuild
index 8dd8dd2..6e09da1 100644
--- a/app-emulation/lxc/lxc-1.1.2-r2.ebuild
+++ b/app-emulation/lxc/lxc-1.1.2-r2.ebuild
@@ -61,6 +61,8 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
+	~!GRKERNSEC_SYSFS_RESTRICT
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:  needed for pts inside container"
@@ -89,6 +91,8 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS:  some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxc/lxc-1.1.2.ebuild b/app-emulation/lxc/lxc-1.1.2.ebuild
index 660348e..542aca0 100644
--- a/app-emulation/lxc/lxc-1.1.2.ebuild
+++ b/app-emulation/lxc/lxc-1.1.2.ebuild
@@ -61,6 +61,8 @@
 	~!GRKERNSEC_CHROOT_PIVOT
 	~!GRKERNSEC_CHROOT_CHMOD
 	~!GRKERNSEC_CHROOT_CAPS
+	~!GRKERNSEC_PROC
+	~!GRKERNSEC_SYSFS_RESTRICT
 "
 
 ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES:  needed for pts inside container"
@@ -89,6 +91,8 @@
 ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD:  some GRSEC features make LXC unusable see postinst notes"
 ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS:  some GRSEC features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC:  this GRSEC feature is incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT:  this GRSEC feature is incompatible with unprivileged containers"
 
 DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
 
diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
index 6254714..88f5361 100644
--- a/app-emulation/lxd/Manifest
+++ b/app-emulation/lxd/Manifest
@@ -1,3 +1,4 @@
 DIST lxd-0.13.tar.bz2 3336161 SHA256 4228979ea9a856647f75f0230f58cc577c111a287f148787af766ab36c55f756 SHA512 12cd865ef63702674342df23ebb298b6ba39f0d44e9bfe91c643820be06ff30910145388a4daa2d63fbcb53c236e3cd4eb84e3e0bc617c85247322b0024c4920 WHIRLPOOL 82e788e9b35429df308d498955bd0cab06eb7d1a09c0a20bddad78490900b2cb78a44da9970db149ebfda546250a1d5aa2204e5f6f98b81a228310bfee3003a7
 DIST lxd-0.14.tar.bz2 2526939 SHA256 c0c51ac5b3d30c7906323eba965011073b412a3c354ce095e46f14df4298c46c SHA512 d3f9eb38cdf71add270c895c1583dab85b0e0dba0d956900628b519881b41582113d6c25d37b9522493de069ad6a43b197ae895aefeb83391337273a4b60953e WHIRLPOOL 2b9c6931b81df7e60b13e35bfcd5272a46fb29377e11f6326616f55bf6c583db7be82d41273369518e9b9e434bee3b30f989b6816cd8dbdd40cc2cc1effac7b4
 DIST lxd-0.16.tar.bz2 2660683 SHA256 bbe2b7542af34c93c7509e9638016a420bfc1daf1f1f45a33fa3d379ae10f14f SHA512 856e5ea1920ec3025cbd308a8e2ef656393a149111a38188f749e7d42a41032d762009d85316815c3f18ac0907fa9380758ca48666b13e900c9bbdf809d57f1c WHIRLPOOL f4bbea69073f2cc0dce65e39d88cdf1a0fadd4629b5b42bdee7ab385df459f78a2e36619c40ace687be124fb8d59c0da043cb1a8195630b2d0a051ab53297b89
+DIST lxd-0.18.tar.bz2 2674919 SHA256 cb9c4823fb19ccef4827ee4dc3a105b60d3549b5023f4517d1471487469ea395 SHA512 5bbaae6eef27a0b14f8fee41d113afeea61de5414e5f7ed5011819eb6823a11dff647ac3f9781357304f7c5b04c618d05e4a04197cae6c6e4845cad5476d22ff WHIRLPOOL ca73e587f19491d79b03af2d205ab9f234b5acb1ff1f2d68a05be053cbd1ec89f6b9bc0fc64113980d7f2d6e3c7ece01d7d0c431c08a87b2b0ec555c6ff97914
diff --git a/app-emulation/lxd/files/lxd-0.18-dont-go-get.patch b/app-emulation/lxd/files/lxd-0.18-dont-go-get.patch
new file mode 100644
index 0000000..1b229ea
--- /dev/null
+++ b/app-emulation/lxd/files/lxd-0.18-dont-go-get.patch
@@ -0,0 +1,18 @@
+--- Makefile.orig	2015-09-17 20:37:16.481867339 -0500
++++ Makefile	2015-09-17 20:53:27.715800926 -0500
+@@ -12,15 +12,11 @@
+ 
+ .PHONY: default
+ default:
+-	-go get -t -v -d ./...
+-	-go get -t -v -d ./...
+ 	go install -v ./...
+ 	@echo "LXD built succesfuly"
+ 
+ .PHONY: client
+ client:
+-	-go get -t -v -d ./...
+-	-go get -t -v -d ./...
+ 	go install -v ./lxc
+ 	@echo "LXD client built succesfuly"
+ 
diff --git a/app-emulation/lxd/files/lxd-0.18-nc-binary-name.patch b/app-emulation/lxd/files/lxd-0.18-nc-binary-name.patch
new file mode 100644
index 0000000..b88b7f7
--- /dev/null
+++ b/app-emulation/lxd/files/lxd-0.18-nc-binary-name.patch
@@ -0,0 +1,11 @@
+--- lxd/rsync.go.orig	2015-09-17 21:00:29.290772099 -0500
++++ lxd/rsync.go	2015-09-17 21:00:54.737770359 -0500
+@@ -73,7 +73,7 @@
+ 	 * command (i.e. the command to run on --server). However, we're
+ 	 * hardcoding that at the other end, so we can just ignore it.
+ 	 */
+-	rsyncCmd := fmt.Sprintf("sh -c \"nc -U %s\"", f.Name())
++	rsyncCmd := fmt.Sprintf("sh -c \"nc.openbsd -U %s\"", f.Name())
+ 	cmd := exec.Command("rsync", "-arvP", "--devices", "--partial", path, "localhost:/tmp/foo", "-e", rsyncCmd)
+ 	if err := cmd.Start(); err != nil {
+ 		return nil, nil, err
diff --git a/app-emulation/lxd/files/lxd-0.18.confd b/app-emulation/lxd/files/lxd-0.18.confd
new file mode 100644
index 0000000..3d55327
--- /dev/null
+++ b/app-emulation/lxd/files/lxd-0.18.confd
@@ -0,0 +1,27 @@
+# Group which owns the shared socket
+LXD_OPTIONS+=" --group lxd"
+
+
+
+# Enable cpu profiling into the specified file
+#LXD_OPTIONS+=" --cpuprofile /tmp/lxc_cpu_profile"
+
+# Enable memory profiling into the specified file
+#LXD_OPTIONS+=" --memprofile /tmp/lxc_mem_profile"
+
+
+
+# Enables debug mode
+#LXD_OPTIONS+=" --debug"
+
+# For debugging, print a complete stack trace every n seconds
+#LXD_OPTIONS+=" --print-goroutines-every 5"
+
+# Enables verbose mode
+#LXD_OPTIONS+=" -v"
+
+# Logfile to log to
+#LXD_OPTIONS+=" --logfile /var/log/lxd/lxd.log"
+
+# Enables syslog logging
+#LXD_OPTIONS+=" --syslog"
diff --git a/app-emulation/lxd/files/lxd-0.18.initd b/app-emulation/lxd/files/lxd-0.18.initd
new file mode 100644
index 0000000..2b75e51
--- /dev/null
+++ b/app-emulation/lxd/files/lxd-0.18.initd
@@ -0,0 +1,32 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+DAEMON=/usr/sbin/lxd
+PIDFILE=/run/lxd.pid
+
+depend() {
+    need cgmanager
+    need net
+}
+
+start() {
+    ebegin "Starting lxd server"
+
+    start-stop-daemon --start \
+		      --pidfile ${PIDFILE} \
+		      --exec ${DAEMON} \
+		      --background \
+		      --make-pidfile \
+		      -- \
+		      ${LXD_OPTIONS}
+
+    eend $?
+}
+
+stop() {
+    ebegin "Stopping lxd server"
+    start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
+    eend $?
+}
diff --git a/app-emulation/lxd/lxd-0.18.ebuild b/app-emulation/lxd/lxd-0.18.ebuild
new file mode 100644
index 0000000..fd53d98
--- /dev/null
+++ b/app-emulation/lxd/lxd-0.18.ebuild
@@ -0,0 +1,166 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Fast, dense and secure container management"
+HOMEPAGE="https://linuxcontainers.org/lxd/introduction/"
+EGO_PN_PARENT="github.com/lxc"
+EGO_PN="${EGO_PN_PARENT}/lxd"
+SRC_URI="http://961db08fe45d5f5dd062-b8a7a040508aea6d369676e49b80719d.r29.cf2.rackcdn.com/${P}.tar.bz2"
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+PLOCALES="de fr ja"
+IUSE="btrfs +criu +daemon lvm nls test"
+
+# IUSE and PLOCALES must be defined before l10n inherited
+inherit bash-completion-r1 eutils golang-build l10n systemd user vcs-snapshot
+
+DEPEND="
+	dev-go/go-crypto
+	>=dev-lang/go-1.4.2:=
+	dev-libs/protobuf
+	dev-vcs/git
+	nls? ( sys-devel/gettext )
+	test? (
+		app-misc/jq
+		dev-db/sqlite
+		net-misc/curl
+		sys-devel/gettext
+	)
+"
+
+RDEPEND="
+	daemon? (
+		app-admin/cgmanager
+		app-arch/xz-utils
+		app-emulation/lxc[cgmanager,seccomp]
+		net-analyzer/openbsd-netcat
+		net-misc/bridge-utils
+		net-misc/rsync[xattr]
+		sys-apps/iproute2
+		virtual/acl
+		btrfs? (
+			sys-fs/btrfs-progs
+		)
+		criu? (
+			sys-process/criu
+		)
+		lvm? (
+			sys-fs/lvm2
+		)
+	)
+"
+
+# KNOWN ISSUES:
+# - Translations may not work.  I've been unsuccessful in forcing
+#   localized output.  Anyway, upstream (Canonical) doesn't install the
+#   message files.
+
+# TODO:
+# - since 0.15 gccgo is a supported compiler ('make gccgo').  It would
+#   be preferable for that support to go into the golang-build eclass not
+#   this package directly.
+# - Add apparmor USE.  There are some exec calls to apparmor_parser
+# - Test build with Go 1.4 & 1.5
+# - integrate "lxd shutdown" into initscript as custom action (default "stop"
+#   action should _not_ stop containers amirite?)
+#   "Perform a clean shutdown of LXD and all running containers"
+
+src_prepare() {
+	cd "${S}/src/${EGO_PN}"
+
+	epatch "${FILESDIR}/${P}-dont-go-get.patch"
+
+	# Upstream requires the openbsd flavor of netcat (with -U), but
+	# Gentoo installs that with a renamed binary
+	epatch "${FILESDIR}/${P}-nc-binary-name.patch"
+
+	# Warn on unhandled locale changes
+	l10n_find_plocales_changes po "" .po
+}
+
+src_compile() {
+	golang-build_src_compile
+
+	cd "${S}/src/${EGO_PN}"
+
+	if use daemon; then
+		# Build binaries
+		GOPATH="${S}:$(get_golibdir_gopath)" emake
+	else
+		# build client tool
+		GOPATH="${S}:$(get_golibdir_gopath)" emake client
+	fi
+
+	use nls && emake build-mo
+}
+
+src_test() {
+	if use daemon; then
+		# Go native tests should succeed
+		golang-build_src_test
+	fi
+}
+
+src_install() {
+	# Installs all src,pkg to /usr/lib/go-gentoo
+	golang-build_src_install
+
+	cd "${S}"
+	dobin bin/lxc
+	if use daemon; then
+		dobin bin/fuidshift
+
+		dosbin bin/lxd
+	fi
+
+	cd "src/${EGO_PN}"
+
+	if use nls; then
+		for lingua in ${PLOCALES}; do
+			if use linguas_${lingua}; then
+				domo po/${lingua}.mo
+			fi
+		done
+	fi
+
+	if use daemon; then
+		newinitd "${FILESDIR}"/${P}.initd lxd
+		newconfd "${FILESDIR}"/${P}.confd lxd
+
+		systemd_dounit "${FILESDIR}"/lxd.service
+	fi
+
+	newbashcomp config/bash/lxc.in lxc
+
+	dodoc AUTHORS CONTRIBUTING.md README.md
+
+	docinto specs
+	dodoc specs/*
+}
+
+pkg_postinst() {
+	einfo
+	einfo "Consult https://wiki.gentoo.org/wiki/LXD for more information,"
+	einfo "including a Quick Start."
+
+	# The messaging below only applies to daemon installs
+	use daemon || return 0
+
+	# The control socket will be owned by (and writeable by) this group.
+	enewgroup lxd
+
+	# Ubuntu also defines an lxd user but it appears unused (the daemon
+	# must run as root)
+
+	if test -n "${REPLACING_VERSIONS}"; then
+		einfo
+		einfo "If you are upgrading from version 0.14 or older, note that the --tcp"
+		einfo "is no longer available in /etc/conf.d/lxd.  Instead, configure the"
+		einfo "listen address/port by setting the core.https_address server option."
+	fi
+}
diff --git a/app-emulation/lxd/metadata.xml b/app-emulation/lxd/metadata.xml
index c49dbec..46d6c90 100644
--- a/app-emulation/lxd/metadata.xml
+++ b/app-emulation/lxd/metadata.xml
@@ -19,6 +19,10 @@
 		<remote-id type="github">lxc/lxd</remote-id>
 	</upstream>
 	<use>
+		<flag name="btrfs">
+			Add support for managing instance/snapshot
+			disk using btrfs subvolumes
+		</flag>
 		<flag name="criu">
 			Add support for live-migrateable containers
 		</flag>
diff --git a/app-emulation/qemu/Manifest b/app-emulation/qemu/Manifest
index dd9b756..fe4fd4c 100644
--- a/app-emulation/qemu/Manifest
+++ b/app-emulation/qemu/Manifest
@@ -1,3 +1,4 @@
 DIST qemu-2.3.0.tar.bz2 24683085 SHA256 b6bab7f763d5be73e7cb5ee7d4c8365b7a8df2972c52fa5ded18893bd8281588 SHA512 7a40d213c5696b27784abd2a3119e49d42c38c923be431826c73a8f14c19074435d7f1a652686c53baf08e81f5a3005b2ddc92d67c32f6a2b19659ab627e9eaa WHIRLPOOL 9dad6e342027c3be512b4e0b40e810e0a6f1dc84a16847aa5aac74d97f7a347e60d42e770335a090f83e90a1614294f86552a84edc1faafc7093d3e32602f5de
 DIST qemu-2.3.1.tar.bz2 24692020 SHA256 661d029809421cae06b4b1bc74ac0e560cb4ed47c9523c676ff277fa26dca15f SHA512 309e6df7dcc0a064d1a17c7dac2f60398700dfa8c6b60b66e4202966248097cbc49af75aa97725bc34773151be6fd75836810e9f0741ba65cdc208414fa78f6b WHIRLPOOL 26750ee00513daa99cdcd585c4b8407b8258a9c3559ae6335266d7754cb6679e7c10c56f8d12ae0ef2b5cd5d6a9a6a536213f8e86e81ced37e46205c796a773e
+DIST qemu-2.4.0.1.tar.bz2 25068555 SHA256 ecfe8b88037e41e817d72c460c56c6a0b573d540d6ba38b162d0de4fd22d1bdb SHA512 08eabe92fa9096386ef00f8e9d99eeec1508d15e5a98431e043a729cbaca2d96d6e3afc612e7c4a0fe5a6bba80006276185f1066b4c73105b2ea24b7e9133b84 WHIRLPOOL 1daaec23d6ada6af8bf4902e590fb96375e7149d2f53ff6bf6d8fb39722c182a2d2efcc0d40bee673a8316f621983c512daa54202bb4e632b3a4b09f0268cd09
 DIST qemu-2.4.0.tar.bz2 25070979 SHA256 72b0b991bbcc540663a019e1e8c4f714053b691dda32c9b9ee80b25f367e6620 SHA512 8740e0fb2c654ed897dff4649f1f83d14d57cfa9cbde723899f115982f93253ce9a2bddd60aab379d241027d2044137770efe4c0b3c83d5b20f3a2a06f05a5dc WHIRLPOOL 8c6cfae096624e01f0d5daeb86aa2dccbeaa86d2aeab626cf55cf20b7edace82d0b0f3a1d85eeb2dc1fd53abaaa9dccf8f0d7ddc657a1f5ffd72fd68301648f1
diff --git a/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-6855.patch b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-6855.patch
new file mode 100644
index 0000000..69dd66a
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-6855.patch
@@ -0,0 +1,146 @@
+https://bugs.gentoo.org/560422
+
+From d9033e1d3aa666c5071580617a57bd853c5d794a Mon Sep 17 00:00:00 2001
+From: John Snow <jsnow@redhat.com>
+Date: Thu, 17 Sep 2015 14:17:05 -0400
+Subject: [PATCH] ide: fix ATAPI command permissions
+
+We're a little too lenient with what we'll let an ATAPI drive handle.
+Clamp down on the IDE command execution table to remove CD_OK permissions
+from commands that are not and have never been ATAPI commands.
+
+For ATAPI command validity, please see:
+- ATA4 Section 6.5 ("PACKET Command feature set")
+- ATA8/ACS Section 4.3 ("The PACKET feature set")
+- ACS3 Section 4.3 ("The PACKET feature set")
+
+ACS3 has a historical command validity table in Table B.4
+("Historical Command Assignments") that can be referenced to find when
+a command was introduced, deprecated, obsoleted, etc.
+
+The only reference for ATAPI command validity is by checking that
+version's PACKET feature set section.
+
+ATAPI was introduced by T13 into ATA4, all commands retired prior to ATA4
+therefore are assumed to have never been ATAPI commands.
+
+Mandatory commands, as listed in ATA8-ACS3, are:
+
+- DEVICE RESET
+- EXECUTE DEVICE DIAGNOSTIC
+- IDENTIFY DEVICE
+- IDENTIFY PACKET DEVICE
+- NOP
+- PACKET
+- READ SECTOR(S)
+- SET FEATURES
+
+Optional commands as listed in ATA8-ACS3, are:
+
+- FLUSH CACHE
+- READ LOG DMA EXT
+- READ LOG EXT
+- WRITE LOG DMA EXT
+- WRITE LOG EXT
+
+All other commands are illegal to send to an ATAPI device and should
+be rejected by the device.
+
+CD_OK removal justifications:
+
+0x06 WIN_DSM              Defined in ACS2. Not valid for ATAPI.
+0x21 WIN_READ_ONCE        Retired in ATA5. Not ATAPI in ATA4.
+0x94 WIN_STANDBYNOW2      Retired in ATA4. Did not coexist with ATAPI.
+0x95 WIN_IDLEIMMEDIATE2   Retired in ATA4. Did not coexist with ATAPI.
+0x96 WIN_STANDBY2         Retired in ATA4. Did not coexist with ATAPI.
+0x97 WIN_SETIDLE2         Retired in ATA4. Did not coexist with ATAPI.
+0x98 WIN_CHECKPOWERMODE2  Retired in ATA4. Did not coexist with ATAPI.
+0x99 WIN_SLEEPNOW2        Retired in ATA4. Did not coexist with ATAPI.
+0xE0 WIN_STANDBYNOW1      Not part of ATAPI in ATA4, ACS or ACS3.
+0xE1 WIN_IDLEIMMDIATE     Not part of ATAPI in ATA4, ACS or ACS3.
+0xE2 WIN_STANDBY          Not part of ATAPI in ATA4, ACS or ACS3.
+0xE3 WIN_SETIDLE1         Not part of ATAPI in ATA4, ACS or ACS3.
+0xE4 WIN_CHECKPOWERMODE1  Not part of ATAPI in ATA4, ACS or ACS3.
+0xE5 WIN_SLEEPNOW1        Not part of ATAPI in ATA4, ACS or ACS3.
+0xF8 WIN_READ_NATIVE_MAX  Obsoleted in ACS3. Not ATAPI in ATA4 or ACS.
+
+This patch fixes a divide by zero fault that can be caused by sending
+the WIN_READ_NATIVE_MAX command to an ATAPI drive, which causes it to
+attempt to use zeroed CHS values to perform sector arithmetic.
+
+Reported-by: Qinghao Tang <luodalongde@gmail.com>
+Signed-off-by: John Snow <jsnow@redhat.com>
+Reviewed-by: Markus Armbruster <armbru@redhat.com>
+Message-id: 1441816082-21031-1-git-send-email-jsnow@redhat.com
+CC: qemu-stable@nongnu.org
+---
+ hw/ide/core.c | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/hw/ide/core.c b/hw/ide/core.c
+index 8ba04df..1cc6945 100644
+--- a/hw/ide/core.c
++++ b/hw/ide/core.c
+@@ -1746,11 +1746,11 @@ static const struct {
+ } ide_cmd_table[0x100] = {
+     /* NOP not implemented, mandatory for CD */
+     [CFA_REQ_EXT_ERROR_CODE]      = { cmd_cfa_req_ext_error_code, CFA_OK },
+-    [WIN_DSM]                     = { cmd_data_set_management, ALL_OK },
++    [WIN_DSM]                     = { cmd_data_set_management, HD_CFA_OK },
+     [WIN_DEVICE_RESET]            = { cmd_device_reset, CD_OK },
+     [WIN_RECAL]                   = { cmd_nop, HD_CFA_OK | SET_DSC},
+     [WIN_READ]                    = { cmd_read_pio, ALL_OK },
+-    [WIN_READ_ONCE]               = { cmd_read_pio, ALL_OK },
++    [WIN_READ_ONCE]               = { cmd_read_pio, HD_CFA_OK },
+     [WIN_READ_EXT]                = { cmd_read_pio, HD_CFA_OK },
+     [WIN_READDMA_EXT]             = { cmd_read_dma, HD_CFA_OK },
+     [WIN_READ_NATIVE_MAX_EXT]     = { cmd_read_native_max, HD_CFA_OK | SET_DSC },
+@@ -1769,12 +1769,12 @@ static const struct {
+     [CFA_TRANSLATE_SECTOR]        = { cmd_cfa_translate_sector, CFA_OK },
+     [WIN_DIAGNOSE]                = { cmd_exec_dev_diagnostic, ALL_OK },
+     [WIN_SPECIFY]                 = { cmd_nop, HD_CFA_OK | SET_DSC },
+-    [WIN_STANDBYNOW2]             = { cmd_nop, ALL_OK },
+-    [WIN_IDLEIMMEDIATE2]          = { cmd_nop, ALL_OK },
+-    [WIN_STANDBY2]                = { cmd_nop, ALL_OK },
+-    [WIN_SETIDLE2]                = { cmd_nop, ALL_OK },
+-    [WIN_CHECKPOWERMODE2]         = { cmd_check_power_mode, ALL_OK | SET_DSC },
+-    [WIN_SLEEPNOW2]               = { cmd_nop, ALL_OK },
++    [WIN_STANDBYNOW2]             = { cmd_nop, HD_CFA_OK },
++    [WIN_IDLEIMMEDIATE2]          = { cmd_nop, HD_CFA_OK },
++    [WIN_STANDBY2]                = { cmd_nop, HD_CFA_OK },
++    [WIN_SETIDLE2]                = { cmd_nop, HD_CFA_OK },
++    [WIN_CHECKPOWERMODE2]         = { cmd_check_power_mode, HD_CFA_OK | SET_DSC },
++    [WIN_SLEEPNOW2]               = { cmd_nop, HD_CFA_OK },
+     [WIN_PACKETCMD]               = { cmd_packet, CD_OK },
+     [WIN_PIDENTIFY]               = { cmd_identify_packet, CD_OK },
+     [WIN_SMART]                   = { cmd_smart, HD_CFA_OK | SET_DSC },
+@@ -1788,19 +1788,19 @@ static const struct {
+     [WIN_WRITEDMA]                = { cmd_write_dma, HD_CFA_OK },
+     [WIN_WRITEDMA_ONCE]           = { cmd_write_dma, HD_CFA_OK },
+     [CFA_WRITE_MULTI_WO_ERASE]    = { cmd_write_multiple, CFA_OK },
+-    [WIN_STANDBYNOW1]             = { cmd_nop, ALL_OK },
+-    [WIN_IDLEIMMEDIATE]           = { cmd_nop, ALL_OK },
+-    [WIN_STANDBY]                 = { cmd_nop, ALL_OK },
+-    [WIN_SETIDLE1]                = { cmd_nop, ALL_OK },
+-    [WIN_CHECKPOWERMODE1]         = { cmd_check_power_mode, ALL_OK | SET_DSC },
+-    [WIN_SLEEPNOW1]               = { cmd_nop, ALL_OK },
++    [WIN_STANDBYNOW1]             = { cmd_nop, HD_CFA_OK },
++    [WIN_IDLEIMMEDIATE]           = { cmd_nop, HD_CFA_OK },
++    [WIN_STANDBY]                 = { cmd_nop, HD_CFA_OK },
++    [WIN_SETIDLE1]                = { cmd_nop, HD_CFA_OK },
++    [WIN_CHECKPOWERMODE1]         = { cmd_check_power_mode, HD_CFA_OK | SET_DSC },
++    [WIN_SLEEPNOW1]               = { cmd_nop, HD_CFA_OK },
+     [WIN_FLUSH_CACHE]             = { cmd_flush_cache, ALL_OK },
+     [WIN_FLUSH_CACHE_EXT]         = { cmd_flush_cache, HD_CFA_OK },
+     [WIN_IDENTIFY]                = { cmd_identify, ALL_OK },
+     [WIN_SETFEATURES]             = { cmd_set_features, ALL_OK | SET_DSC },
+     [IBM_SENSE_CONDITION]         = { cmd_ibm_sense_condition, CFA_OK | SET_DSC },
+     [CFA_WEAR_LEVEL]              = { cmd_cfa_erase_sectors, HD_CFA_OK | SET_DSC },
+-    [WIN_READ_NATIVE_MAX]         = { cmd_read_native_max, ALL_OK | SET_DSC },
++    [WIN_READ_NATIVE_MAX]         = { cmd_read_native_max, HD_CFA_OK | SET_DSC },
+ };
+ 
+ static bool ide_cmd_permitted(IDEState *s, uint32_t cmd)
+-- 
+2.6.0.rc2.230.g3dd15c0
+
diff --git a/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-1.patch b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-1.patch
new file mode 100644
index 0000000..4ee46e1
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-1.patch
@@ -0,0 +1,58 @@
+https://bugs.gentoo.org/560760
+
+From ce317461573bac12b10d67699b4ddf1f97cf066c Mon Sep 17 00:00:00 2001
+From: Jason Wang <jasowang@redhat.com>
+Date: Fri, 25 Sep 2015 13:21:28 +0800
+Subject: [PATCH 1/3] virtio: introduce virtqueue_unmap_sg()
+
+Factor out sg unmapping logic. This will be reused by the patch that
+can discard descriptor.
+
+Cc: Michael S. Tsirkin <mst@redhat.com>
+Cc: Andrew James <andrew.james@hpe.com>
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+---
+ hw/virtio/virtio.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
+index 7504f8b..6f2b96c 100644
+--- a/hw/virtio/virtio.c
++++ b/hw/virtio/virtio.c
+@@ -244,14 +244,12 @@ int virtio_queue_empty(VirtQueue *vq)
+     return vring_avail_idx(vq) == vq->last_avail_idx;
+ }
+ 
+-void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
+-                    unsigned int len, unsigned int idx)
++static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem,
++                               unsigned int len)
+ {
+     unsigned int offset;
+     int i;
+ 
+-    trace_virtqueue_fill(vq, elem, len, idx);
+-
+     offset = 0;
+     for (i = 0; i < elem->in_num; i++) {
+         size_t size = MIN(len - offset, elem->in_sg[i].iov_len);
+@@ -267,6 +265,14 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
+         cpu_physical_memory_unmap(elem->out_sg[i].iov_base,
+                                   elem->out_sg[i].iov_len,
+                                   0, elem->out_sg[i].iov_len);
++}
++
++void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
++                    unsigned int len, unsigned int idx)
++{
++    trace_virtqueue_fill(vq, elem, len, idx);
++
++    virtqueue_unmap_sg(vq, elem, len);
+ 
+     idx = (idx + vring_used_idx(vq)) % vq->vring.num;
+ 
+-- 
+2.6.0.rc2.230.g3dd15c0
+
diff --git a/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-2.patch b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-2.patch
new file mode 100644
index 0000000..8c73fcb
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-2.patch
@@ -0,0 +1,54 @@
+https://bugs.gentoo.org/560760
+
+From 29b9f5efd78ae0f9cc02dd169b6e80d2c404bade Mon Sep 17 00:00:00 2001
+From: Jason Wang <jasowang@redhat.com>
+Date: Fri, 25 Sep 2015 13:21:29 +0800
+Subject: [PATCH 2/3] virtio: introduce virtqueue_discard()
+
+This patch introduces virtqueue_discard() to discard a descriptor and
+unmap the sgs. This will be used by the patch that will discard
+descriptor when packet is truncated.
+
+Cc: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+---
+ hw/virtio/virtio.c         | 7 +++++++
+ include/hw/virtio/virtio.h | 2 ++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
+index 6f2b96c..d0bc72e 100644
+--- a/hw/virtio/virtio.c
++++ b/hw/virtio/virtio.c
+@@ -267,6 +267,13 @@ static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem,
+                                   0, elem->out_sg[i].iov_len);
+ }
+ 
++void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem,
++                       unsigned int len)
++{
++    vq->last_avail_idx--;
++    virtqueue_unmap_sg(vq, elem, len);
++}
++
+ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
+                     unsigned int len, unsigned int idx)
+ {
+diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
+index 6201ee8..9d09115 100644
+--- a/include/hw/virtio/virtio.h
++++ b/include/hw/virtio/virtio.h
+@@ -146,6 +146,8 @@ void virtio_del_queue(VirtIODevice *vdev, int n);
+ void virtqueue_push(VirtQueue *vq, const VirtQueueElement *elem,
+                     unsigned int len);
+ void virtqueue_flush(VirtQueue *vq, unsigned int count);
++void virtqueue_discard(VirtQueue *vq, const VirtQueueElement *elem,
++                       unsigned int len);
+ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
+                     unsigned int len, unsigned int idx);
+ 
+-- 
+2.6.0.rc2.230.g3dd15c0
+
diff --git a/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-3.patch b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-3.patch
new file mode 100644
index 0000000..96981e9
--- /dev/null
+++ b/app-emulation/qemu/files/qemu-2.4.0-CVE-2015-7295-3.patch
@@ -0,0 +1,47 @@
+https://bugs.gentoo.org/560760
+
+From 0cf33fb6b49a19de32859e2cdc6021334f448fb3 Mon Sep 17 00:00:00 2001
+From: Jason Wang <jasowang@redhat.com>
+Date: Fri, 25 Sep 2015 13:21:30 +0800
+Subject: [PATCH 3/3] virtio-net: correctly drop truncated packets
+
+When packet is truncated during receiving, we drop the packets but
+neither discard the descriptor nor add and signal used
+descriptor. This will lead several issues:
+
+- sg mappings are leaked
+- rx will be stalled if a lots of packets were truncated
+
+In order to be consistent with vhost, fix by discarding the descriptor
+in this case.
+
+Cc: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+---
+ hw/net/virtio-net.c | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
+index d388c55..a877614 100644
+--- a/hw/net/virtio-net.c
++++ b/hw/net/virtio-net.c
+@@ -1094,13 +1094,7 @@ static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t
+          * must have consumed the complete packet.
+          * Otherwise, drop it. */
+         if (!n->mergeable_rx_bufs && offset < size) {
+-#if 0
+-            error_report("virtio-net truncated non-mergeable packet: "
+-                         "i %zd mergeable %d offset %zd, size %zd, "
+-                         "guest hdr len %zd, host hdr len %zd",
+-                         i, n->mergeable_rx_bufs,
+-                         offset, size, n->guest_hdr_len, n->host_hdr_len);
+-#endif
++            virtqueue_discard(q->rx_vq, &elem, total);
+             return size;
+         }
+ 
+-- 
+2.6.0.rc2.230.g3dd15c0
+
diff --git a/app-emulation/qemu/qemu-2.4.0.1.ebuild b/app-emulation/qemu/qemu-2.4.0.1.ebuild
new file mode 100644
index 0000000..306d772
--- /dev/null
+++ b/app-emulation/qemu/qemu-2.4.0.1.ebuild
@@ -0,0 +1,643 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="ncurses,readline"
+
+inherit eutils flag-o-matic linux-info toolchain-funcs multilib python-r1 \
+	user udev fcaps readme.gentoo pax-utils
+
+BACKPORTS=
+
+if [[ ${PV} = *9999* ]]; then
+	EGIT_REPO_URI="git://git.qemu.org/qemu.git"
+	inherit git-2
+	SRC_URI=""
+else
+	SRC_URI="http://wiki.qemu-project.org/download/${P}.tar.bz2
+	${BACKPORTS:+
+		https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz}"
+	KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
+HOMEPAGE="http://www.qemu.org http://www.linux-kvm.org"
+
+LICENSE="GPL-2 LGPL-2 BSD-2"
+SLOT="0"
+IUSE="accessibility +aio alsa bluetooth +caps +curl debug +fdt glusterfs \
+gtk gtk2 infiniband iscsi +jpeg \
+kernel_linux kernel_FreeBSD lzo ncurses nfs nls numa opengl +pin-upstream-blobs
++png pulseaudio python \
+rbd sasl +seccomp sdl sdl2 selinux smartcard snappy spice ssh static static-softmmu
+static-user systemtap tci test +threads tls usb usbredir +uuid vde +vhost-net \
+virtfs +vnc vte xattr xen xfs"
+
+COMMON_TARGETS="aarch64 alpha arm cris i386 m68k microblaze microblazeel mips
+mips64 mips64el mipsel or32 ppc ppc64 s390x sh4 sh4eb sparc sparc64 unicore32
+x86_64"
+IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} lm32 moxie ppcemb tricore xtensa xtensaeb"
+IUSE_USER_TARGETS="${COMMON_TARGETS} armeb mipsn32 mipsn32el ppc64abi32 ppc64le sparc32plus"
+
+use_softmmu_targets=$(printf ' qemu_softmmu_targets_%s' ${IUSE_SOFTMMU_TARGETS})
+use_user_targets=$(printf ' qemu_user_targets_%s' ${IUSE_USER_TARGETS})
+IUSE+=" ${use_softmmu_targets} ${use_user_targets}"
+
+# Allow no targets to be built so that people can get a tools-only build.
+# Block USE flag configurations known to not work.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+	gtk2? ( gtk )
+	qemu_softmmu_targets_arm? ( fdt )
+	qemu_softmmu_targets_microblaze? ( fdt )
+	qemu_softmmu_targets_ppc? ( fdt )
+	qemu_softmmu_targets_ppc64? ( fdt )
+	sdl2? ( sdl )
+	static? ( static-softmmu static-user )
+	static-softmmu? ( !alsa !pulseaudio !bluetooth !opengl !gtk !gtk2 )
+	virtfs? ( xattr )
+	vte? ( gtk )"
+
+# Yep, you need both libcap and libcap-ng since virtfs only uses libcap.
+#
+# The attr lib isn't always linked in (although the USE flag is always
+# respected).  This is because qemu supports using the C library's API
+# when available rather than always using the extranl library.
+COMMON_LIB_DEPEND=">=dev-libs/glib-2.0[static-libs(+)]
+	sys-libs/zlib[static-libs(+)]
+	xattr? ( sys-apps/attr[static-libs(+)] )"
+SOFTMMU_LIB_DEPEND="${COMMON_LIB_DEPEND}
+	>=x11-libs/pixman-0.28.0[static-libs(+)]
+	accessibility? ( app-accessibility/brltty[static-libs(+)] )
+	aio? ( dev-libs/libaio[static-libs(+)] )
+	alsa? ( >=media-libs/alsa-lib-1.0.13 )
+	bluetooth? ( net-wireless/bluez )
+	caps? ( sys-libs/libcap-ng[static-libs(+)] )
+	curl? ( >=net-misc/curl-7.15.4[static-libs(+)] )
+	fdt? ( >=sys-apps/dtc-1.4.0[static-libs(+)] )
+	glusterfs? ( >=sys-cluster/glusterfs-3.4.0[static-libs(+)] )
+	gtk? (
+		gtk2? (
+			x11-libs/gtk+:2
+			vte? ( x11-libs/vte:0 )
+		)
+		!gtk2? (
+			x11-libs/gtk+:3
+			vte? ( x11-libs/vte:2.90 )
+		)
+	)
+	infiniband? ( sys-infiniband/librdmacm:=[static-libs(+)] )
+	iscsi? ( net-libs/libiscsi )
+	jpeg? ( virtual/jpeg:=[static-libs(+)] )
+	lzo? ( dev-libs/lzo:2[static-libs(+)] )
+	ncurses? ( sys-libs/ncurses:0=[static-libs(+)] )
+	nfs? ( >=net-fs/libnfs-1.9.3[static-libs(+)] )
+	numa? ( sys-process/numactl[static-libs(+)] )
+	opengl? (
+		virtual/opengl
+		media-libs/libepoxy[static-libs(+)]
+		media-libs/mesa[static-libs(+)]
+		media-libs/mesa[egl,gles2]
+	)
+	png? ( media-libs/libpng:0=[static-libs(+)] )
+	pulseaudio? ( media-sound/pulseaudio )
+	rbd? ( sys-cluster/ceph[static-libs(+)] )
+	sasl? ( dev-libs/cyrus-sasl[static-libs(+)] )
+	sdl? (
+		!sdl2? (
+			media-libs/libsdl[X]
+			>=media-libs/libsdl-1.2.11[static-libs(+)]
+		)
+		sdl2? (
+			media-libs/libsdl2[X]
+			media-libs/libsdl2[static-libs(+)]
+		)
+	)
+	seccomp? ( >=sys-libs/libseccomp-2.1.0[static-libs(+)] )
+	smartcard? ( dev-libs/nss !app-emulation/libcacard )
+	snappy? ( app-arch/snappy[static-libs(+)] )
+	spice? (
+		>=app-emulation/spice-protocol-0.12.3
+		>=app-emulation/spice-0.12.0[static-libs(+)]
+	)
+	ssh? ( >=net-libs/libssh2-1.2.8[static-libs(+)] )
+	tls? ( net-libs/gnutls[static-libs(+)] )
+	usb? ( >=virtual/libusb-1-r2[static-libs(+)] )
+	usbredir? ( >=sys-apps/usbredir-0.6[static-libs(+)] )
+	uuid? ( >=sys-apps/util-linux-2.16.0[static-libs(+)] )
+	vde? ( net-misc/vde[static-libs(+)] )
+	virtfs? ( sys-libs/libcap )
+	xfs? ( sys-fs/xfsprogs[static-libs(+)] )"
+USER_LIB_DEPEND="${COMMON_LIB_DEPEND}"
+X86_FIRMWARE_DEPEND="
+	>=sys-firmware/ipxe-1.0.0_p20130624
+	pin-upstream-blobs? (
+		~sys-firmware/seabios-1.8.2
+		~sys-firmware/sgabios-0.1_pre8
+		~sys-firmware/vgabios-0.7a
+	)
+	!pin-upstream-blobs? (
+		sys-firmware/seabios
+		sys-firmware/sgabios
+		sys-firmware/vgabios
+	)"
+CDEPEND="
+	!static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND//\[static-libs(+)]} ) " ${use_softmmu_targets}) )
+	!static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND//\[static-libs(+)]} ) " ${use_user_targets}) )
+	qemu_softmmu_targets_i386? ( ${X86_FIRMWARE_DEPEND} )
+	qemu_softmmu_targets_x86_64? ( ${X86_FIRMWARE_DEPEND} )
+	python? ( ${PYTHON_DEPS} )
+	systemtap? ( dev-util/systemtap )
+	xen? ( app-emulation/xen-tools )"
+DEPEND="${CDEPEND}
+	dev-lang/perl
+	=dev-lang/python-2*
+	sys-apps/texinfo
+	virtual/pkgconfig
+	kernel_linux? ( >=sys-kernel/linux-headers-2.6.35 )
+	gtk? ( nls? ( sys-devel/gettext ) )
+	static-softmmu? ( $(printf "%s? ( ${SOFTMMU_LIB_DEPEND} ) " ${use_softmmu_targets}) )
+	static-user? ( $(printf "%s? ( ${USER_LIB_DEPEND} ) " ${use_user_targets}) )
+	test? (
+		dev-libs/glib[utils]
+		sys-devel/bc
+	)"
+RDEPEND="${CDEPEND}
+	selinux? ( sec-policy/selinux-qemu )
+"
+
+STRIP_MASK="/usr/share/qemu/palcode-clipper"
+
+QA_PREBUILT="
+	usr/share/qemu/openbios-ppc
+	usr/share/qemu/openbios-sparc64
+	usr/share/qemu/openbios-sparc32
+	usr/share/qemu/palcode-clipper
+	usr/share/qemu/s390-ccw.img
+	usr/share/qemu/u-boot.e500
+"
+
+QA_WX_LOAD="usr/bin/qemu-i386
+	usr/bin/qemu-x86_64
+	usr/bin/qemu-alpha
+	usr/bin/qemu-arm
+	usr/bin/qemu-cris
+	usr/bin/qemu-m68k
+	usr/bin/qemu-microblaze
+	usr/bin/qemu-microblazeel
+	usr/bin/qemu-mips
+	usr/bin/qemu-mipsel
+	usr/bin/qemu-or32
+	usr/bin/qemu-ppc
+	usr/bin/qemu-ppc64
+	usr/bin/qemu-ppc64abi32
+	usr/bin/qemu-sh4
+	usr/bin/qemu-sh4eb
+	usr/bin/qemu-sparc
+	usr/bin/qemu-sparc64
+	usr/bin/qemu-armeb
+	usr/bin/qemu-sparc32plus
+	usr/bin/qemu-s390x
+	usr/bin/qemu-unicore32"
+
+DOC_CONTENTS="If you don't have kvm compiled into the kernel, make sure
+you have the kernel module loaded before running kvm. The easiest way to
+ensure that the kernel module is loaded is to load it on boot.\n
+For AMD CPUs the module is called 'kvm-amd'\n
+For Intel CPUs the module is called 'kvm-intel'\n
+Please review /etc/conf.d/modules for how to load these\n\n
+Make sure your user is in the 'kvm' group\n
+Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
+
+qemu_support_kvm() {
+	if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386 \
+		use qemu_softmmu_targets_ppc || use qemu_softmmu_targets_ppc64 \
+		use qemu_softmmu_targets_s390x; then
+		return 0
+	fi
+
+	return 1
+}
+
+pkg_pretend() {
+	if use kernel_linux && kernel_is lt 2 6 25; then
+		eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
+	elif use kernel_linux; then
+		if ! linux_config_exists; then
+			eerror "Unable to check your kernel for KVM support"
+		else
+			CONFIG_CHECK="~KVM ~TUN ~BRIDGE"
+			ERROR_KVM="You must enable KVM in your kernel to continue"
+			ERROR_KVM_AMD="If you have an AMD CPU, you must enable KVM_AMD in"
+			ERROR_KVM_AMD+=" your kernel configuration."
+			ERROR_KVM_INTEL="If you have an Intel CPU, you must enable"
+			ERROR_KVM_INTEL+=" KVM_INTEL in your kernel configuration."
+			ERROR_TUN="You will need the Universal TUN/TAP driver compiled"
+			ERROR_TUN+=" into your kernel or loaded as a module to use the"
+			ERROR_TUN+=" virtual network device if using -net tap."
+			ERROR_BRIDGE="You will also need support for 802.1d"
+			ERROR_BRIDGE+=" Ethernet Bridging for some network configurations."
+			use vhost-net && CONFIG_CHECK+=" ~VHOST_NET"
+			ERROR_VHOST_NET="You must enable VHOST_NET to have vhost-net"
+			ERROR_VHOST_NET+=" support"
+
+			if use amd64 || use x86 || use amd64-linux || use x86-linux; then
+				CONFIG_CHECK+=" ~KVM_AMD ~KVM_INTEL"
+			fi
+
+			use python && CONFIG_CHECK+=" ~DEBUG_FS"
+			ERROR_DEBUG_FS="debugFS support required for kvm_stat"
+
+			# Now do the actual checks setup above
+			check_extra_config
+		fi
+	fi
+
+	if grep -qs '/usr/bin/qemu-kvm' "${EROOT}"/etc/libvirt/qemu/*.xml; then
+		eerror "The kvm/qemu-kvm wrappers no longer exist, but your libvirt"
+		eerror "instances are still pointing to it.  Please update your"
+		eerror "configs in /etc/libvirt/qemu/ to use the -enable-kvm flag"
+		eerror "and the right system binary (e.g. qemu-system-x86_64)."
+		die "update your virt configs to not use qemu-kvm"
+	fi
+}
+
+pkg_setup() {
+	enewgroup kvm 78
+}
+
+# Sanity check to make sure target lists are kept up-to-date.
+check_targets() {
+	local var=$1 mak=$2
+	local detected sorted
+
+	pushd "${S}"/default-configs >/dev/null || die
+
+	detected=$(echo $(printf '%s\n' *-${mak}.mak | sed "s:-${mak}.mak::" | sort -u))
+	sorted=$(echo $(printf '%s\n' ${!var} | sort -u))
+	if [[ ${sorted} != "${detected}" ]] ; then
+		eerror "The ebuild needs to be kept in sync."
+		eerror "${var}: ${sorted}"
+		eerror "$(printf '%-*s' ${#var} configure): ${detected}"
+		die "sync ${var} to the list of targets"
+	fi
+
+	popd >/dev/null
+}
+
+src_prepare() {
+	check_targets IUSE_SOFTMMU_TARGETS softmmu
+	check_targets IUSE_USER_TARGETS linux-user
+
+	# Alter target makefiles to accept CFLAGS set via flag-o
+	sed -i -r \
+		-e 's/^(C|OP_C|HELPER_C)FLAGS=/\1FLAGS+=/' \
+		Makefile Makefile.target || die
+
+	# Cheap hack to disable gettext .mo generation.
+	use nls || rm -f po/*.po
+
+	epatch "${FILESDIR}"/qemu-1.7.0-cflags.patch
+	epatch "${FILESDIR}"/${PN}-2.4.0-block-mirror-crash.patch #558396
+	epatch "${FILESDIR}"/${PN}-2.4.0-CVE-2015-7295-{1,2,3}.patch #560760
+	epatch "${FILESDIR}"/${PN}-2.4.0-CVE-2015-6855.patch #560422
+	[[ -n ${BACKPORTS} ]] && \
+		EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+			epatch
+
+	# Fix ld and objcopy being called directly
+	tc-export AR LD OBJCOPY
+
+	# Verbose builds
+	MAKEOPTS+=" V=1"
+
+	epatch_user
+}
+
+##
+# configures qemu based on the build directory and the build type
+# we are using.
+#
+qemu_src_configure() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	local buildtype=$1
+	local builddir="${S}/${buildtype}-build"
+	local static_flag="static-${buildtype}"
+
+	mkdir "${builddir}"
+
+	local conf_opts=(
+		--prefix=/usr
+		--sysconfdir=/etc
+		--libdir=/usr/$(get_libdir)
+		--docdir=/usr/share/doc/${PF}/html
+		--disable-bsd-user
+		--disable-guest-agent
+		--disable-strip
+		--disable-werror
+		--python="${PYTHON}"
+		--cc="$(tc-getCC)"
+		--cxx="$(tc-getCXX)"
+		--host-cc="$(tc-getBUILD_CC)"
+		$(use_enable debug debug-info)
+		$(use_enable debug debug-tcg)
+		--enable-docs
+		$(use_enable tci tcg-interpreter)
+		$(use_enable xattr attr)
+	)
+
+	# Disable options not used by user targets as the default configure
+	# options will autoprobe and try to link in a bunch of unused junk.
+	conf_softmmu() {
+		if [[ ${buildtype} == "user" ]] ; then
+			echo "--disable-${2:-$1}"
+		else
+			use_enable "$@"
+		fi
+	}
+	conf_opts+=(
+		$(conf_softmmu accessibility brlapi)
+		$(conf_softmmu aio linux-aio)
+		$(conf_softmmu bluetooth bluez)
+		$(conf_softmmu caps cap-ng)
+		$(conf_softmmu curl)
+		$(conf_softmmu fdt)
+		$(conf_softmmu glusterfs)
+		$(conf_softmmu gtk)
+		$(conf_softmmu infiniband rdma)
+		$(conf_softmmu iscsi libiscsi)
+		$(conf_softmmu jpeg vnc-jpeg)
+		$(conf_softmmu kernel_linux kvm)
+		$(conf_softmmu lzo)
+		$(conf_softmmu ncurses curses)
+		$(conf_softmmu nfs libnfs)
+		$(conf_softmmu numa)
+		$(conf_softmmu opengl)
+		$(conf_softmmu png vnc-png)
+		$(conf_softmmu rbd)
+		$(conf_softmmu sasl vnc-sasl)
+		$(conf_softmmu sdl)
+		$(conf_softmmu seccomp)
+		$(conf_softmmu smartcard smartcard-nss)
+		$(conf_softmmu snappy)
+		$(conf_softmmu spice)
+		$(conf_softmmu ssh libssh2)
+		$(conf_softmmu tls vnc-tls)
+		$(conf_softmmu usb libusb)
+		$(conf_softmmu usbredir usb-redir)
+		$(conf_softmmu uuid)
+		$(conf_softmmu vde)
+		$(conf_softmmu vhost-net)
+		$(conf_softmmu virtfs)
+		$(conf_softmmu vnc)
+		$(conf_softmmu vte)
+		$(conf_softmmu xen)
+		$(conf_softmmu xen xen-pci-passthrough)
+		$(conf_softmmu xfs xfsctl)
+	)
+
+	case ${buildtype} in
+	user)
+		conf_opts+=(
+			--enable-linux-user
+			--disable-system
+			--disable-blobs
+			--disable-tools
+		)
+		;;
+	softmmu)
+		# audio options
+		local audio_opts="oss"
+		use alsa && audio_opts="alsa,${audio_opts}"
+		use sdl && audio_opts="sdl,${audio_opts}"
+		use pulseaudio && audio_opts="pa,${audio_opts}"
+
+		conf_opts+=(
+			--disable-linux-user
+			--enable-system
+			--with-system-pixman
+			--audio-drv-list="${audio_opts}"
+		)
+		use gtk && conf_opts+=( --with-gtkabi=$(usex gtk2 2.0 3.0) )
+		use sdl && conf_opts+=( --with-sdlabi=$(usex sdl2 2.0 1.2) )
+		;;
+	tools)
+		conf_opts+=(
+			--disable-linux-user
+			--disable-system
+			--disable-blobs
+		)
+		static_flag="static"
+		;;
+	esac
+
+	local targets="${buildtype}_targets"
+	[[ -n ${targets} ]] && conf_opts+=( --target-list="${!targets}" )
+
+	# Add support for SystemTAP
+	use systemtap && conf_opts+=( --enable-trace-backend=dtrace )
+
+	# We always want to attempt to build with PIE support as it results
+	# in a more secure binary. But it doesn't work with static or if
+	# the current GCC doesn't have PIE support.
+	if use ${static_flag}; then
+		conf_opts+=( --static --disable-pie )
+	else
+		gcc-specs-pie && conf_opts+=( --enable-pie )
+	fi
+
+	echo "../configure ${conf_opts[*]}"
+	cd "${builddir}"
+	../configure "${conf_opts[@]}" || die "configure failed"
+
+	# FreeBSD's kernel does not support QEMU assigning/grabbing
+	# host USB devices yet
+	use kernel_FreeBSD && \
+		sed -i -E -e "s|^(HOST_USB=)bsd|\1stub|" "${S}"/config-host.mak
+}
+
+src_configure() {
+	local target
+
+	python_setup
+
+	softmmu_targets= softmmu_bins=()
+	user_targets= user_bins=()
+
+	for target in ${IUSE_SOFTMMU_TARGETS} ; do
+		if use "qemu_softmmu_targets_${target}"; then
+			softmmu_targets+=",${target}-softmmu"
+			softmmu_bins+=( "qemu-system-${target}" )
+		fi
+	done
+
+	for target in ${IUSE_USER_TARGETS} ; do
+		if use "qemu_user_targets_${target}"; then
+			user_targets+=",${target}-linux-user"
+			user_bins+=( "qemu-${target}" )
+		fi
+	done
+
+	softmmu_targets=${softmmu_targets#,}
+	user_targets=${user_targets#,}
+
+	[[ -n ${softmmu_targets} ]] && qemu_src_configure "softmmu"
+	[[ -n ${user_targets}    ]] && qemu_src_configure "user"
+	[[ -z ${softmmu_targets}${user_targets} ]] && qemu_src_configure "tools"
+}
+
+src_compile() {
+	if [[ -n ${user_targets} ]]; then
+		cd "${S}/user-build"
+		default
+	fi
+
+	if [[ -n ${softmmu_targets} ]]; then
+		cd "${S}/softmmu-build"
+		default
+	fi
+
+	if [[ -z ${softmmu_targets}${user_targets} ]]; then
+		cd "${S}/tools-build"
+		default
+	fi
+}
+
+src_test() {
+	if [[ -n ${softmmu_targets} ]]; then
+		cd "${S}/softmmu-build"
+		pax-mark m */qemu-system-* #515550
+		emake -j1 check
+		emake -j1 check-report.html
+	fi
+}
+
+qemu_python_install() {
+	python_domodule "${S}/scripts/qmp/qmp.py"
+
+	python_doscript "${S}/scripts/kvm/kvm_stat"
+	python_doscript "${S}/scripts/kvm/vmxcap"
+	python_doscript "${S}/scripts/qmp/qmp-shell"
+	python_doscript "${S}/scripts/qmp/qemu-ga-client"
+}
+
+src_install() {
+	if [[ -n ${user_targets} ]]; then
+		cd "${S}/user-build"
+		emake DESTDIR="${ED}" install
+
+		# Install binfmt handler init script for user targets
+		newinitd "${FILESDIR}/qemu-binfmt.initd-r1" qemu-binfmt
+	fi
+
+	if [[ -n ${softmmu_targets} ]]; then
+		cd "${S}/softmmu-build"
+		emake DESTDIR="${ED}" install
+
+		# This might not exist if the test failed. #512010
+		[[ -e check-report.html ]] && dohtml check-report.html
+
+		if use kernel_linux; then
+			udev_dorules "${FILESDIR}"/65-kvm.rules
+		fi
+
+		if use python; then
+			python_foreach_impl qemu_python_install
+		fi
+	fi
+
+	if [[ -z ${softmmu_targets}${user_targets} ]]; then
+		cd "${S}/tools-build"
+		emake DESTDIR="${ED}" install
+	fi
+
+	# Disable mprotect on the qemu binaries as they use JITs to be fast #459348
+	pushd "${ED}"/usr/bin >/dev/null
+	pax-mark m "${softmmu_bins[@]}" "${user_bins[@]}"
+	popd >/dev/null
+
+	# Install config file example for qemu-bridge-helper
+	insinto "/etc/qemu"
+	doins "${FILESDIR}/bridge.conf"
+
+	# Remove the docdir placed qmp-commands.txt
+	mv "${ED}/usr/share/doc/${PF}/html/qmp-commands.txt" "${S}/docs/qmp/"
+
+	cd "${S}"
+	dodoc Changelog MAINTAINERS docs/specs/pci-ids.txt
+	newdoc pc-bios/README README.pc-bios
+	dodoc docs/qmp/*.txt
+
+	if [[ -n ${softmmu_targets} ]]; then
+		# Remove SeaBIOS since we're using the SeaBIOS packaged one
+		rm "${ED}/usr/share/qemu/bios.bin"
+		if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+			dosym ../seabios/bios.bin /usr/share/qemu/bios.bin
+		fi
+
+		# Remove vgabios since we're using the vgabios packaged one
+		rm "${ED}/usr/share/qemu/vgabios.bin"
+		rm "${ED}/usr/share/qemu/vgabios-cirrus.bin"
+		rm "${ED}/usr/share/qemu/vgabios-qxl.bin"
+		rm "${ED}/usr/share/qemu/vgabios-stdvga.bin"
+		rm "${ED}/usr/share/qemu/vgabios-vmware.bin"
+		if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+			dosym ../vgabios/vgabios.bin /usr/share/qemu/vgabios.bin
+			dosym ../vgabios/vgabios-cirrus.bin /usr/share/qemu/vgabios-cirrus.bin
+			dosym ../vgabios/vgabios-qxl.bin /usr/share/qemu/vgabios-qxl.bin
+			dosym ../vgabios/vgabios-stdvga.bin /usr/share/qemu/vgabios-stdvga.bin
+			dosym ../vgabios/vgabios-vmware.bin /usr/share/qemu/vgabios-vmware.bin
+		fi
+
+		# Remove sgabios since we're using the sgabios packaged one
+		rm "${ED}/usr/share/qemu/sgabios.bin"
+		if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+			dosym ../sgabios/sgabios.bin /usr/share/qemu/sgabios.bin
+		fi
+
+		# Remove iPXE since we're using the iPXE packaged one
+		rm "${ED}"/usr/share/qemu/pxe-*.rom
+		if use qemu_softmmu_targets_x86_64 || use qemu_softmmu_targets_i386; then
+			dosym ../ipxe/8086100e.rom /usr/share/qemu/pxe-e1000.rom
+			dosym ../ipxe/80861209.rom /usr/share/qemu/pxe-eepro100.rom
+			dosym ../ipxe/10500940.rom /usr/share/qemu/pxe-ne2k_pci.rom
+			dosym ../ipxe/10222000.rom /usr/share/qemu/pxe-pcnet.rom
+			dosym ../ipxe/10ec8139.rom /usr/share/qemu/pxe-rtl8139.rom
+			dosym ../ipxe/1af41000.rom /usr/share/qemu/pxe-virtio.rom
+		fi
+	fi
+
+	qemu_support_kvm && readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	if qemu_support_kvm; then
+		readme.gentoo_print_elog
+	fi
+
+	if [[ -n ${softmmu_targets} ]] && use kernel_linux; then
+		udev_reload
+	fi
+
+	fcaps cap_net_admin /usr/libexec/qemu-bridge-helper
+	if use virtfs && [ -n "${softmmu_targets}" ]; then
+		local virtfs_caps="cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_setgid,cap_mknod,cap_setuid"
+		fcaps ${virtfs_caps} /usr/bin/virtfs-proxy-helper
+	fi
+}
+
+pkg_info() {
+	echo "Using:"
+	echo "  $(best_version app-emulation/spice-protocol)"
+	echo "  $(best_version sys-firmware/ipxe)"
+	echo "  $(best_version sys-firmware/seabios)"
+	if has_version 'sys-firmware/seabios[binary]'; then
+		echo "    USE=binary"
+	else
+		echo "    USE=''"
+	fi
+	echo "  $(best_version sys-firmware/vgabios)"
+}
diff --git a/app-emulation/virtualbox-additions/Manifest b/app-emulation/virtualbox-additions/Manifest
index e7fac29..c002fb8 100644
--- a/app-emulation/virtualbox-additions/Manifest
+++ b/app-emulation/virtualbox-additions/Manifest
@@ -1,4 +1,4 @@
 DIST VBoxGuestAdditions_4.3.28.iso 58241024 SHA256 9f52e186d6c9407b2676d4b2ed1cdf96940ec129cc2bd92e54b24526271a9733 SHA512 78055f389dc1a7bd62577f1fa670b8f8899ab3a58a87953d30fcaea1cd0c77f8662e15fea932c434309747971a2a61b61854b6f087654d9d2fb2de07fb6f1b5c WHIRLPOOL 64275e44c01f4f260899a7c16aaeb494ebe81277e7cbdec87e487736833cc239338f3c32c00759244b3be55c5754788593b81d06dab7d9ab26991369fa9d65fd
 DIST VBoxGuestAdditions_4.3.30.iso 58257408 SHA256 432c2da1d9a939de7ba1d2cfb10595031374af9ce66417a43979d1794beedbb1 SHA512 a782e47381b708aee8a8f2c1d6608d51d09a2fb0d55ea3b543530a31cbf489043f05d4c334a9e269b922318339cb78a897603b8bce2749fe02088a6e9a4fd177 WHIRLPOOL c70b9e630820f7be38e38fd7ce20073c3766758950f60367a3a6e666644f10baadbfb5a9dc67c7c8364770e7ae28d27d632c53699fd6d1102bf672672419f1f2
-DIST VBoxGuestAdditions_5.0.2.iso 58716160 SHA256 974063ca9c7bde796dd77ba55d35583dc5d8bc27d53a6bfd81ae206978b133e2 SHA512 598709d64d78687e6905f3a17bd1442aae588a3024fbb6732a3fcbc43e9299e23a5d377bb4f810f4747b62db5c7cf6bd9f21270d5e76fd365743f845256ae736 WHIRLPOOL 86d3f40b67e6bbd6e1ff503e44558fc213f8c42d8496fcbd148ff82f418012ea58854470090ddaa9754a35e53b2dd335d4a116bd8502c1e00f4b4b1b729b3998
 DIST VBoxGuestAdditions_5.0.4.iso 58793984 SHA256 de4abc28832d4e96b826efef3e7e69e69d6b941babfdc6317185f1fd6e22ffcf SHA512 c35561b5e332a7cf815c672111fe937ebe9ed5297853b3577fb347437e3b11a9ef3f19eb00318f277560644f49c858e1e12657b5d4c3a02cd91c8d2339e08545 WHIRLPOOL f3520bbcb939d1503c00954a59e0c31b502303450cc0c6f8c067e67501bf4015938d0fccd453e29650dc9b587ab9c4b3a190321d42803fac73d3435da91d38f2
+DIST VBoxGuestAdditions_5.0.6.iso 58966016 SHA256 59ed9911c2bb22357345448c3df6104938b45fa780311d20c330e39c6e309991 SHA512 8d9252b4961da760e71a94acd0292f23373b6ef2f9cfee48053efffbc9ec8f396a71f87e48eedf36f73c884774f1898567e2eeb454f4d343f85973d3b548b85f WHIRLPOOL 73164707e2e5aed992080ea80479d885383be47918e11ba387fb8f9ba7d1db585e3fcaf14ec904cc02af7b05cc00cf0a540ef9ae14adeb877a4f5f7d196e8aa8
diff --git a/app-emulation/virtualbox-additions/virtualbox-additions-5.0.2.ebuild b/app-emulation/virtualbox-additions/virtualbox-additions-5.0.6.ebuild
similarity index 100%
rename from app-emulation/virtualbox-additions/virtualbox-additions-5.0.2.ebuild
rename to app-emulation/virtualbox-additions/virtualbox-additions-5.0.6.ebuild
diff --git a/app-emulation/virtualbox-bin/Manifest b/app-emulation/virtualbox-bin/Manifest
index 733523c..dd3a7c9 100644
--- a/app-emulation/virtualbox-bin/Manifest
+++ b/app-emulation/virtualbox-bin/Manifest
@@ -1,16 +1,16 @@
 DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.28-100309.tar.gz 15961939 SHA256 72e101d9dc5eabeb76d1ab5bd6d2f817a11c89adfe8bb72cc5d614a2eef532d1 SHA512 57ad44a99a7abcad195e6ceccc1fe7b494979da65601a52e0be8336bb819812d5cef48a8bc0fe9f74f3a05238e6fd29562ac678d4ef7e0c78587fe81c287a65e WHIRLPOOL fb08189c53841664119bffb4de6a76d6f72fb035f887ed5e948f38faa5be2891e35de0806da02d299e818370285bcddba06eb84bea7db4d3cfa09d92f8042db7
 DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.30-101610.tar.gz 15983777 SHA256 770d49247976f2a0d14a66196dddf864c6b9d185671e2a29cab459fc28f105db SHA512 f5d8275fe3e1ea60e8d15af3b0c7382faab172df39369c8904ff734a5105daed87a48215880b2e286c6735ead341c237d2260e6ee923f513818f85cf0b452def WHIRLPOOL 3b1e29a44413ebc65dc250b2366b1fe75d6ea48fd94b722c8ec9eb7e97e6981470e9201c9840d566953c9c9bdd4a7893f9d525b3fac7150ca24391f696bba9c4
-DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.2-102096.tar.gz 16868753 SHA256 0c49864ea7ab2be8b95c4495e5825b0e48b8611e1761c1b22b86a3f4bf9201bf SHA512 d072e3460366cf6ae40e4b4e9944463db43b6a0a3ed3c872495c6454fb177181ab376917b59550edb000737dc49347025977754b2e20bbe43cdb5b389dff7165 WHIRLPOOL ead3d7f55245a18f418f58d31005912bef3b4b9a4bed6ef9f4ef42e04d98514be50f2bf18e5f161236dbbdbd2833873cca2ed552214520749595adec57f74c0c
 DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.4-102546.tar.gz 16874455 SHA256 e4618e7847eff7c31426f4639bcd83c37bd817147081d3218f21c8e7b6bc7cfa SHA512 1b645422966a2e90b2d2af9187e756d90cb5307db70718cb6e6679426da2d43ec5e398e6ab082195b7a4ad302bb626ad2101c3237759481177db2104bf8b6a23 WHIRLPOOL 6cdb3a63ea0a8d2ce3952d3613fcea3af1e104b1e09d8167bf2c78cb52e3a1c49db669cbeebdc54c9140c36b77c20970b666aa0f6f3d9af43b2b543251288f46
+DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.6-103037.tar.gz 16874845 SHA256 4eed4f3d253bffe4ce61ee9431d79cbe1f897b3583efc2ff3746f453450787b5 SHA512 fb3fb06e88cc5bded6246375727df2deebb6c0dbb889b8516e0bab0af0c05ef3e1baa8c1eb94d34af2e63600bc36814eab8d8f25abb0fd1ad982ea242f456468 WHIRLPOOL 51ddd27d61e214cb41c5d8c50b0d5d01f885f4ae9facabd3cece500fd41b2a72d42b6ad766aa52e9c315c6fca2dca0f07a1a6b1fa0dc2b87f2cd3c4bf1e54aaa
 DIST VirtualBox-4.3.28-100309-Linux_amd64.run 85677523 SHA256 8c862533f876dc32fbfae993597b1123e2feac81a302c60e73b7ee891e17a77f SHA512 75dc2cd257b187b0a497b87c2f1e576a57ceece290327a98804c903810522444b0a64a704bc51a25945dbaa5c0caf30898ba258829577e2f17f7c736fcf59bb0 WHIRLPOOL c8d5d885807ad633bf1c4c6f98cac8dddf4002dc2e21ed2d2fb2f0a859f447b7ce06d1c49c4daff4147b25ca4992da14b6b75b39f47075c861732e6ef00091d1
 DIST VirtualBox-4.3.28-100309-Linux_x86.run 85083598 SHA256 aeb224d7136314865db8175db665408a3dc08f50ed68fbd4bf1568b32b7ea2f6 SHA512 110e20a45657c7677fcab0158d31052c909893b8f618adad2a2c95ad119d47d7c35d4aedf3692dd650fda62ba0747acf202364c14034e5c10d17cd45a9918707 WHIRLPOOL 35c97248985d11c77194ac03448357331e08b7ef64a77ba416564b6051eaf74ffb5a0acdf835bfcf71657c5fdd58066947b0ba1c42e91d34dbf026434f662f67
 DIST VirtualBox-4.3.30-101610-Linux_amd64.run 81069522 SHA256 5745bc9b1edd1d7d28f81ba7fed7fff3ed0bbe7084c39a77bd305018ad0a420d SHA512 928dc5b6b9031892f9391ded3aa10b090a9312c16e5b8bd4d0457d3af3d5f5495323e48a5cc781411c14318aab5d3856de5369bbf1ac3b75068797ef4c5445a7 WHIRLPOOL bf5175a228ddef4319f6972dadefa035dc0902b290691ba14478f10fe89947fbc3f9545b65d4c09f397c06309fb01a7fab6187b5f9f9d2cb39b9f808b0bb5bb5
 DIST VirtualBox-4.3.30-101610-Linux_x86.run 80537038 SHA256 c8e42d247ecfa1ff3e3da6c7988a58e2d64fbb54598e9b08211308226d61c42a SHA512 629907432887606b1e31328a751c5ec3c764e90b3eae4a984c5d9e6b5f77b626e8eafa235bb55a0e1725fe95324dcb3cc1c8e2f441d716a8408d1e1ddf0e5dde WHIRLPOOL c10976693284b7b1c178aa036eb5d28ce76366362ac00eb0f686e8f99ddb93df508654d8acab0912714d3f9215d8f217a91999c25877fb2b973171b9be8b7d09
-DIST VirtualBox-5.0.2-102096-Linux_amd64.run 84540870 SHA256 2d976eb4929ee8fe4b3ec9a1d5f7a070ffb3053d8a3e15d223a4689a7dd93adb SHA512 ab03a2f456376fbcb6dc501a1be4a2f949f5cc56f883749104be3bf004ce8c8f3920c8bdd573c4093a5cc84a8dfaf0793cc55276e8d88ec135751ac3f4051651 WHIRLPOOL cc98cd331d60de2ff57867630c01330fe85c474b96b1898e1f5c5d1485d88444a46ab9df17a6c5a61a3f174d59b4061ae80654de7c3ed0061c731ef5558a4b1a
-DIST VirtualBox-5.0.2-102096-Linux_x86.run 83639745 SHA256 cc71706026fd9d3d57527e7bf7861da0fb5317ed28952d65c81d16baca24f2e9 SHA512 01cbcf6aa8a1caa3e4a2f2fe65680827f28adb6a229bbf924673850901ec9c7331996c4f158e66fe427dc318f2bbfe12041a436ec861c56561378781d985212f WHIRLPOOL 57b77de0a100e3b75ae0f5a37edffe7f1e73a63bef1fb27f85f284ef54fa35f7ee5a77bef114f75ef3dfa07fbbaed111eaa1fc56f7dceeb90f5494aad36b0f89
 DIST VirtualBox-5.0.4-102546-Linux_amd64.run 84254161 SHA256 d9c4a166aa350ca26a9063163b18b8e37eee9b7a4cb592f55c5e4aaf406daa3b SHA512 3ad21812a96f94e613985ae2fbe75ac9bb982d46d7b01bf0da7d2e7512f120666720d1145d4725d36d7bb7d611abb1d4cbe045d025742a4de928f21d308eaa98 WHIRLPOOL 71279d6133d1ea2c63349d01dea12a225d1eb89205d657708e8f9e34fb6affeadd223203d6e551c03766e619b3b83b022009f16dc5eb4bd5016ad7eec56252c5
 DIST VirtualBox-5.0.4-102546-Linux_x86.run 83373516 SHA256 cbb5f4e464645fd98c21b15013a97ab2f333496f374ddba03e9df469f7382fe4 SHA512 65ac5ea3fe2a1dbb957bcd02cd5e23130659e1eae599218d85cf8b5d2eea3afa08dd6b69d4a58e399f92f149503a3dcadb9b7e2b10fa1c70c3921baed5370fe8 WHIRLPOOL 14f8d8fd8f8c113ce930254bd2c677a8cdbf8eab3afad8a12902083d01c554336a804e8ba8c47905d4a0be3c9acd2cfe4307343f8d3a8c814611028c12b6cb2f
+DIST VirtualBox-5.0.6-103037-Linux_amd64.run 84407761 SHA256 938b7b247e3260cc148f17a34f47c3363d377fd9e47add1635570908bedaf4a4 SHA512 87b4e1eb5896a87fc5004c09281d7f963dc3f07cf7405be48082a6f24225f3052577ec9c21f157cafe6f0188371142643723714d7f586a814f9e549cace480b1 WHIRLPOOL ec066521a2f73e02578e0528fabbab691bd1d196cf7bd764cdf3fa6f4f0429683320a45a1e7fc23f9f6a6ddfb8024367945f2ae75d2c7c20e609788b8e5a5a2b
+DIST VirtualBox-5.0.6-103037-Linux_x86.run 83527117 SHA256 557992579e2abca01e6a3b22d779174192fa3f7b037230fd1d47bfd70d52cbc5 SHA512 8611733e6ddd5903b29221172f530887c659f96b1a317c0dcff40a2184f299c26b53e77fd61e5bb0e6475082453c7d30191f6e195942ed31f43fa6b72353edee WHIRLPOOL 4bba29189ccaecfc88347a1015abb3dd888222d65b2a6e45a453871af7c7d5fe86702e1cd7ec655793d79139828cfb35ee4424a16a940f41215708f6ed0907ed
 DIST VirtualBoxSDK-4.3.28-100309.zip 11698378 SHA256 fe0cc316cecb3dfe9bbb925e6c023620d4cfd8e137b2a9b9f40f22f527af16fa SHA512 6af7d2107cff080281a356cbf522961b2e9d1917e861e410b169ce5ca3cefe05cc87e4e01f78ae171f8716f7006c031f14fc01d8d282a872a4f619638049b11a WHIRLPOOL 23a77dbc410a28b2799264da88d79b2c4335c07da67dd8bf4be26cac271e3ed38a9bf4fb2966ec0a3c06fb869bb252f5fa6a34a9a9c62cbb9a2fb0ad76442f66
 DIST VirtualBoxSDK-4.3.30-101610.zip 11436700 SHA256 6d8f1a006d56dfa1bbec10a35369c80c75845fdc6127c4d806b5c69cec03ab7e SHA512 2b2b3220d9ce908813699f8fc4cee80de5b29cb134ec968c2ccbb78c40b8d0d8aeb666996627f0f13cd036ef0376582c48f6c12b45acb7593d8b0eefd6eba960 WHIRLPOOL fe82cacecfedc05b6d92feac5285bc41100a9538f6cb37027c85ee08e051580243e2635af9d873c67970ecab5e8ee8eee0cee89e50be59895b44862264aa3fdf
-DIST VirtualBoxSDK-5.0.2-102096.zip 9636596 SHA256 6df7b53e877d8899ec98fa5e60eeca293a8e03f343e03b82936fdee35b3c0ae1 SHA512 fb3037ea0c767bb87bf9f945916f164a2b8901b4b9e24ff72eaf0f10f7fcb29d32f719d581ec0fbcd897cf2decaaf31789d64ff63a209182b5cbd71c4752b685 WHIRLPOOL 2726216d786ed3b0fe874b1d403fd691ebb60916b83579817a4dd9a1c2e47b6f0379ac1a9bd8d9ba2492b0ffe9ec4113210be8856d27ee4b7e0d027ceb8f81f3
 DIST VirtualBoxSDK-5.0.4-102546.zip 9634312 SHA256 f09c428a56a10b204bba8f1cb27c3c8bd6539efd9f88e375a5894fae747d9c81 SHA512 bb06c6cb10786029b542e855bcf87f91083b3de080a367ac2a16c5c1416b10352f7bc76b416349038545499db7c17c7904747420b221d0a21ae6615c79b2cbb9 WHIRLPOOL 9afe856f0d954ea7f1faeca4748de264084897e1e85f18eedfbd585a43d115a04b22c8e8d5e998322f1936c169c83a9761f908adb839ebd070da56a390ca0327
+DIST VirtualBoxSDK-5.0.6-103037.zip 9634988 SHA256 e4df6402b1ddb067f54923d211bd32bc2d6117b91295707be707bb2c8e7e408e SHA512 aee6e59a22c2ec7c99fe22054d7bdd0a5f2ed627c76b530c17fcdbd430343b20ebbbda11bce3c905ff4641d050b75f989f84ed49507ad4dca4c47364b8eda0f7 WHIRLPOOL c4e5f8aac4c0d885f78dfea562375a16157553148480bf441378f15569287fbd28f5a44b2d18ad6e393a1ede9cb907ad750c003ba61346d88279484ad944688a
diff --git a/app-emulation/virtualbox-bin/virtualbox-bin-5.0.2.102096.ebuild b/app-emulation/virtualbox-bin/virtualbox-bin-5.0.6.103037.ebuild
similarity index 100%
rename from app-emulation/virtualbox-bin/virtualbox-bin-5.0.2.102096.ebuild
rename to app-emulation/virtualbox-bin/virtualbox-bin-5.0.6.103037.ebuild
diff --git a/app-emulation/virtualbox-extpack-oracle/Manifest b/app-emulation/virtualbox-extpack-oracle/Manifest
index 5f0bb4a..59c54e2 100644
--- a/app-emulation/virtualbox-extpack-oracle/Manifest
+++ b/app-emulation/virtualbox-extpack-oracle/Manifest
@@ -1,4 +1,4 @@
 DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.28-100309.tar.gz 15961939 SHA256 72e101d9dc5eabeb76d1ab5bd6d2f817a11c89adfe8bb72cc5d614a2eef532d1 SHA512 57ad44a99a7abcad195e6ceccc1fe7b494979da65601a52e0be8336bb819812d5cef48a8bc0fe9f74f3a05238e6fd29562ac678d4ef7e0c78587fe81c287a65e WHIRLPOOL fb08189c53841664119bffb4de6a76d6f72fb035f887ed5e948f38faa5be2891e35de0806da02d299e818370285bcddba06eb84bea7db4d3cfa09d92f8042db7
 DIST Oracle_VM_VirtualBox_Extension_Pack-4.3.30-101610.tar.gz 15983777 SHA256 770d49247976f2a0d14a66196dddf864c6b9d185671e2a29cab459fc28f105db SHA512 f5d8275fe3e1ea60e8d15af3b0c7382faab172df39369c8904ff734a5105daed87a48215880b2e286c6735ead341c237d2260e6ee923f513818f85cf0b452def WHIRLPOOL 3b1e29a44413ebc65dc250b2366b1fe75d6ea48fd94b722c8ec9eb7e97e6981470e9201c9840d566953c9c9bdd4a7893f9d525b3fac7150ca24391f696bba9c4
-DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.2-102096.tar.gz 16868753 SHA256 0c49864ea7ab2be8b95c4495e5825b0e48b8611e1761c1b22b86a3f4bf9201bf SHA512 d072e3460366cf6ae40e4b4e9944463db43b6a0a3ed3c872495c6454fb177181ab376917b59550edb000737dc49347025977754b2e20bbe43cdb5b389dff7165 WHIRLPOOL ead3d7f55245a18f418f58d31005912bef3b4b9a4bed6ef9f4ef42e04d98514be50f2bf18e5f161236dbbdbd2833873cca2ed552214520749595adec57f74c0c
 DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.4-102546.tar.gz 16874455 SHA256 e4618e7847eff7c31426f4639bcd83c37bd817147081d3218f21c8e7b6bc7cfa SHA512 1b645422966a2e90b2d2af9187e756d90cb5307db70718cb6e6679426da2d43ec5e398e6ab082195b7a4ad302bb626ad2101c3237759481177db2104bf8b6a23 WHIRLPOOL 6cdb3a63ea0a8d2ce3952d3613fcea3af1e104b1e09d8167bf2c78cb52e3a1c49db669cbeebdc54c9140c36b77c20970b666aa0f6f3d9af43b2b543251288f46
+DIST Oracle_VM_VirtualBox_Extension_Pack-5.0.6-103037.tar.gz 16874845 SHA256 4eed4f3d253bffe4ce61ee9431d79cbe1f897b3583efc2ff3746f453450787b5 SHA512 fb3fb06e88cc5bded6246375727df2deebb6c0dbb889b8516e0bab0af0c05ef3e1baa8c1eb94d34af2e63600bc36814eab8d8f25abb0fd1ad982ea242f456468 WHIRLPOOL 51ddd27d61e214cb41c5d8c50b0d5d01f885f4ae9facabd3cece500fd41b2a72d42b6ad766aa52e9c315c6fca2dca0f07a1a6b1fa0dc2b87f2cd3c4bf1e54aaa
diff --git a/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.2.102096.ebuild b/app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.6.103037.ebuild
similarity index 100%
rename from app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.2.102096.ebuild
rename to app-emulation/virtualbox-extpack-oracle/virtualbox-extpack-oracle-5.0.6.103037.ebuild
diff --git a/app-emulation/virtualbox-guest-additions/Manifest b/app-emulation/virtualbox-guest-additions/Manifest
index a5b92fd..8d76d9a 100644
--- a/app-emulation/virtualbox-guest-additions/Manifest
+++ b/app-emulation/virtualbox-guest-additions/Manifest
@@ -1,4 +1,4 @@
 DIST VirtualBox-4.3.28.tar.bz2 100092002 SHA256 e157ab76d1958ae2c56b2a3875194fbff3de82486ad0e30032fd5bd772297c31 SHA512 b6e849a1420515b6dbda8cee0ab64940dd93296ec58cde76676ac257ff3dad0459aa1fd0bda7e1d0abc751d2d59f055465b198a546fdbb4e70e934a78654a8fc WHIRLPOOL 1b739f1f989032e07829a23ffadadd49e31109d70b0effbc44126a48a165218ff3ebafa576fa0e4f2af76a404033b60e5c9804ac43db5dd3024f1eca25ca70da
 DIST VirtualBox-4.3.30.tar.bz2 97428942 SHA256 ea9569ec16cd6202ee61bcadb2506d31ac12fd343adb91565773a05eaaea9a36 SHA512 d0817335cf4bd196da93b91ede6bc9e48ca0d471166ab2790dbf508a4574e4ace54a86053932abf3b4e804c583e80a713d2ab2e556dc15bee6ef3a62f88b95fc WHIRLPOOL 47cbd702e83cc737e04b5862cc6c52e32be244dc1dc0145f582f57b2f19bb898f0f4b200576a28f10a3290691f1ffd43c256e8c8eb5545a9723be8eefca88a38
-DIST VirtualBox-5.0.2.tar.bz2 109872963 SHA256 f290c220d62af2a7fdabb1934c1a0b924b68968a236bb2509bcb507d2c19485e SHA512 fc89cfe475aa02182b04e19a62d52d02b4ff5d2afb082ed3cf11b36288b19f7be15b0e76ae2fd8b9b2c3d5456b316453f112c3b711d242915688adf24623e0c1 WHIRLPOOL 23de881fa6233ce97a1ceeca900657019466df08dc0890355b9d415cd8f4fe8d6877f06218b2455a75be69cfa13d3b2a35855fb641832b300788273af1d26b32
 DIST VirtualBox-5.0.4.tar.bz2 109865904 SHA256 b19e23fc8e71f38aef7c059f44e59fcbff3bb2ce85baa8de81f1629b85f68fcf SHA512 4349792390f0a236faef0bdb06806dde604373dcccf83351f805508a2fdcae9f729a5e793ac53c4d134c50e48c0624b340328a7bb21ddcf15ed69a08365eb2b5 WHIRLPOOL cacf3193231a8500a3b475ede2d0f0458a656d87d3d97b78ccb743c1606f7f6ec58f6d56cb1bc0a40e9eb279d4cbeeab3318d1e71be3dead07fe4ccff6bdfbcf
+DIST VirtualBox-5.0.6.tar.bz2 109863328 SHA256 22d63f28c43165a31dcccdec1c65f376f46d7e09555c47611cfaafb5576a5843 SHA512 3e51c9476c29a3ba79adda2d3b0c0b516459f58c8aa5e7b795be1aa2468b8e61241bbe5615787d7302a5f95230a446377bd8698f801c2114b26a471ae8bbbc11 WHIRLPOOL 11603c9aa14acac87032b5d8fc1f8d0a567632ca591230e0cc5c1d9a1ae9b39ebccb1a3bb85e1845abc01b04da550a2ef889e1bf91da0bb82df1fafa384f88b4
diff --git a/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.2.ebuild b/app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.6.ebuild
similarity index 100%
rename from app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.2.ebuild
rename to app-emulation/virtualbox-guest-additions/virtualbox-guest-additions-5.0.6.ebuild
diff --git a/app-emulation/virtualbox-modules/Manifest b/app-emulation/virtualbox-modules/Manifest
index 2906cd4..a7e25b6 100644
--- a/app-emulation/virtualbox-modules/Manifest
+++ b/app-emulation/virtualbox-modules/Manifest
@@ -1,4 +1,4 @@
 DIST vbox-kernel-module-src-4.3.28.tar.xz 539876 SHA256 fb052997ec4992b0ee102475051b5d7bd8485e17405c6b3dcc94e1fa4a53b761 SHA512 637149f8595cb023e75116f83237bb4cef1b05627f58d475fa952ac86a85aa3cbab5f0cec723d730979f831999c920f35248e5f8db8f6987fb4c15c4a29bd517 WHIRLPOOL ab1ed07ee148a1ef352c0fda3f09865405be4146b987a5dffcb753d7512a00aa88c2ba1f7184b56d694c88320b350c6ececd3bec5636dd1586fc14a6be8a874d
 DIST vbox-kernel-module-src-4.3.30.tar.xz 540712 SHA256 28d89c06a4db190ec690980d68552745fb87ee2e23a3fe53edb29edda889f9d8 SHA512 8536d4bd105edf0fc112488232f7c85d8606b28b6cbeb28ee56bc135f693d1059328e75023299a67033bc1d486aea6a81c0fb23d51af500968119aa2f05156dc WHIRLPOOL 17452456aa127ca4ba53b2883f43970980f26094b80feaaa49b4773c386834d59f67afe21649539edc6dabde8725fd49c968002df9f2eb0e1ea8e888a2f8089b
-DIST vbox-kernel-module-src-5.0.2.tar.xz 592648 SHA256 0060ed14de81f86f1acae11e124a81573b19a1abeebf92f1a15ea7aa8a987bdd SHA512 965059d533536f77eacb69bf19e3b348c02a9125dc18fc06cf0e05226f75ab0c34cf634f0754ee309905b31e53adbaf23830c9ecfc689ca2735e7de0a33c29e7 WHIRLPOOL 79c4e6a1dc7073f09a5e711fa05277acf6c407e4f2813ca9523110cdc01c9f229fda3f96c6e07bdbbc45d375079c145b1aee6a53ada7b9d9469561cfac21ca55
 DIST vbox-kernel-module-src-5.0.4.tar.xz 592716 SHA256 dad5657c9b1280050d2469a94e3e3d5b5cc8279f9a175abf068f3940ea700889 SHA512 0a71a3e857b8bd8b90a06db6950c6c40950f0f87b14d5e79c14dd82a674de1f171556d849006e49932f06bc794dfe2066e37d31fef352e9128dfaeab11caaadd WHIRLPOOL 78a0f704cce92ed3546710d8cbca263f1bb9784f99291fa29d58e177e1c65800e4a80cba4e59fd2577f00895829a04c8605ff0b849a23f35f797a1565a0ec6d0
+DIST vbox-kernel-module-src-5.0.6.tar.xz 593640 SHA256 57b6ea7e772dbe032d8a024e48ad572c76dc4165ce2fb99cd45317c97466912f SHA512 88f1c61a6e749ba7076a3727baadf8ff7e0c3a70c279c6261757c7b8f0b3debd70a8cca21aea9e8b3a67feb0044c4e29439a075ccca3aaec0c0220f5a9264ac9 WHIRLPOOL c01fc142d650ef402601f457d83aeb3911200f3b7d5fbc4004c1da80832a911be01903f65ea92de592ff7e1f10688f77106a100d5fec8887767c8e8a7eb92a0d
diff --git a/app-emulation/virtualbox-modules/virtualbox-modules-5.0.2.ebuild b/app-emulation/virtualbox-modules/virtualbox-modules-5.0.6.ebuild
similarity index 100%
rename from app-emulation/virtualbox-modules/virtualbox-modules-5.0.2.ebuild
rename to app-emulation/virtualbox-modules/virtualbox-modules-5.0.6.ebuild
diff --git a/app-emulation/virtualbox/Manifest b/app-emulation/virtualbox/Manifest
index dbecf07..b81288b 100644
--- a/app-emulation/virtualbox/Manifest
+++ b/app-emulation/virtualbox/Manifest
@@ -1,6 +1,6 @@
 DIST VirtualBox-4.3.28.tar.bz2 100092002 SHA256 e157ab76d1958ae2c56b2a3875194fbff3de82486ad0e30032fd5bd772297c31 SHA512 b6e849a1420515b6dbda8cee0ab64940dd93296ec58cde76676ac257ff3dad0459aa1fd0bda7e1d0abc751d2d59f055465b198a546fdbb4e70e934a78654a8fc WHIRLPOOL 1b739f1f989032e07829a23ffadadd49e31109d70b0effbc44126a48a165218ff3ebafa576fa0e4f2af76a404033b60e5c9804ac43db5dd3024f1eca25ca70da
 DIST VirtualBox-4.3.30.tar.bz2 97428942 SHA256 ea9569ec16cd6202ee61bcadb2506d31ac12fd343adb91565773a05eaaea9a36 SHA512 d0817335cf4bd196da93b91ede6bc9e48ca0d471166ab2790dbf508a4574e4ace54a86053932abf3b4e804c583e80a713d2ab2e556dc15bee6ef3a62f88b95fc WHIRLPOOL 47cbd702e83cc737e04b5862cc6c52e32be244dc1dc0145f582f57b2f19bb898f0f4b200576a28f10a3290691f1ffd43c256e8c8eb5545a9723be8eefca88a38
-DIST VirtualBox-5.0.2.tar.bz2 109872963 SHA256 f290c220d62af2a7fdabb1934c1a0b924b68968a236bb2509bcb507d2c19485e SHA512 fc89cfe475aa02182b04e19a62d52d02b4ff5d2afb082ed3cf11b36288b19f7be15b0e76ae2fd8b9b2c3d5456b316453f112c3b711d242915688adf24623e0c1 WHIRLPOOL 23de881fa6233ce97a1ceeca900657019466df08dc0890355b9d415cd8f4fe8d6877f06218b2455a75be69cfa13d3b2a35855fb641832b300788273af1d26b32
 DIST VirtualBox-5.0.4.tar.bz2 109865904 SHA256 b19e23fc8e71f38aef7c059f44e59fcbff3bb2ce85baa8de81f1629b85f68fcf SHA512 4349792390f0a236faef0bdb06806dde604373dcccf83351f805508a2fdcae9f729a5e793ac53c4d134c50e48c0624b340328a7bb21ddcf15ed69a08365eb2b5 WHIRLPOOL cacf3193231a8500a3b475ede2d0f0458a656d87d3d97b78ccb743c1606f7f6ec58f6d56cb1bc0a40e9eb279d4cbeeab3318d1e71be3dead07fe4ccff6bdfbcf
+DIST VirtualBox-5.0.6.tar.bz2 109863328 SHA256 22d63f28c43165a31dcccdec1c65f376f46d7e09555c47611cfaafb5576a5843 SHA512 3e51c9476c29a3ba79adda2d3b0c0b516459f58c8aa5e7b795be1aa2468b8e61241bbe5615787d7302a5f95230a446377bd8698f801c2114b26a471ae8bbbc11 WHIRLPOOL 11603c9aa14acac87032b5d8fc1f8d0a567632ca591230e0cc5c1d9a1ae9b39ebccb1a3bb85e1845abc01b04da550a2ef889e1bf91da0bb82df1fafa384f88b4
 DIST virtualbox-4.3.16-patches-01.tar.xz 4288 SHA256 270c4f01b2c13c4133987b3acc073dfbf78840212cf09f083dbf8fc80407ce6f SHA512 595f88c4b388b4807347c15c1750ec73aceba1c82ad993e9a05c7b78dfece7b679aff0338b3a48e2ccee7911fb5ed0dba803052332a270230078551f747052bc WHIRLPOOL 2157ee3fb9beed906cff28647c869e37d62551ad8c93801c0f0ec6893675f11786aa6d92acf11c348d30aa58b6e03a3faa879c664dddac6e5b8525035986c9ca
 DIST virtualbox-5.0.2-patches-01.tar.xz 4556 SHA256 8fcfa7972b0942f3e65bda73a35a6feb234aad770016fb4caafba105757d7ada SHA512 14ce8f0b17e593b2de676e0beaab688f29606aaea330151038fbb9259d3f5e4c22f254d1fa6cc45f968d81cf9f7d71deb9a7a32f565d07c1d9fa615431472ca9 WHIRLPOOL be73fd5576732f70f6ebb33a9d604d46a8fabdbdb0e187af3435f75412e21f62c0774130a9a6315e6b87ecf96d02398ffce828b3ab8f584716ed9a12e06d7cde
diff --git a/app-emulation/virtualbox/virtualbox-5.0.2.ebuild b/app-emulation/virtualbox/virtualbox-5.0.2.ebuild
deleted file mode 100644
index ffd4b84..0000000
--- a/app-emulation/virtualbox/virtualbox-5.0.2.ebuild
+++ /dev/null
@@ -1,431 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI=5
-
-PYTHON_COMPAT=( python2_7 )
-inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 qt4-r2 toolchain-funcs udev
-
-MY_PV="${PV/beta/BETA}"
-MY_PV="${MY_PV/rc/RC}"
-MY_P=VirtualBox-${MY_PV}
-SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
-	https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.0.2-patches-01.tar.xz"
-S="${WORKDIR}/${MY_P}"
-
-DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
-HOMEPAGE="http://www.virtualbox.org/"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="alsa doc headless java pam pulseaudio +opengl python +qt4 +sdk +udev vboxwebsrv vnc"
-
-RDEPEND="!app-emulation/virtualbox-bin
-	~app-emulation/virtualbox-modules-${PV}
-	dev-libs/libIDL
-	>=dev-libs/libxslt-1.1.19
-	net-misc/curl
-	dev-libs/openssl:0=
-	dev-libs/libxml2
-	media-libs/libpng:0=
-	media-libs/libvpx
-	sys-libs/zlib
-	!headless? (
-		qt4? (
-			dev-qt/qtgui:4
-			dev-qt/qtcore:4
-			opengl? ( dev-qt/qtopengl:4 )
-			x11-libs/libXinerama
-		)
-		opengl? ( virtual/opengl media-libs/freeglut )
-		x11-libs/libX11
-		x11-libs/libXcursor
-		x11-libs/libXext
-		x11-libs/libXmu
-		x11-libs/libXt
-		media-libs/libsdl:0[X,video]
-	)
-
-	java? ( >=virtual/jre-1.6:= )
-	udev? ( >=virtual/udev-171 )
-	vnc? ( >=net-libs/libvncserver-0.9.9 )"
-DEPEND="${RDEPEND}
-	>=dev-util/kbuild-0.1.9998_pre20131130
-	>=dev-lang/yasm-0.6.2
-	sys-devel/bin86
-	sys-power/iasl
-	pam? ( sys-libs/pam )
-	sys-libs/libcap
-	doc? (
-		dev-texlive/texlive-basic
-		dev-texlive/texlive-latex
-		dev-texlive/texlive-latexrecommended
-		dev-texlive/texlive-latexextra
-		dev-texlive/texlive-fontsrecommended
-		dev-texlive/texlive-fontsextra
-	)
-	java? ( >=virtual/jre-1.6:= )
-	virtual/pkgconfig
-	alsa? ( >=media-libs/alsa-lib-1.0.13 )
-	!headless? ( x11-libs/libXinerama )
-	pulseaudio? ( media-sound/pulseaudio )
-	vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
-	${PYTHON_DEPS}"
-
-QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
-	usr/lib/virtualbox/VBoxSDL.so
-	usr/lib/virtualbox/VBoxSharedFolders.so
-	usr/lib/virtualbox/VBoxDD2.so
-	usr/lib/virtualbox/VBoxOGLrenderspu.so
-	usr/lib/virtualbox/VBoxPython.so
-	usr/lib/virtualbox/VBoxDD.so
-	usr/lib/virtualbox/VBoxDDU.so
-	usr/lib/virtualbox/VBoxREM64.so
-	usr/lib/virtualbox/VBoxSharedClipboard.so
-	usr/lib/virtualbox/VBoxHeadless.so
-	usr/lib/virtualbox/VBoxRT.so
-	usr/lib/virtualbox/VBoxREM.so
-	usr/lib/virtualbox/VBoxSettings.so
-	usr/lib/virtualbox/VBoxKeyboard.so
-	usr/lib/virtualbox/VBoxSharedCrOpenGL.so
-	usr/lib/virtualbox/VBoxVMM.so
-	usr/lib/virtualbox/VirtualBox.so
-	usr/lib/virtualbox/VBoxOGLhosterrorspu.so
-	usr/lib/virtualbox/components/VBoxC.so
-	usr/lib/virtualbox/components/VBoxSVCM.so
-	usr/lib/virtualbox/components/VBoxDDU.so
-	usr/lib/virtualbox/components/VBoxRT.so
-	usr/lib/virtualbox/components/VBoxREM.so
-	usr/lib/virtualbox/components/VBoxVMM.so
-	usr/lib/virtualbox/VBoxREM32.so
-	usr/lib/virtualbox/VBoxPython2_4.so
-	usr/lib/virtualbox/VBoxPython2_5.so
-	usr/lib/virtualbox/VBoxPython2_6.so
-	usr/lib/virtualbox/VBoxPython2_7.so
-	usr/lib/virtualbox/VBoxXPCOMC.so
-	usr/lib/virtualbox/VBoxOGLhostcrutil.so
-	usr/lib/virtualbox/VBoxNetDHCP.so
-	usr/lib/virtualbox/VBoxNetNAT.so"
-
-REQUIRED_USE="
-	java? ( sdk )
-	python? (
-		( sdk )
-	)
-	vboxwebsrv? ( java )
-	${PYTHON_REQUIRED_USE}
-"
-
-pkg_setup() {
-	if ! use headless && ! use qt4 ; then
-		einfo "No USE=\"qt4\" selected, this build will not include"
-		einfo "any Qt frontend."
-	elif use headless && use qt4 ; then
-		einfo "You selected USE=\"headless qt4\", defaulting to"
-		einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
-	fi
-
-	if ! use opengl ; then
-		einfo "No USE=\"opengl\" selected, this build will lack"
-		einfo "the OpenGL feature."
-	fi
-	if ! use python ; then
-		einfo "You have disabled the \"python\" USE flag. This will only"
-		einfo "disable the python bindings being installed."
-	fi
-	java-pkg-opt-2_pkg_setup
-	python-single-r1_pkg_setup
-}
-
-src_prepare() {
-	# Remove shipped binaries (kBuild,yasm), see bug #232775
-	rm -rf kBuild/bin tools
-
-	# Disable things unused or split into separate ebuilds
-	sed -e "s@MY_LIBDIR@$(get_libdir)@" \
-		"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
-
-	# Respect LDFLAGS
-	sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
-		-i Config.kmk src/libs/xpcom18a4/Config.kmk || die
-
-	# Use PAM only when pam USE flag is enbaled (bug #376531)
-	if ! use pam ; then
-		elog "Disabling PAM removes the possibility to use the VRDP features."
-		sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
-		sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
-			src/VBox/HostServices/Makefile.kmk || die
-	fi
-
-	# add correct java path
-	if use java ; then
-		sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
-			-i "${S}"/Config.kmk || die
-		java-pkg-opt-2_src_prepare
-	fi
-
-	if ! gcc-specs-pie ; then
-		EPATCH_EXCLUDE="050_${PN}-5.0.2-nopie.patch"
-	fi
-
-	EPATCH_SUFFIX="patch" \
-	EPATCH_FORCE="yes" \
-	epatch "${WORKDIR}/patches"
-
-	epatch_user
-}
-
-src_configure() {
-	local myconf
-	use alsa       || myconf+=" --disable-alsa"
-	use doc        || myconf+=" --disable-docs"
-	use java       || myconf+=" --disable-java"
-	use opengl     || myconf+=" --disable-opengl"
-	use pulseaudio || myconf+=" --disable-pulse"
-	use python     || myconf+=" --disable-python"
-	use vboxwebsrv && myconf+=" --enable-webservice"
-	use vnc        && myconf+=" --enable-vnc"
-	if ! use headless ; then
-		use qt4 || myconf+=" --disable-qt4"
-	else
-		myconf+=" --build-headless --disable-opengl"
-	fi
-	if use amd64 && ! has_multilib_profile ; then
-		myconf+=" --disable-vmmraw"
-	fi
-	# not an autoconf script
-	./configure \
-		--with-gcc="$(tc-getCC)" \
-		--with-g++="$(tc-getCXX)" \
-		--disable-kmods \
-		--disable-dbus \
-		--disable-devmapper \
-		${myconf} \
-		|| die "configure failed"
-}
-
-src_compile() {
-	source ./env.sh
-
-	# Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
-	# and strip all flags
-	# strip-flags
-
-	MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+')
-	MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+')
-	MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
-	MAKE="kmk" emake \
-		VBOX_BUILD_PUBLISHER=_Gentoo \
-		TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
-		TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
-		TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
-		TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
-		VBOX_GCC_OPT="${CXXFLAGS}" \
-		TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
-		all
-}
-
-src_install() {
-	cd "${S}"/out/linux.${ARCH}/release/bin || die
-
-	# Create configuration files
-	insinto /etc/vbox
-	newins "${FILESDIR}/${PN}-4-config" vbox.cfg
-
-	# Set the right libdir
-	sed -i \
-		-e "s@MY_LIBDIR@$(get_libdir)@" \
-		"${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
-
-	# Symlink binaries to the shipped wrapper
-	exeinto /usr/$(get_libdir)/${PN}
-	newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox"
-	fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
-	fperms 0750 /usr/$(get_libdir)/${PN}/VBox
-
-	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
-	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
-	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
-	dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
-
-	# Install binaries and libraries
-	insinto /usr/$(get_libdir)/${PN}
-	doins -r components
-
-	if use sdk ; then
-		doins -r sdk
-	fi
-
-	if use vboxwebsrv ; then
-		doins vboxwebsrv
-		fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
-		fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
-		dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
-		newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
-		newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
-	fi
-
-	#local gcfiles="*gc"
-	#if use amd64 && ! has_multilib_profile ; then
-	#	gcfiles=""
-	#fi
-
-	for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,ExtPackHelperApp} *so *r0 *.rc ; do
-		doins ${each}
-		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
-		fperms 0750 /usr/$(get_libdir)/${PN}/${each}
-	done
-
-	# VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
-	for each in VBoxNet{AdpCtl,DHCP,NAT} ; do
-		doins ${each}
-		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
-		fperms 4750 /usr/$(get_libdir)/${PN}/${each}
-	done
-
-	# VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
-	# VBoxXPCOMIPCD (bug #524202)
-	for each in VBox{Manage,SVC,XPCOMIPCD} ; do
-		if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each} ; then
-			ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/${each}"
-		fi
-	done
-
-	if ! use headless ; then
-		doins VBoxSDL
-		fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxSDL
-		fperms 4750 /usr/$(get_libdir)/${PN}/VBoxSDL
-		if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxSDL ; then
-			ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxSDL"
-		fi
-
-		if use opengl && use qt4 ; then
-			doins VBoxTestOGL
-			fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
-			fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
-			if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxTestOGL ; then
-				ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxTestOGL"
-			fi
-		fi
-
-		dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
-
-		if use qt4 ; then
-			doins VirtualBox
-			fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
-			fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
-			if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox ; then
-				ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VirtualBox"
-			fi
-
-			dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
-
-			newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
-		fi
-
-		pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
-		for size in 16 32 48 64 128 ; do
-			newicon -s ${size} ${PN}-${size}px.png ${PN}.png
-		done
-		newicon ${PN}-48px.png ${PN}.png
-		doicon -s scalable ${PN}.svg
-		popd &>/dev/null || die
-	fi
-
-	doins VBoxHeadless
-	fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
-	fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
-	if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless ; then
-		ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxHeadless"
-	fi
-
-	insinto /usr/$(get_libdir)/${PN}
-	# Install EFI Firmware files (bug #320757)
-	pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
-	for fwfile in VBoxEFI{32,64}.fd ; do
-		doins ${fwfile}
-		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile}
-	done
-	popd &>/dev/null || die
-
-	if use udev ; then
-		# New way of handling USB device nodes for VBox (bug #356215)
-		local udevdir="$(get_udevdir)"
-		insinto ${udevdir}
-		doins VBoxCreateUSBNode.sh
-		fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
-		fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
-		insinto ${udevdir}/rules.d
-		doins "${FILESDIR}"/10-virtualbox.rules
-		sed "s@%UDEVDIR%@${udevdir}@" \
-			-i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
-	fi
-
-	insinto /usr/share/${PN}
-	if ! use headless && use qt4 ; then
-		doins -r nls
-	fi
-
-	# VRDPAuth only works with this (bug #351949)
-	dosym VBoxAuth.so  /usr/$(get_libdir)/${PN}/VRDPAuth.so
-
-	# set an env-variable for 3rd party tools
-	echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
-	doenvd "${T}/90virtualbox"
-
-	if use java ; then
-		java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
-		java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
-	fi
-}
-
-pkg_postinst() {
-	fdo-mime_desktop_database_update
-
-	if use udev ; then
-		udevadm control --reload-rules \
-			&& udevadm trigger --subsystem-match=usb
-	fi
-
-	if ! use headless && use qt4 ; then
-		elog "To launch VirtualBox just type: \"VirtualBox\"."
-	fi
-	elog "You must be in the vboxusers group to use VirtualBox."
-	elog ""
-	elog "The latest user manual is available for download at:"
-	elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
-	elog ""
-	elog "For advanced networking setups you should emerge:"
-	elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
-	elog ""
-	elog "IMPORTANT!"
-	elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
-	elog "\"env-update\" as root and logout and relogin as the user you wish"
-	elog "to run ${PN} as."
-	elog ""
-	elog "Starting with version 4.0.0, ${PN} has USB-1 support."
-	elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
-	elog "  app-emulation/virtualbox-extpack-oracle"
-	elog "package."
-	elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
-	elog "the \"extension\" USE flag. For installation of the guest additions ISO"
-	elog "image, please emerge"
-	elog "  app-emulation/virtualbox-additions"
-	elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
-	elog "  app-emulation/virtualbox-extpack-oracle"
-	if ! use udev ; then
-		elog ""
-		elog "WARNING!"
-		elog "Without USE=udev, USB devices will likely not work in ${PN}."
-	elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
-		elog ""
-		elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
-		elog "or else USB in ${PN} won't work."
-	fi
-}
-
-pkg_postrm() {
-	fdo-mime_desktop_database_update
-}
diff --git a/app-emulation/virtualbox/virtualbox-5.0.6-r1.ebuild b/app-emulation/virtualbox/virtualbox-5.0.6-r1.ebuild
new file mode 100644
index 0000000..7619b88
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-5.0.6-r1.ebuild
@@ -0,0 +1,432 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 qt4-r2 toolchain-funcs udev
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
+	https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.0.2-patches-01.tar.xz"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa doc headless java libressl pam pulseaudio +opengl python +qt4 +sdk +udev vboxwebsrv vnc"
+
+RDEPEND="!app-emulation/virtualbox-bin
+	~app-emulation/virtualbox-modules-${PV}
+	dev-libs/libIDL
+	>=dev-libs/libxslt-1.1.19
+	net-misc/curl
+	!libressl? ( dev-libs/openssl:0= )
+	libressl? ( dev-libs/libressl:= )
+	dev-libs/libxml2
+	media-libs/libpng:0=
+	media-libs/libvpx
+	sys-libs/zlib
+	!headless? (
+		qt4? (
+			dev-qt/qtgui:4
+			dev-qt/qtcore:4
+			opengl? ( dev-qt/qtopengl:4 )
+			x11-libs/libXinerama
+		)
+		opengl? ( virtual/opengl media-libs/freeglut )
+		x11-libs/libX11
+		x11-libs/libXcursor
+		x11-libs/libXext
+		x11-libs/libXmu
+		x11-libs/libXt
+		media-libs/libsdl:0[X,video]
+	)
+
+	java? ( >=virtual/jre-1.6:= )
+	udev? ( >=virtual/udev-171 )
+	vnc? ( >=net-libs/libvncserver-0.9.9 )"
+DEPEND="${RDEPEND}
+	>=dev-util/kbuild-0.1.9998_pre20131130
+	>=dev-lang/yasm-0.6.2
+	sys-devel/bin86
+	sys-power/iasl
+	pam? ( sys-libs/pam )
+	sys-libs/libcap
+	doc? (
+		dev-texlive/texlive-basic
+		dev-texlive/texlive-latex
+		dev-texlive/texlive-latexrecommended
+		dev-texlive/texlive-latexextra
+		dev-texlive/texlive-fontsrecommended
+		dev-texlive/texlive-fontsextra
+	)
+	java? ( >=virtual/jre-1.6:= )
+	virtual/pkgconfig
+	alsa? ( >=media-libs/alsa-lib-1.0.13 )
+	!headless? ( x11-libs/libXinerama )
+	pulseaudio? ( media-sound/pulseaudio )
+	vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
+	${PYTHON_DEPS}"
+
+QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
+	usr/lib/virtualbox/VBoxSDL.so
+	usr/lib/virtualbox/VBoxSharedFolders.so
+	usr/lib/virtualbox/VBoxDD2.so
+	usr/lib/virtualbox/VBoxOGLrenderspu.so
+	usr/lib/virtualbox/VBoxPython.so
+	usr/lib/virtualbox/VBoxDD.so
+	usr/lib/virtualbox/VBoxDDU.so
+	usr/lib/virtualbox/VBoxREM64.so
+	usr/lib/virtualbox/VBoxSharedClipboard.so
+	usr/lib/virtualbox/VBoxHeadless.so
+	usr/lib/virtualbox/VBoxRT.so
+	usr/lib/virtualbox/VBoxREM.so
+	usr/lib/virtualbox/VBoxSettings.so
+	usr/lib/virtualbox/VBoxKeyboard.so
+	usr/lib/virtualbox/VBoxSharedCrOpenGL.so
+	usr/lib/virtualbox/VBoxVMM.so
+	usr/lib/virtualbox/VirtualBox.so
+	usr/lib/virtualbox/VBoxOGLhosterrorspu.so
+	usr/lib/virtualbox/components/VBoxC.so
+	usr/lib/virtualbox/components/VBoxSVCM.so
+	usr/lib/virtualbox/components/VBoxDDU.so
+	usr/lib/virtualbox/components/VBoxRT.so
+	usr/lib/virtualbox/components/VBoxREM.so
+	usr/lib/virtualbox/components/VBoxVMM.so
+	usr/lib/virtualbox/VBoxREM32.so
+	usr/lib/virtualbox/VBoxPython2_4.so
+	usr/lib/virtualbox/VBoxPython2_5.so
+	usr/lib/virtualbox/VBoxPython2_6.so
+	usr/lib/virtualbox/VBoxPython2_7.so
+	usr/lib/virtualbox/VBoxXPCOMC.so
+	usr/lib/virtualbox/VBoxOGLhostcrutil.so
+	usr/lib/virtualbox/VBoxNetDHCP.so
+	usr/lib/virtualbox/VBoxNetNAT.so"
+
+REQUIRED_USE="
+	java? ( sdk )
+	python? (
+		( sdk )
+	)
+	vboxwebsrv? ( java )
+	${PYTHON_REQUIRED_USE}
+"
+
+pkg_setup() {
+	if ! use headless && ! use qt4 ; then
+		einfo "No USE=\"qt4\" selected, this build will not include"
+		einfo "any Qt frontend."
+	elif use headless && use qt4 ; then
+		einfo "You selected USE=\"headless qt4\", defaulting to"
+		einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
+	fi
+
+	if ! use opengl ; then
+		einfo "No USE=\"opengl\" selected, this build will lack"
+		einfo "the OpenGL feature."
+	fi
+	if ! use python ; then
+		einfo "You have disabled the \"python\" USE flag. This will only"
+		einfo "disable the python bindings being installed."
+	fi
+	java-pkg-opt-2_pkg_setup
+	python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	# Remove shipped binaries (kBuild,yasm), see bug #232775
+	rm -rf kBuild/bin tools
+
+	# Disable things unused or split into separate ebuilds
+	sed -e "s@MY_LIBDIR@$(get_libdir)@" \
+		"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
+
+	# Respect LDFLAGS
+	sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
+		-i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+	# Use PAM only when pam USE flag is enbaled (bug #376531)
+	if ! use pam ; then
+		elog "Disabling PAM removes the possibility to use the VRDP features."
+		sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
+		sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
+			src/VBox/HostServices/Makefile.kmk || die
+	fi
+
+	# add correct java path
+	if use java ; then
+		sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
+			-i "${S}"/Config.kmk || die
+		java-pkg-opt-2_src_prepare
+	fi
+
+	if ! gcc-specs-pie ; then
+		EPATCH_EXCLUDE="050_${PN}-5.0.2-nopie.patch"
+	fi
+
+	EPATCH_SUFFIX="patch" \
+	EPATCH_FORCE="yes" \
+	epatch "${WORKDIR}/patches"
+
+	epatch_user
+}
+
+src_configure() {
+	local myconf
+	use alsa       || myconf+=" --disable-alsa"
+	use doc        || myconf+=" --disable-docs"
+	use java       || myconf+=" --disable-java"
+	use opengl     || myconf+=" --disable-opengl"
+	use pulseaudio || myconf+=" --disable-pulse"
+	use python     || myconf+=" --disable-python"
+	use vboxwebsrv && myconf+=" --enable-webservice"
+	use vnc        && myconf+=" --enable-vnc"
+	if ! use headless ; then
+		use qt4 || myconf+=" --disable-qt4"
+	else
+		myconf+=" --build-headless --disable-opengl"
+	fi
+	if use amd64 && ! has_multilib_profile ; then
+		myconf+=" --disable-vmmraw"
+	fi
+	# not an autoconf script
+	./configure \
+		--with-gcc="$(tc-getCC)" \
+		--with-g++="$(tc-getCXX)" \
+		--disable-kmods \
+		--disable-dbus \
+		--disable-devmapper \
+		${myconf} \
+		|| die "configure failed"
+}
+
+src_compile() {
+	source ./env.sh
+
+	# Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+	# and strip all flags
+	# strip-flags
+
+	MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+')
+	MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+')
+	MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
+	MAKE="kmk" emake \
+		VBOX_BUILD_PUBLISHER=_Gentoo \
+		TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
+		TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
+		TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
+		TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
+		VBOX_GCC_OPT="${CXXFLAGS}" \
+		TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
+		all
+}
+
+src_install() {
+	cd "${S}"/out/linux.${ARCH}/release/bin || die
+
+	# Create configuration files
+	insinto /etc/vbox
+	newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+	# Set the right libdir
+	sed -i \
+		-e "s@MY_LIBDIR@$(get_libdir)@" \
+		"${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+	# Symlink binaries to the shipped wrapper
+	exeinto /usr/$(get_libdir)/${PN}
+	newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox"
+	fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
+	fperms 0750 /usr/$(get_libdir)/${PN}/VBox
+
+	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
+	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
+	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
+	dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
+
+	# Install binaries and libraries
+	insinto /usr/$(get_libdir)/${PN}
+	doins -r components
+
+	if use sdk ; then
+		doins -r sdk
+	fi
+
+	if use vboxwebsrv ; then
+		doins vboxwebsrv
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
+		fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
+		dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
+		newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+		newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+	fi
+
+	local rcfiles="*.rc"
+	if use amd64 && ! has_multilib_profile ; then
+		rcfiles=""
+	fi
+
+	for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,ExtPackHelperApp} *so *r0 ${rcfiles} ; do
+		doins ${each}
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+		fperms 0750 /usr/$(get_libdir)/${PN}/${each}
+	done
+
+	# VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+	for each in VBoxNet{AdpCtl,DHCP,NAT} ; do
+		doins ${each}
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+		fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+	done
+
+	# VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
+	# VBoxXPCOMIPCD (bug #524202)
+	for each in VBox{Manage,SVC,XPCOMIPCD} ; do
+		if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each} ; then
+			ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/${each}"
+		fi
+	done
+
+	if ! use headless ; then
+		doins VBoxSDL
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxSDL
+		fperms 4750 /usr/$(get_libdir)/${PN}/VBoxSDL
+		if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxSDL ; then
+			ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxSDL"
+		fi
+
+		if use opengl && use qt4 ; then
+			doins VBoxTestOGL
+			fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
+			fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
+			if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxTestOGL ; then
+				ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxTestOGL"
+			fi
+		fi
+
+		dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
+
+		if use qt4 ; then
+			doins VirtualBox
+			fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
+			fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
+			if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox ; then
+				ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VirtualBox"
+			fi
+
+			dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
+
+			newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
+		fi
+
+		pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
+		for size in 16 32 48 64 128 ; do
+			newicon -s ${size} ${PN}-${size}px.png ${PN}.png
+		done
+		newicon ${PN}-48px.png ${PN}.png
+		doicon -s scalable ${PN}.svg
+		popd &>/dev/null || die
+	fi
+
+	doins VBoxHeadless
+	fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
+	fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
+	if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless ; then
+		ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxHeadless"
+	fi
+
+	insinto /usr/$(get_libdir)/${PN}
+	# Install EFI Firmware files (bug #320757)
+	pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
+	for fwfile in VBoxEFI{32,64}.fd ; do
+		doins ${fwfile}
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile}
+	done
+	popd &>/dev/null || die
+
+	if use udev ; then
+		# New way of handling USB device nodes for VBox (bug #356215)
+		local udevdir="$(get_udevdir)"
+		insinto ${udevdir}
+		doins VBoxCreateUSBNode.sh
+		fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
+		fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+		insinto ${udevdir}/rules.d
+		doins "${FILESDIR}"/10-virtualbox.rules
+		sed "s@%UDEVDIR%@${udevdir}@" \
+			-i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+	fi
+
+	insinto /usr/share/${PN}
+	if ! use headless && use qt4 ; then
+		doins -r nls
+	fi
+
+	# VRDPAuth only works with this (bug #351949)
+	dosym VBoxAuth.so  /usr/$(get_libdir)/${PN}/VRDPAuth.so
+
+	# set an env-variable for 3rd party tools
+	echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
+	doenvd "${T}/90virtualbox"
+
+	if use java ; then
+		java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+		java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
+	fi
+}
+
+pkg_postinst() {
+	fdo-mime_desktop_database_update
+
+	if use udev ; then
+		udevadm control --reload-rules \
+			&& udevadm trigger --subsystem-match=usb
+	fi
+
+	if ! use headless && use qt4 ; then
+		elog "To launch VirtualBox just type: \"VirtualBox\"."
+	fi
+	elog "You must be in the vboxusers group to use VirtualBox."
+	elog ""
+	elog "The latest user manual is available for download at:"
+	elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
+	elog ""
+	elog "For advanced networking setups you should emerge:"
+	elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+	elog ""
+	elog "IMPORTANT!"
+	elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
+	elog "\"env-update\" as root and logout and relogin as the user you wish"
+	elog "to run ${PN} as."
+	elog ""
+	elog "Starting with version 4.0.0, ${PN} has USB-1 support."
+	elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
+	elog "  app-emulation/virtualbox-extpack-oracle"
+	elog "package."
+	elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
+	elog "the \"extension\" USE flag. For installation of the guest additions ISO"
+	elog "image, please emerge"
+	elog "  app-emulation/virtualbox-additions"
+	elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
+	elog "  app-emulation/virtualbox-extpack-oracle"
+	if ! use udev ; then
+		elog ""
+		elog "WARNING!"
+		elog "Without USE=udev, USB devices will likely not work in ${PN}."
+	elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+		elog ""
+		elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+		elog "or else USB in ${PN} won't work."
+	fi
+}
+
+pkg_postrm() {
+	fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/virtualbox/virtualbox-5.0.6.ebuild b/app-emulation/virtualbox/virtualbox-5.0.6.ebuild
new file mode 100644
index 0000000..b10c461
--- /dev/null
+++ b/app-emulation/virtualbox/virtualbox-5.0.6.ebuild
@@ -0,0 +1,431 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils fdo-mime flag-o-matic java-pkg-opt-2 linux-info multilib pax-utils python-single-r1 qt4-r2 toolchain-funcs udev
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2
+	https://dev.gentoo.org/~polynomial-c/${PN}/patchsets/${PN}-5.0.2-patches-01.tar.xz"
+S="${WORKDIR}/${MY_P}"
+
+DESCRIPTION="Family of powerful x86 virtualization products for enterprise as well as home use"
+HOMEPAGE="http://www.virtualbox.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa doc headless java pam pulseaudio +opengl python +qt4 +sdk +udev vboxwebsrv vnc"
+
+RDEPEND="!app-emulation/virtualbox-bin
+	~app-emulation/virtualbox-modules-${PV}
+	dev-libs/libIDL
+	>=dev-libs/libxslt-1.1.19
+	net-misc/curl
+	dev-libs/openssl:0=
+	dev-libs/libxml2
+	media-libs/libpng:0=
+	media-libs/libvpx
+	sys-libs/zlib
+	!headless? (
+		qt4? (
+			dev-qt/qtgui:4
+			dev-qt/qtcore:4
+			opengl? ( dev-qt/qtopengl:4 )
+			x11-libs/libXinerama
+		)
+		opengl? ( virtual/opengl media-libs/freeglut )
+		x11-libs/libX11
+		x11-libs/libXcursor
+		x11-libs/libXext
+		x11-libs/libXmu
+		x11-libs/libXt
+		media-libs/libsdl:0[X,video]
+	)
+
+	java? ( >=virtual/jre-1.6:= )
+	udev? ( >=virtual/udev-171 )
+	vnc? ( >=net-libs/libvncserver-0.9.9 )"
+DEPEND="${RDEPEND}
+	>=dev-util/kbuild-0.1.9998_pre20131130
+	>=dev-lang/yasm-0.6.2
+	sys-devel/bin86
+	sys-power/iasl
+	pam? ( sys-libs/pam )
+	sys-libs/libcap
+	doc? (
+		dev-texlive/texlive-basic
+		dev-texlive/texlive-latex
+		dev-texlive/texlive-latexrecommended
+		dev-texlive/texlive-latexextra
+		dev-texlive/texlive-fontsrecommended
+		dev-texlive/texlive-fontsextra
+	)
+	java? ( >=virtual/jre-1.6:= )
+	virtual/pkgconfig
+	alsa? ( >=media-libs/alsa-lib-1.0.13 )
+	!headless? ( x11-libs/libXinerama )
+	pulseaudio? ( media-sound/pulseaudio )
+	vboxwebsrv? ( net-libs/gsoap[-gnutls(-)] )
+	${PYTHON_DEPS}"
+
+QA_TEXTRELS_x86="usr/lib/virtualbox-ose/VBoxGuestPropSvc.so
+	usr/lib/virtualbox/VBoxSDL.so
+	usr/lib/virtualbox/VBoxSharedFolders.so
+	usr/lib/virtualbox/VBoxDD2.so
+	usr/lib/virtualbox/VBoxOGLrenderspu.so
+	usr/lib/virtualbox/VBoxPython.so
+	usr/lib/virtualbox/VBoxDD.so
+	usr/lib/virtualbox/VBoxDDU.so
+	usr/lib/virtualbox/VBoxREM64.so
+	usr/lib/virtualbox/VBoxSharedClipboard.so
+	usr/lib/virtualbox/VBoxHeadless.so
+	usr/lib/virtualbox/VBoxRT.so
+	usr/lib/virtualbox/VBoxREM.so
+	usr/lib/virtualbox/VBoxSettings.so
+	usr/lib/virtualbox/VBoxKeyboard.so
+	usr/lib/virtualbox/VBoxSharedCrOpenGL.so
+	usr/lib/virtualbox/VBoxVMM.so
+	usr/lib/virtualbox/VirtualBox.so
+	usr/lib/virtualbox/VBoxOGLhosterrorspu.so
+	usr/lib/virtualbox/components/VBoxC.so
+	usr/lib/virtualbox/components/VBoxSVCM.so
+	usr/lib/virtualbox/components/VBoxDDU.so
+	usr/lib/virtualbox/components/VBoxRT.so
+	usr/lib/virtualbox/components/VBoxREM.so
+	usr/lib/virtualbox/components/VBoxVMM.so
+	usr/lib/virtualbox/VBoxREM32.so
+	usr/lib/virtualbox/VBoxPython2_4.so
+	usr/lib/virtualbox/VBoxPython2_5.so
+	usr/lib/virtualbox/VBoxPython2_6.so
+	usr/lib/virtualbox/VBoxPython2_7.so
+	usr/lib/virtualbox/VBoxXPCOMC.so
+	usr/lib/virtualbox/VBoxOGLhostcrutil.so
+	usr/lib/virtualbox/VBoxNetDHCP.so
+	usr/lib/virtualbox/VBoxNetNAT.so"
+
+REQUIRED_USE="
+	java? ( sdk )
+	python? (
+		( sdk )
+	)
+	vboxwebsrv? ( java )
+	${PYTHON_REQUIRED_USE}
+"
+
+pkg_setup() {
+	if ! use headless && ! use qt4 ; then
+		einfo "No USE=\"qt4\" selected, this build will not include"
+		einfo "any Qt frontend."
+	elif use headless && use qt4 ; then
+		einfo "You selected USE=\"headless qt4\", defaulting to"
+		einfo "USE=\"headless\", this build will not include any X11/Qt frontend."
+	fi
+
+	if ! use opengl ; then
+		einfo "No USE=\"opengl\" selected, this build will lack"
+		einfo "the OpenGL feature."
+	fi
+	if ! use python ; then
+		einfo "You have disabled the \"python\" USE flag. This will only"
+		einfo "disable the python bindings being installed."
+	fi
+	java-pkg-opt-2_pkg_setup
+	python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	# Remove shipped binaries (kBuild,yasm), see bug #232775
+	rm -rf kBuild/bin tools
+
+	# Disable things unused or split into separate ebuilds
+	sed -e "s@MY_LIBDIR@$(get_libdir)@" \
+		"${FILESDIR}"/${PN}-5-localconfig > LocalConfig.kmk || die
+
+	# Respect LDFLAGS
+	sed -e "s@_LDFLAGS\.${ARCH}*.*=@& ${LDFLAGS}@g" \
+		-i Config.kmk src/libs/xpcom18a4/Config.kmk || die
+
+	# Use PAM only when pam USE flag is enbaled (bug #376531)
+	if ! use pam ; then
+		elog "Disabling PAM removes the possibility to use the VRDP features."
+		sed -i 's@^.*VBOX_WITH_PAM@#VBOX_WITH_PAM@' Config.kmk || die
+		sed -i 's@\(.*/auth/Makefile.kmk.*\)@#\1@' \
+			src/VBox/HostServices/Makefile.kmk || die
+	fi
+
+	# add correct java path
+	if use java ; then
+		sed "s@/usr/lib/jvm/java-6-sun@$(java-config -O)@" \
+			-i "${S}"/Config.kmk || die
+		java-pkg-opt-2_src_prepare
+	fi
+
+	if ! gcc-specs-pie ; then
+		EPATCH_EXCLUDE="050_${PN}-5.0.2-nopie.patch"
+	fi
+
+	EPATCH_SUFFIX="patch" \
+	EPATCH_FORCE="yes" \
+	epatch "${WORKDIR}/patches"
+
+	epatch_user
+}
+
+src_configure() {
+	local myconf
+	use alsa       || myconf+=" --disable-alsa"
+	use doc        || myconf+=" --disable-docs"
+	use java       || myconf+=" --disable-java"
+	use opengl     || myconf+=" --disable-opengl"
+	use pulseaudio || myconf+=" --disable-pulse"
+	use python     || myconf+=" --disable-python"
+	use vboxwebsrv && myconf+=" --enable-webservice"
+	use vnc        && myconf+=" --enable-vnc"
+	if ! use headless ; then
+		use qt4 || myconf+=" --disable-qt4"
+	else
+		myconf+=" --build-headless --disable-opengl"
+	fi
+	if use amd64 && ! has_multilib_profile ; then
+		myconf+=" --disable-vmmraw"
+	fi
+	# not an autoconf script
+	./configure \
+		--with-gcc="$(tc-getCC)" \
+		--with-g++="$(tc-getCXX)" \
+		--disable-kmods \
+		--disable-dbus \
+		--disable-devmapper \
+		${myconf} \
+		|| die "configure failed"
+}
+
+src_compile() {
+	source ./env.sh
+
+	# Force kBuild to respect C[XX]FLAGS and MAKEOPTS (bug #178529)
+	# and strip all flags
+	# strip-flags
+
+	MAKEJOBS=$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+')
+	MAKELOAD=$(echo ${MAKEOPTS} | egrep -o '(\-l|\-\-load-average)(=?|[[:space:]]*)[[:digit:]]+')
+	MAKEOPTS="${MAKEJOBS} ${MAKELOAD}"
+	MAKE="kmk" emake \
+		VBOX_BUILD_PUBLISHER=_Gentoo \
+		TOOL_GCC3_CC="$(tc-getCC)" TOOL_GCC3_CXX="$(tc-getCXX)" \
+		TOOL_GCC3_AS="$(tc-getCC)" TOOL_GCC3_AR="$(tc-getAR)" \
+		TOOL_GCC3_LD="$(tc-getCXX)" TOOL_GCC3_LD_SYSMOD="$(tc-getLD)" \
+		TOOL_GCC3_CFLAGS="${CFLAGS}" TOOL_GCC3_CXXFLAGS="${CXXFLAGS}" \
+		VBOX_GCC_OPT="${CXXFLAGS}" \
+		TOOL_YASM_AS=yasm KBUILD_VERBOSE=2 \
+		all
+}
+
+src_install() {
+	cd "${S}"/out/linux.${ARCH}/release/bin || die
+
+	# Create configuration files
+	insinto /etc/vbox
+	newins "${FILESDIR}/${PN}-4-config" vbox.cfg
+
+	# Set the right libdir
+	sed -i \
+		-e "s@MY_LIBDIR@$(get_libdir)@" \
+		"${D}"/etc/vbox/vbox.cfg || die "vbox.cfg sed failed"
+
+	# Symlink binaries to the shipped wrapper
+	exeinto /usr/$(get_libdir)/${PN}
+	newexe "${FILESDIR}/${PN}-ose-3-wrapper" "VBox"
+	fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBox
+	fperms 0750 /usr/$(get_libdir)/${PN}/VBox
+
+	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxManage
+	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxVRDP
+	dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxHeadless
+	dosym /usr/$(get_libdir)/${PN}/VBoxTunctl /usr/bin/VBoxTunctl
+
+	# Install binaries and libraries
+	insinto /usr/$(get_libdir)/${PN}
+	doins -r components
+
+	if use sdk ; then
+		doins -r sdk
+	fi
+
+	if use vboxwebsrv ; then
+		doins vboxwebsrv
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/vboxwebsrv
+		fperms 0750 /usr/$(get_libdir)/${PN}/vboxwebsrv
+		dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/vboxwebsrv
+		newinitd "${FILESDIR}"/vboxwebsrv-initd vboxwebsrv
+		newconfd "${FILESDIR}"/vboxwebsrv-confd vboxwebsrv
+	fi
+
+	local rcfiles="*.rc"
+	if use amd64 && ! has_multilib_profile ; then
+		rcfiles=""
+	fi
+
+	for each in VBox{Manage,SVC,XPCOMIPCD,Tunctl,ExtPackHelperApp} *so *r0 ${rcfiles} ; do
+		doins ${each}
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+		fperms 0750 /usr/$(get_libdir)/${PN}/${each}
+	done
+
+	# VBoxNetAdpCtl and VBoxNetDHCP binaries need to be suid root in any case..
+	for each in VBoxNet{AdpCtl,DHCP,NAT} ; do
+		doins ${each}
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${each}
+		fperms 4750 /usr/$(get_libdir)/${PN}/${each}
+	done
+
+	# VBoxSVC and VBoxManage need to be pax-marked (bug #403453)
+	# VBoxXPCOMIPCD (bug #524202)
+	for each in VBox{Manage,SVC,XPCOMIPCD} ; do
+		if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/${each} ; then
+			ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/${each}"
+		fi
+	done
+
+	if ! use headless ; then
+		doins VBoxSDL
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxSDL
+		fperms 4750 /usr/$(get_libdir)/${PN}/VBoxSDL
+		if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxSDL ; then
+			ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxSDL"
+		fi
+
+		if use opengl && use qt4 ; then
+			doins VBoxTestOGL
+			fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxTestOGL
+			fperms 0750 /usr/$(get_libdir)/${PN}/VBoxTestOGL
+			if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxTestOGL ; then
+				ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxTestOGL"
+			fi
+		fi
+
+		dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VBoxSDL
+
+		if use qt4 ; then
+			doins VirtualBox
+			fowners root:vboxusers /usr/$(get_libdir)/${PN}/VirtualBox
+			fperms 4750 /usr/$(get_libdir)/${PN}/VirtualBox
+			if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VirtualBox ; then
+				ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VirtualBox"
+			fi
+
+			dosym /usr/$(get_libdir)/${PN}/VBox /usr/bin/VirtualBox
+
+			newmenu "${FILESDIR}"/${PN}-ose.desktop-2 ${PN}.desktop
+		fi
+
+		pushd "${S}"/src/VBox/Artwork/OSE &>/dev/null || die
+		for size in 16 32 48 64 128 ; do
+			newicon -s ${size} ${PN}-${size}px.png ${PN}.png
+		done
+		newicon ${PN}-48px.png ${PN}.png
+		doicon -s scalable ${PN}.svg
+		popd &>/dev/null || die
+	fi
+
+	doins VBoxHeadless
+	fowners root:vboxusers /usr/$(get_libdir)/${PN}/VBoxHeadless
+	fperms 4750 /usr/$(get_libdir)/${PN}/VBoxHeadless
+	if ! pax-mark -m "${D}"/usr/$(get_libdir)/${PN}/VBoxHeadless ; then
+		ewarn "Couldn't pax-mark /usr/$(get_libdir)/${PN}/VBoxHeadless"
+	fi
+
+	insinto /usr/$(get_libdir)/${PN}
+	# Install EFI Firmware files (bug #320757)
+	pushd "${S}"/src/VBox/Devices/EFI/FirmwareBin &>/dev/null || die
+	for fwfile in VBoxEFI{32,64}.fd ; do
+		doins ${fwfile}
+		fowners root:vboxusers /usr/$(get_libdir)/${PN}/${fwfile}
+	done
+	popd &>/dev/null || die
+
+	if use udev ; then
+		# New way of handling USB device nodes for VBox (bug #356215)
+		local udevdir="$(get_udevdir)"
+		insinto ${udevdir}
+		doins VBoxCreateUSBNode.sh
+		fowners root:vboxusers ${udevdir}/VBoxCreateUSBNode.sh
+		fperms 0750 ${udevdir}/VBoxCreateUSBNode.sh
+		insinto ${udevdir}/rules.d
+		doins "${FILESDIR}"/10-virtualbox.rules
+		sed "s@%UDEVDIR%@${udevdir}@" \
+			-i "${D}"${udevdir}/rules.d/10-virtualbox.rules || die
+	fi
+
+	insinto /usr/share/${PN}
+	if ! use headless && use qt4 ; then
+		doins -r nls
+	fi
+
+	# VRDPAuth only works with this (bug #351949)
+	dosym VBoxAuth.so  /usr/$(get_libdir)/${PN}/VRDPAuth.so
+
+	# set an env-variable for 3rd party tools
+	echo -n "VBOX_APP_HOME=/usr/$(get_libdir)/${PN}" > "${T}/90virtualbox"
+	doenvd "${T}/90virtualbox"
+
+	if use java ; then
+		java-pkg_regjar "${D}/usr/$(get_libdir)/${PN}/sdk/bindings/xpcom/java/vboxjxpcom.jar"
+		java-pkg_regso "${D}/usr/$(get_libdir)/${PN}/libvboxjxpcom.so"
+	fi
+}
+
+pkg_postinst() {
+	fdo-mime_desktop_database_update
+
+	if use udev ; then
+		udevadm control --reload-rules \
+			&& udevadm trigger --subsystem-match=usb
+	fi
+
+	if ! use headless && use qt4 ; then
+		elog "To launch VirtualBox just type: \"VirtualBox\"."
+	fi
+	elog "You must be in the vboxusers group to use VirtualBox."
+	elog ""
+	elog "The latest user manual is available for download at:"
+	elog "http://download.virtualbox.org/virtualbox/${PV}/UserManual.pdf"
+	elog ""
+	elog "For advanced networking setups you should emerge:"
+	elog "net-misc/bridge-utils and sys-apps/usermode-utilities"
+	elog ""
+	elog "IMPORTANT!"
+	elog "If you upgrade from app-emulation/virtualbox-ose make sure to run"
+	elog "\"env-update\" as root and logout and relogin as the user you wish"
+	elog "to run ${PN} as."
+	elog ""
+	elog "Starting with version 4.0.0, ${PN} has USB-1 support."
+	elog "For USB-2 support, PXE-boot ability and VRDP support please emerge"
+	elog "  app-emulation/virtualbox-extpack-oracle"
+	elog "package."
+	elog "Starting with version 5.0.0, ${PN} no longer has the \"additions\" and"
+	elog "the \"extension\" USE flag. For installation of the guest additions ISO"
+	elog "image, please emerge"
+	elog "  app-emulation/virtualbox-additions"
+	elog "and for the USB2, USB3, VRDP and PXE boot ROM modules, please emerge"
+	elog "  app-emulation/virtualbox-extpack-oracle"
+	if ! use udev ; then
+		elog ""
+		elog "WARNING!"
+		elog "Without USE=udev, USB devices will likely not work in ${PN}."
+	elif [ -e "${ROOT}/etc/udev/rules.d/10-virtualbox.rules" ] ; then
+		elog ""
+		elog "Please remove \"${ROOT}/etc/udev/rules.d/10-virtualbox.rules\""
+		elog "or else USB in ${PN} won't work."
+	fi
+}
+
+pkg_postrm() {
+	fdo-mime_desktop_database_update
+}
diff --git a/app-emulation/wine/files/pr66838.c b/app-emulation/wine/files/pr66838.c
new file mode 100644
index 0000000..cd61685
--- /dev/null
+++ b/app-emulation/wine/files/pr66838.c
@@ -0,0 +1,36 @@
+/* From gcc svn, /branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr66838.c */
+/* Copyrighted and distributed under the same terms as gcc */
+
+void abort (void);
+
+char global;
+
+__attribute__((sysv_abi, noinline, noclone))
+void sysv_abi_func(char const *desc, void *local)
+{
+  register int esi asm ("esi");
+  register int edi asm ("edi");
+  
+  if (local != &global)
+    abort ();
+
+  /* Clobber some of the extra SYSV ABI registers.  */
+  asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1"
+		: "=r" (esi), "=r" (edi)
+		: "i" (0xdeadbeef));
+}
+
+__attribute__((ms_abi, noinline, noclone))
+void ms_abi_func ()
+{
+  sysv_abi_func ("1st call", &global);
+  sysv_abi_func ("2nd call", &global);
+  sysv_abi_func ("3rd call", &global);
+}
+
+int
+main(void)
+{
+  ms_abi_func();
+  return 0;
+}
diff --git a/app-emulation/wine/wine-1.6.2-r1.ebuild b/app-emulation/wine/wine-1.6.2-r1.ebuild
index cd806c0..7890da7 100644
--- a/app-emulation/wine/wine-1.6.2-r1.ebuild
+++ b/app-emulation/wine/wine-1.6.2-r1.ebuild
@@ -145,12 +145,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.6.2.ebuild b/app-emulation/wine/wine-1.6.2.ebuild
index 3b620b1..e990228 100644
--- a/app-emulation/wine/wine-1.6.2.ebuild
+++ b/app-emulation/wine/wine-1.6.2.ebuild
@@ -174,12 +174,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.10-r1.ebuild b/app-emulation/wine/wine-1.7.10-r1.ebuild
index 8dd4996..9cd19bd 100644
--- a/app-emulation/wine/wine-1.7.10-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.10-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.11-r1.ebuild b/app-emulation/wine/wine-1.7.11-r1.ebuild
index 8dd4996..9cd19bd 100644
--- a/app-emulation/wine/wine-1.7.11-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.11-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.12-r1.ebuild b/app-emulation/wine/wine-1.7.12-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.12-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.12-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.13-r1.ebuild b/app-emulation/wine/wine-1.7.13-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.13-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.13-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.14-r1.ebuild b/app-emulation/wine/wine-1.7.14-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.14-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.14-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.15-r1.ebuild b/app-emulation/wine/wine-1.7.15-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.15-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.15-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.16-r1.ebuild b/app-emulation/wine/wine-1.7.16-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.16-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.16-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.17-r1.ebuild b/app-emulation/wine/wine-1.7.17-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.17-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.17-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.18-r1.ebuild b/app-emulation/wine/wine-1.7.18-r1.ebuild
index a672bc8..16697c5 100644
--- a/app-emulation/wine/wine-1.7.18-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.18-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.19-r2.ebuild b/app-emulation/wine/wine-1.7.19-r2.ebuild
index 0569dd9..90fb710 100644
--- a/app-emulation/wine/wine-1.7.19-r2.ebuild
+++ b/app-emulation/wine/wine-1.7.19-r2.ebuild
@@ -159,12 +159,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.20-r1.ebuild b/app-emulation/wine/wine-1.7.20-r1.ebuild
index baa882c..39a57ab 100644
--- a/app-emulation/wine/wine-1.7.20-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.20-r1.ebuild
@@ -161,12 +161,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.21-r1.ebuild b/app-emulation/wine/wine-1.7.21-r1.ebuild
index 7343640..3e88454 100644
--- a/app-emulation/wine/wine-1.7.21-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.21-r1.ebuild
@@ -161,12 +161,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.22-r1.ebuild b/app-emulation/wine/wine-1.7.22-r1.ebuild
index 7343640..3e88454 100644
--- a/app-emulation/wine/wine-1.7.22-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.22-r1.ebuild
@@ -161,12 +161,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.28-r1.ebuild b/app-emulation/wine/wine-1.7.28-r1.ebuild
index 54d6481..9963e5b 100644
--- a/app-emulation/wine/wine-1.7.28-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.28-r1.ebuild
@@ -161,12 +161,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.29-r1.ebuild b/app-emulation/wine/wine-1.7.29-r1.ebuild
index 54d6481..9963e5b 100644
--- a/app-emulation/wine/wine-1.7.29-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.29-r1.ebuild
@@ -161,12 +161,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.3-r1.ebuild b/app-emulation/wine/wine-1.7.3-r1.ebuild
index 8ac9a7d..aecbaf3 100644
--- a/app-emulation/wine/wine-1.7.3-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.3-r1.ebuild
@@ -145,12 +145,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.33-r1.ebuild b/app-emulation/wine/wine-1.7.33-r1.ebuild
index f6af727..f38cb49 100644
--- a/app-emulation/wine/wine-1.7.33-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.33-r1.ebuild
@@ -163,12 +163,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.34.ebuild b/app-emulation/wine/wine-1.7.34.ebuild
index 91fbdfa..0968495 100644
--- a/app-emulation/wine/wine-1.7.34.ebuild
+++ b/app-emulation/wine/wine-1.7.34.ebuild
@@ -163,12 +163,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.35.ebuild b/app-emulation/wine/wine-1.7.35.ebuild
index 137912e..8f493b0 100644
--- a/app-emulation/wine/wine-1.7.35.ebuild
+++ b/app-emulation/wine/wine-1.7.35.ebuild
@@ -163,12 +163,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.36.ebuild b/app-emulation/wine/wine-1.7.36.ebuild
index 9c7bba6..3d79ebd 100644
--- a/app-emulation/wine/wine-1.7.36.ebuild
+++ b/app-emulation/wine/wine-1.7.36.ebuild
@@ -162,12 +162,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.37.ebuild b/app-emulation/wine/wine-1.7.37.ebuild
index 2e2c0d0..a537166 100644
--- a/app-emulation/wine/wine-1.7.37.ebuild
+++ b/app-emulation/wine/wine-1.7.37.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.38-r1.ebuild b/app-emulation/wine/wine-1.7.38-r1.ebuild
index 1ba468d..e8bff65 100644
--- a/app-emulation/wine/wine-1.7.38-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.38-r1.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.39-r1.ebuild b/app-emulation/wine/wine-1.7.39-r1.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.39-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.39-r1.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.4-r1.ebuild b/app-emulation/wine/wine-1.7.4-r1.ebuild
index 5ca4da7..e157195 100644
--- a/app-emulation/wine/wine-1.7.4-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.4-r1.ebuild
@@ -145,12 +145,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.40-r1.ebuild b/app-emulation/wine/wine-1.7.40-r1.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.40-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.40-r1.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.41.ebuild b/app-emulation/wine/wine-1.7.41.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.41.ebuild
+++ b/app-emulation/wine/wine-1.7.41.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.42.ebuild b/app-emulation/wine/wine-1.7.42.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.42.ebuild
+++ b/app-emulation/wine/wine-1.7.42.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.43.ebuild b/app-emulation/wine/wine-1.7.43.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.43.ebuild
+++ b/app-emulation/wine/wine-1.7.43.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.44.ebuild b/app-emulation/wine/wine-1.7.44.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.44.ebuild
+++ b/app-emulation/wine/wine-1.7.44.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.45.ebuild b/app-emulation/wine/wine-1.7.45.ebuild
index 8930da9..555a7d1 100644
--- a/app-emulation/wine/wine-1.7.45.ebuild
+++ b/app-emulation/wine/wine-1.7.45.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.46.ebuild b/app-emulation/wine/wine-1.7.46.ebuild
index 6fd525b..cba7501 100644
--- a/app-emulation/wine/wine-1.7.46.ebuild
+++ b/app-emulation/wine/wine-1.7.46.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.47.ebuild b/app-emulation/wine/wine-1.7.47.ebuild
index 6b89273..4f5cc8e 100644
--- a/app-emulation/wine/wine-1.7.47.ebuild
+++ b/app-emulation/wine/wine-1.7.47.ebuild
@@ -165,12 +165,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.50.ebuild b/app-emulation/wine/wine-1.7.50.ebuild
index d78c249..8a8d5c1 100644
--- a/app-emulation/wine/wine-1.7.50.ebuild
+++ b/app-emulation/wine/wine-1.7.50.ebuild
@@ -166,12 +166,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.51.ebuild b/app-emulation/wine/wine-1.7.51.ebuild
index d78c249..8a8d5c1 100644
--- a/app-emulation/wine/wine-1.7.51.ebuild
+++ b/app-emulation/wine/wine-1.7.51.ebuild
@@ -166,12 +166,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.8-r1.ebuild b/app-emulation/wine/wine-1.7.8-r1.ebuild
index 5015137..090fb1c 100644
--- a/app-emulation/wine/wine-1.7.8-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.8-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+		einfo "Checking for gcc-5 ms_abi compiler bug ..."
+		$(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+		# Run in subshell to prevent "Aborted" message
+		if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+			eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+			eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+			eerror "or use gcc-config to select a different compiler version."
+			eerror "See https://bugs.gentoo.org/549768"
+			eerror
+			return 1
+		fi
 	fi
 
 	if use abi_x86_64 && [[ $(( $(gcc-major-version) * 100 + $(gcc-minor-version) )) -lt 404 ]]; then
diff --git a/app-emulation/wine/wine-1.7.9-r1.ebuild b/app-emulation/wine/wine-1.7.9-r1.ebuild
index 5015137..090fb1c 100644
--- a/app-emulation/wine/wine-1.7.9-r1.ebuild
+++ b/app-emulation/wine/wine-1.7.9-r1.ebuild
@@ -146,12 +146,18 @@
 	[[ ${MERGE_TYPE} = "binary" ]] && return 0
 
 	# bug #549768
-	if use abi_x86_64 && [[ $(gcc-major-version) = 5 ]]; then
-		eerror "64-bit wine cannot be built with gcc-5.1 or 5.2 due to compiler bugs;"
-		eerror "you may use gcc-config to select an older compiler version."
-		eerror "See https://bugs.gentoo.org/549768"
-		eerror
-		return 1
+	if use abi_x86_64 && [[ $(gcc-major-version)