summaryrefslogtreecommitdiff
path: root/app-emulation/spice
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-emulation/spice
reinit the tree, so we can have metadata
Diffstat (limited to 'app-emulation/spice')
-rw-r--r--app-emulation/spice/Manifest14
-rw-r--r--app-emulation/spice/files/README.gentoo7
-rw-r--r--app-emulation/spice/files/spice-0.13.3-reds-Avoid-buffer-overflows-handling-monitor-configu.patch47
-rw-r--r--app-emulation/spice/files/spice-0.13.3-reds-Avoid-integer-overflows-handling-monitor-config.patch30
-rw-r--r--app-emulation/spice/files/spice-0.13.3-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch75
-rw-r--r--app-emulation/spice/files/spice-0.13.3-skip_faulty_lz4_check.patch13
-rw-r--r--app-emulation/spice/metadata.xml12
-rw-r--r--app-emulation/spice/spice-0.13.3-r1.ebuild101
-rw-r--r--app-emulation/spice/spice-0.13.3-r2.ebuild104
-rw-r--r--app-emulation/spice/spice-0.13.90.ebuild97
-rw-r--r--app-emulation/spice/spice-9999.ebuild98
11 files changed, 598 insertions, 0 deletions
diff --git a/app-emulation/spice/Manifest b/app-emulation/spice/Manifest
new file mode 100644
index 000000000000..77e8e39df4f5
--- /dev/null
+++ b/app-emulation/spice/Manifest
@@ -0,0 +1,14 @@
+AUX README.gentoo 270 SHA256 19bb3ed1918e6207c4a6ff695fe112787354f067f49057e65eae4b77fb036cf4 SHA512 9202046d629d12eee0435bb0ee8bafc1d8a0b52784275a7b3989fd430de8ed0ec2e59cfdf963a58494a05296a55bc99fe7095e661398182d62286e8816895dd1 WHIRLPOOL f56f353b153d00f4b4ad83b6f9ee9ce53afba441520377c6448a7b220b63ecdce35655df4cda4d226622121767b99865b86d9a81fd1a92e37ee1301cc1421051
+AUX spice-0.13.3-reds-Avoid-buffer-overflows-handling-monitor-configu.patch 1902 SHA256 273bae3b8ae4dc6cc3eff632d23debeb85d5dbe63e03cf6e79ba53e9213557e9 SHA512 c2091c688158291a87aa834125083dc8572faadaf43f05f68721b3f9bde40eda232793e720fafe9ece93aa7287e5e1fc3e4fd7a7ec30130c2e9af0b9297c9e14 WHIRLPOOL 6206902c07d38f7244ab7d763dee3f14fdcbc912a17fd9f416f04ee04f3918444b38486af49a5af7d2bf09da796beb8a374c7c53eefdc093525b2acb92f458f6
+AUX spice-0.13.3-reds-Avoid-integer-overflows-handling-monitor-config.patch 1022 SHA256 289a5c0974477860ca290bcc30c250aecba1bc8a1d292fae5148c38dcb798096 SHA512 4f815f091c0eec1ccfaa3438390087d4b7390e3ea84e353e42638a850e0faa552077af443719f2015ce36375ac2ac400721677462a2739ecf05fdf8c2e778b41 WHIRLPOOL 5f2e80a8c8d7dc6550bc13671bb8aae21f8d2b63c21d77ac13e465d39094c3bf0f3e5ed167898ac46ee881e3a3c713a94661cffb81e4a19755eff143c20f4164
+AUX spice-0.13.3-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch 2988 SHA256 1bd1088f245cb0bf226cae2ed1b43fdb661906d514769b47f85a941231e0305e SHA512 ee15a37c45527869415d301968857f47a4536462bcea6fb5608862fa7019b2eeba36d08563b74feb7a96bc565dd6fe09349c736c4677d43c1f13fc95f1c42c06 WHIRLPOOL 39be2806ad73dc6a8435df19026e0c59423d03a93db4e06ab0857147503dee787d177427eacf9ecf98619d1ccf6ec6386afd516eb6a36d1acf3e580ce840334e
+AUX spice-0.13.3-skip_faulty_lz4_check.patch 566 SHA256 ab6077b3751b5544535a3688f721302e3701f6a52df969f978932aa40d1423bf SHA512 aa16b86446f42a08c5d76927090e6b01817308520b34affcdd28a9e89d70d344f5ce47d1600c5cc564ecdf428cbfe8cf456ce8d3ccf4e686bd0cfb2f9fe5fe33 WHIRLPOOL 7d55cefb97a9c1b486b0011bfed2d582153f12bc3a4040539d90ef43d5973d94b603d9e4ca1fc21a367262a6df3a701aecc2e696d09d9870975511f2d4bd1add
+DIST spice-0.13.3.tar.bz2 1322505 SHA256 30f710c0e7594e05b6b9cc702be748a69f910a95192ab851d748c256157fb89e SHA512 63496fbd3df0fd453052cef8e1fb00a3a28f0105610676fdc4a58043cbc6da571ae4407701af2b817e410d05ce727d60d5ee0c93c8897231e25229897c51d95a WHIRLPOOL 16bb08301d66c1f21f612f5be87ba1ffef7132f3c18ac3ab7feec21e16de61461648311d04f6990254d4c47ee7a6d39f4c33f122e941e5a3fc0c2ed289dd928b
+DIST spice-0.13.90.tar.bz2 1364173 SHA256 c6293cac25e97001e00538bb368658cd6aba1e7e3fd5e1bfa8c8f237e99bca17 SHA512 a5a6ab328a2d3cb405ead6eef40a1b896432f35accf1f8b015fc9deadcc4e5eb5f6d8d575a94fa3b2505e206986887badecf721ab015efd88dad174d7340c01c WHIRLPOOL d7d799b33be605d5907d88c37d7566b98e28fc687c22409fd39729cc1cbda9906d600b2379f695d923d01048242eb6b239ecd774d3d2a9fd69c4b7eb0916b815
+EBUILD spice-0.13.3-r1.ebuild 2451 SHA256 eee8fbb088bd132a6ed0652f37fba9d0df7aeb9d1144ec5bb356f9f56aba998e SHA512 b90782d1801de0c40e93d4eac8de6108a42c4191d39746c7cd27854546725d03deccd664ec9a72cf2143bd6b4ab01ae825fa24b8e22d0fe9adbe5608aef53894 WHIRLPOOL 6c1711f74530adff35b74aa6b3ee3fdd9652c5b5ef9bdd63ba5f17952800f7e0df6d8f61f59e050db3d74c99f33d7ca29d366694dcec380e0505f121563e7344
+EBUILD spice-0.13.3-r2.ebuild 2712 SHA256 ffee510e5b86c61014cc7e488c5a7dca0cdd22e3486fe32db4ab9a6c6d7cc90b SHA512 d0cbb81eaaacdf131c914b83ef42071e3f373d1154b0d3c530db6d4ff39c44f814e5a20c3ba2182bbf3cea3598cab1f6e7201ca74377cadb710808554a4f3228 WHIRLPOOL d99036e88bbf599f1c1b15add3c6947ffaecd563d80683bde83e5fe7e5bff58b7ed15242cf45aad9f2fa2d8e1fbd3c349a381d710d17f75952ca8ea5be006819
+EBUILD spice-0.13.90.ebuild 2384 SHA256 0bf136129d1d7945d22f9bf589dfafcbaac1aadee1b625070790409192437020 SHA512 60a13e6974938a603d082f76c54f062a8109be23787430baa9cd557b5d4ccf1f363fe73a1e233976caf1be1a1961cba45a09f520f4a725774feaf5980ac940ba WHIRLPOOL 3ecca36a36c06c19ee29061a8f9079a5efd2cf2e69daa48ccebec82284b17e762c22c6a934b1dd72022b9368f8d5df30a4c83ec393ef01ff9982c3f44b095a29
+EBUILD spice-9999.ebuild 2386 SHA256 bdf7268f6b4a3556b5fc5f7aacf0424efb49fb99183473bc3c37920af6ed3198 SHA512 e9c217c888229996b61a6fd38c0769fe5fc579117b0f2f54f07d44d45d720d4a1bd7a1c6b8145f01d7aa99c03aa88ac2a5edd1c44ff6a4bd17fd0950eb29397f WHIRLPOOL b23518c8e6c13fc381a7e805fce932b0aa5d0cfe57f2f0bf9b6574b3f983a5768af6b8dadb24e9abeb86693277b352ce572dd6130777150219cb9c756faacb59
+MISC ChangeLog 11884 SHA256 97e782ea60e4e3c73a5075bcc6265ce048b5465ec8f7fa8fb8cd3210ece98db7 SHA512 ccbfa0a73c0a2e677dc43126b11c820756f9da6b486ed927c8791b826e52f25b0e3af7fff2aca2975d775ee61d9e285f68377875f6c0c709e1381c906eee3c12 WHIRLPOOL 4f5116466eace15922cb78bfef0aa566ac68c4792ca4b1ebb2b1788bef58722bf6f2fbec6c060144bd723b22f80a5e13d53448b88ce6c648b5280e9427c0666f
+MISC ChangeLog-2015 11333 SHA256 06046dca615aad09da9fc3ee0ac48f77b6004ec2af2942209535bad890cd0532 SHA512 b161432fa57d4d6dbeaa281b213c679518e73b0df1074435c9d2e7d56bae7abd8a889b4a61cd9a0e55f57baace6a63a4f6d232c0768481eda351eb5c2784b5a2 WHIRLPOOL 4aa7e48ab7e741d6a73d28855fc252b47742cb095afbfb2a90fdd6856de7132c9487234f254fe8dd873ab84c1af636f51e25261e3ef69689f06e97d9908010a3
+MISC metadata.xml 476 SHA256 68e31c99eddc0bd582c10f7f6c244ff52b51b06cca166661f75eaafbd072a009 SHA512 3ae95b689c812e19679cb9a9db2f0811077a4eb205cadf4baeb78a2ddfeb7fc0086e2514540fad59e447bbca6c9dba81001a8ff156a1d18ba2d58171ba301f9b WHIRLPOOL ed8c55c858f4c0ec3967f12a51dd56bc8179db5fbae20f9092b9b19b538f0d2f9c8d31d289063885449282377925dee6b1d866530bee8aaa193a5fdd42f9c746
diff --git a/app-emulation/spice/files/README.gentoo b/app-emulation/spice/files/README.gentoo
new file mode 100644
index 000000000000..1920ea69303b
--- /dev/null
+++ b/app-emulation/spice/files/README.gentoo
@@ -0,0 +1,7 @@
+
+If you choose to enable the video streaming support of gstreamer,
+please try to install addtional gst-plugins which matching the video codecs
+
+ mjpeg media-plugins/gst-plugins-libav:1.0
+ vpx media-plugins/gst-plugins-vpx:1.0
+ x264 media-plugins/gst-plugins-x264:1.0
diff --git a/app-emulation/spice/files/spice-0.13.3-reds-Avoid-buffer-overflows-handling-monitor-configu.patch b/app-emulation/spice/files/spice-0.13.3-reds-Avoid-buffer-overflows-handling-monitor-configu.patch
new file mode 100644
index 000000000000..8792395977e9
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.13.3-reds-Avoid-buffer-overflows-handling-monitor-configu.patch
@@ -0,0 +1,47 @@
+Matthias Maier <tamiko@gentoo.org>
+
+ - Ported to 0.13.3
+
+
+From fbbcdad773e2791cfb988f4748faa41943551ca6 Mon Sep 17 00:00:00 2001
+From: Frediano Ziglio <fziglio@redhat.com>
+Date: Mon, 15 May 2017 15:57:28 +0100
+Subject: [PATCH 3/3] reds: Avoid buffer overflows handling monitor
+ configuration
+
+It was also possible for a malicious client to set
+VDAgentMonitorsConfig::num_of_monitors to a number larger
+than the actual size of VDAgentMOnitorsConfig::monitors.
+This would lead to buffer overflows, which could allow the guest to
+read part of the host memory. This might cause write overflows in the
+host as well, but controlling the content of such buffers seems
+complicated.
+
+Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
+---
+
+diff --git a/server/reds.c b/server/reds.c
+index ec89105..fd1457f 100644
+--- a/server/reds.c
++++ b/server/reds.c
+@@ -1084,6 +1084,7 @@ static void reds_on_main_agent_monitors_config(RedsState *reds,
+ VDAgentMessage *msg_header;
+ VDAgentMonitorsConfig *monitors_config;
+ RedsClientMonitorsConfig *cmc = &reds->client_monitors_config;
++ uint32_t max_monitors;
+
+ // limit size of message sent by the client as this can cause a DoS through
+ // memory exhaustion, or potentially some integer overflows
+@@ -1113,6 +1114,12 @@ static void reds_on_main_agent_monitors_config(RedsState *reds,
+ goto overflow;
+ }
+ monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header));
++ // limit the monitor number to avoid buffer overflows
++ max_monitors = (msg_header->size - sizeof(VDAgentMonitorsConfig)) /
++ sizeof(VDAgentMonConfig);
++ if (monitors_config->num_of_monitors > max_monitors) {
++ goto overflow;
++ }
+ spice_debug("%s: %d", __func__, monitors_config->num_of_monitors);
+ reds_client_monitors_config(reds, monitors_config);
+ reds_client_monitors_config_cleanup(reds);
diff --git a/app-emulation/spice/files/spice-0.13.3-reds-Avoid-integer-overflows-handling-monitor-config.patch b/app-emulation/spice/files/spice-0.13.3-reds-Avoid-integer-overflows-handling-monitor-config.patch
new file mode 100644
index 000000000000..f05e55c7354a
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.13.3-reds-Avoid-integer-overflows-handling-monitor-config.patch
@@ -0,0 +1,30 @@
+From 571cec91e71c2aae0d5f439ea2d8439d0c3d75eb Mon Sep 17 00:00:00 2001
+From: Frediano Ziglio <fziglio@redhat.com>
+Date: Mon, 15 May 2017 15:57:28 +0100
+Subject: [PATCH 2/3] reds: Avoid integer overflows handling monitor
+ configuration
+
+Avoid VDAgentMessage::size integer overflows.
+
+Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
+---
+ server/reds.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/server/reds.c b/server/reds.c
+index ec2b6f47..656f518f 100644
+--- a/server/reds.c
++++ b/server/reds.c
+@@ -1131,6 +1131,9 @@ static void reds_on_main_agent_monitors_config(RedsState *reds,
+ spice_debug("not enough data yet. %zd", cmc->offset);
+ return;
+ }
++ if (msg_header->size < sizeof(VDAgentMonitorsConfig)) {
++ goto overflow;
++ }
+ monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header));
+ spice_debug("monitors_config->num_of_monitors: %d", monitors_config->num_of_monitors);
+ reds_client_monitors_config(reds, monitors_config);
+--
+2.13.0
+
diff --git a/app-emulation/spice/files/spice-0.13.3-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch b/app-emulation/spice/files/spice-0.13.3-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch
new file mode 100644
index 000000000000..2cd186482ad9
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.13.3-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch
@@ -0,0 +1,75 @@
+Matthias Maier <tamiko@gentoo.org>
+
+ - Ported to 0.13.3
+
+
+From 111ab38611cef5012f1565a65fa2d8a8a05cce37 Mon Sep 17 00:00:00 2001
+From: Frediano Ziglio <fziglio@redhat.com>
+Date: Mon, 15 May 2017 15:57:28 +0100
+Subject: [PATCH 1/3] reds: Disconnect when receiving overly big
+ ClientMonitorsConfig
+
+Total message size received from the client was unlimited. There is
+a 2kiB size check on individual agent messages, but the MonitorsConfig
+message can be split in multiple chunks, and the size of the
+non-chunked MonitorsConfig message was never checked. This could easily
+lead to memory exhaustion on the host.
+
+Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
+---
+
+diff --git a/server/reds.c b/server/reds.c
+index 92feea1..286993b 100644
+--- a/server/reds.c
++++ b/server/reds.c
+@@ -1077,19 +1077,35 @@ static void reds_client_monitors_config_cleanup(RedsState *reds)
+ static void reds_on_main_agent_monitors_config(RedsState *reds,
+ MainChannelClient *mcc, void *message, size_t size)
+ {
++ const unsigned int MAX_MONITORS = 256;
++ const unsigned int MAX_MONITOR_CONFIG_SIZE =
++ sizeof(VDAgentMonitorsConfig) + MAX_MONITORS * sizeof(VDAgentMonConfig);
++
+ VDAgentMessage *msg_header;
+ VDAgentMonitorsConfig *monitors_config;
+ RedsClientMonitorsConfig *cmc = &reds->client_monitors_config;
+
++ // limit size of message sent by the client as this can cause a DoS through
++ // memory exhaustion, or potentially some integer overflows
++ if (sizeof(VDAgentMessage) + MAX_MONITOR_CONFIG_SIZE - cmc->buffer_size < size) {
++ goto overflow;
++ }
++
+ cmc->buffer_size += size;
+ cmc->buffer = realloc(cmc->buffer, cmc->buffer_size);
+ spice_assert(cmc->buffer);
+ cmc->mcc = mcc;
+ memcpy(cmc->buffer + cmc->buffer_pos, message, size);
+ cmc->buffer_pos += size;
++ if (sizeof(VDAgentMessage) > cmc->buffer_size) {
++ spice_debug("not enough data yet. %d", cmc->buffer_size);
++ return;
++ }
+ msg_header = (VDAgentMessage *)cmc->buffer;
+- if (sizeof(VDAgentMessage) > cmc->buffer_size ||
+- msg_header->size > cmc->buffer_size - sizeof(VDAgentMessage)) {
++ if (msg_header->size > MAX_MONITOR_CONFIG_SIZE) {
++ goto overflow;
++ }
++ if (msg_header->size > cmc->buffer_size - sizeof(VDAgentMessage)) {
+ spice_debug("not enough data yet. %d", cmc->buffer_size);
+ return;
+ }
+@@ -1097,6 +1113,12 @@ static void reds_on_main_agent_monitors_config(RedsState *reds,
+ spice_debug("%s: %d", __func__, monitors_config->num_of_monitors);
+ reds_client_monitors_config(reds, monitors_config);
+ reds_client_monitors_config_cleanup(reds);
++ return;
++
++overflow:
++ spice_warning("received invalid MonitorsConfig request from client, disconnecting");
++ red_channel_client_disconnect(RED_CHANNEL_CLIENT(mcc));
++ reds_client_monitors_config_cleanup(reds);
+ }
+
+ void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, void *message, size_t size)
diff --git a/app-emulation/spice/files/spice-0.13.3-skip_faulty_lz4_check.patch b/app-emulation/spice/files/spice-0.13.3-skip_faulty_lz4_check.patch
new file mode 100644
index 000000000000..6ae65ba6d13c
--- /dev/null
+++ b/app-emulation/spice/files/spice-0.13.3-skip_faulty_lz4_check.patch
@@ -0,0 +1,13 @@
+diff --git a/spice-common/m4/spice-deps.m4 b/spice-common/m4/spice-deps.m4
+index adedec4..6cb8bde 100644
+--- a/spice-common/m4/spice-deps.m4
++++ b/spice-common/m4/spice-deps.m4
+@@ -185,7 +185,7 @@ AC_DEFUN([SPICE_CHECK_LZ4], [
+
+ have_lz4="no"
+ if test "x$enable_lz4" != "xno"; then
+- PKG_CHECK_MODULES([LZ4], [liblz4 >= 129], [have_lz4="yes"], [have_lz4="no"])
++ PKG_CHECK_MODULES([LZ4], [liblz4], [have_lz4="yes"], [have_lz4="no"])
+
+ if test "x$have_lz4" = "xyes"; then
+ AC_DEFINE(USE_LZ4, [1], [Define to build with lz4 support])
diff --git a/app-emulation/spice/metadata.xml b/app-emulation/spice/metadata.xml
new file mode 100644
index 000000000000..0f32fa2a88cf
--- /dev/null
+++ b/app-emulation/spice/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>virtualization@gentoo.org</email>
+ <name>Gentoo Virtualization Project</name>
+ </maintainer>
+ <use>
+ <flag name="lz4">Enable support for LZ4 compression using <pkg>app-arch/lz4</pkg></flag>
+ <flag name="smartcard">Enable smartcard remoting using <pkg>app-emulation/libcacard</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/app-emulation/spice/spice-0.13.3-r1.ebuild b/app-emulation/spice/spice-0.13.3-r1.ebuild
new file mode 100644
index 000000000000..dc73931f4f1d
--- /dev/null
+++ b/app-emulation/spice/spice-0.13.3-r1.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit autotools ltprune python-any-r1 readme.gentoo-r1 xdg-utils
+
+DESCRIPTION="SPICE server"
+HOMEPAGE="https://www.spice-space.org/"
+SRC_URI="https://www.spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86"
+IUSE="libressl lz4 sasl smartcard static-libs gstreamer"
+
+# the libspice-server only uses the headers of libcacard
+RDEPEND="
+ >=dev-libs/glib-2.22:2[static-libs(+)?]
+ >=media-libs/celt-0.5.1.1:0.5.1[static-libs(+)?]
+ media-libs/opus[static-libs(+)?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/jpeg:0=[static-libs(+)?]
+ >=x11-libs/pixman-0.17.7[static-libs(+)?]
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)?] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)?] )
+ lz4? ( app-arch/lz4:0=[static-libs(+)?] )
+ smartcard? ( >=app-emulation/libcacard-0.1.2 )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ >=app-emulation/spice-protocol-0.12.12
+ virtual/pkgconfig
+ $(python_gen_any_dep '
+ >=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ ')
+ smartcard? ( app-emulation/qemu[smartcard] )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.13.3-skip_faulty_lz4_check.patch
+)
+
+python_check_deps() {
+ has_version ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
+ has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ xdg_environment_reset
+
+ local myconf="
+ $(use_enable static-libs static)
+ $(use_enable lz4)
+ $(use_with sasl)
+ $(use_enable smartcard)
+ --enable-gstreamer=$(usex gstreamer "1.0" "no")
+ --enable-celt051
+ --disable-gui
+ "
+ econf ${myconf}
+}
+
+src_compile() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ default
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/spice/spice-0.13.3-r2.ebuild b/app-emulation/spice/spice-0.13.3-r2.ebuild
new file mode 100644
index 000000000000..557c17470c39
--- /dev/null
+++ b/app-emulation/spice/spice-0.13.3-r2.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit autotools ltprune python-any-r1 readme.gentoo-r1 xdg-utils
+
+DESCRIPTION="SPICE server"
+HOMEPAGE="https://www.spice-space.org/"
+SRC_URI="https://www.spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86"
+IUSE="libressl lz4 sasl smartcard static-libs gstreamer"
+
+# the libspice-server only uses the headers of libcacard
+RDEPEND="
+ >=dev-libs/glib-2.22:2[static-libs(+)?]
+ >=media-libs/celt-0.5.1.1:0.5.1[static-libs(+)?]
+ media-libs/opus[static-libs(+)?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/jpeg:0=[static-libs(+)?]
+ >=x11-libs/pixman-0.17.7[static-libs(+)?]
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)?] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)?] )
+ lz4? ( app-arch/lz4:0=[static-libs(+)?] )
+ smartcard? ( >=app-emulation/libcacard-0.1.2 )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ >=app-emulation/spice-protocol-0.12.12
+ virtual/pkgconfig
+ $(python_gen_any_dep '
+ >=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ ')
+ smartcard? ( app-emulation/qemu[smartcard] )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.13.3-skip_faulty_lz4_check.patch
+ "${FILESDIR}"/${PN}-0.13.3-reds-Disconnect-when-receiving-overly-big-ClientMoni.patch
+ "${FILESDIR}"/${PN}-0.13.3-reds-Avoid-integer-overflows-handling-monitor-config.patch
+ "${FILESDIR}"/${PN}-0.13.3-reds-Avoid-buffer-overflows-handling-monitor-configu.patch
+)
+
+python_check_deps() {
+ has_version ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
+ has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ xdg_environment_reset
+
+ local myconf="
+ $(use_enable static-libs static)
+ $(use_enable lz4)
+ $(use_with sasl)
+ $(use_enable smartcard)
+ --enable-gstreamer=$(usex gstreamer "1.0" "no")
+ --enable-celt051
+ --disable-gui
+ "
+ econf ${myconf}
+}
+
+src_compile() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ default
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/spice/spice-0.13.90.ebuild b/app-emulation/spice/spice-0.13.90.ebuild
new file mode 100644
index 000000000000..abf7a28a67bb
--- /dev/null
+++ b/app-emulation/spice/spice-0.13.90.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit autotools ltprune python-any-r1 readme.gentoo-r1 xdg-utils
+
+DESCRIPTION="SPICE server"
+HOMEPAGE="https://www.spice-space.org/"
+SRC_URI="https://www.spice-space.org/download/releases/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="libressl lz4 sasl smartcard static-libs gstreamer"
+
+# the libspice-server only uses the headers of libcacard
+RDEPEND="
+ >=dev-libs/glib-2.22:2[static-libs(+)?]
+ >=media-libs/celt-0.5.1.1:0.5.1[static-libs(+)?]
+ media-libs/opus[static-libs(+)?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/jpeg:0=[static-libs(+)?]
+ >=x11-libs/pixman-0.17.7[static-libs(+)?]
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)?] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)?] )
+ lz4? ( app-arch/lz4:0=[static-libs(+)?] )
+ smartcard? ( >=app-emulation/libcacard-0.1.2 )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ >=app-emulation/spice-protocol-0.12.12
+ virtual/pkgconfig
+ $(python_gen_any_dep '
+ >=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ ')
+ smartcard? ( app-emulation/qemu[smartcard] )"
+
+python_check_deps() {
+ has_version ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
+ has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ xdg_environment_reset
+
+ local myconf="
+ $(use_enable static-libs static)
+ $(use_enable lz4)
+ $(use_with sasl)
+ $(use_enable smartcard)
+ --enable-gstreamer=$(usex gstreamer "1.0" "no")
+ --enable-celt051
+ --disable-gui
+ "
+ econf ${myconf}
+}
+
+src_compile() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ default
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/app-emulation/spice/spice-9999.ebuild b/app-emulation/spice/spice-9999.ebuild
new file mode 100644
index 000000000000..bc7a3036722a
--- /dev/null
+++ b/app-emulation/spice/spice-9999.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit autotools eutils git-r3 ltprune python-any-r1 readme.gentoo-r1 xdg-utils
+
+DESCRIPTION="SPICE server"
+HOMEPAGE="https://www.spice-space.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://anongit.freedesktop.org/git/spice/spice.git"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS=""
+IUSE="libressl lz4 sasl smartcard static-libs gstreamer"
+
+# the libspice-server only uses the headers of libcacard
+RDEPEND="
+ >=dev-libs/glib-2.22:2[static-libs(+)?]
+ >=media-libs/celt-0.5.1.1:0.5.1[static-libs(+)?]
+ media-libs/opus[static-libs(+)?]
+ sys-libs/zlib[static-libs(+)?]
+ virtual/jpeg:0=[static-libs(+)?]
+ >=x11-libs/pixman-0.17.7[static-libs(+)?]
+ !libressl? ( dev-libs/openssl:0=[static-libs(+)?] )
+ libressl? ( dev-libs/libressl:0=[static-libs(+)?] )
+ lz4? ( app-arch/lz4:0=[static-libs(+)?] )
+ smartcard? ( >=app-emulation/libcacard-0.1.2 )
+ sasl? ( dev-libs/cyrus-sasl[static-libs(+)?] )
+ gstreamer? (
+ media-libs/gstreamer:1.0
+ media-libs/gst-plugins-base:1.0
+ )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ =app-emulation/spice-protocol-9999
+ virtual/pkgconfig
+ $(python_gen_any_dep '
+ >=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]
+ dev-python/six[${PYTHON_USEDEP}]
+ ')
+ smartcard? ( app-emulation/qemu[smartcard] )"
+
+python_check_deps() {
+ has_version ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
+ has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ xdg_environment_reset
+
+ local myconf="
+ $(use_enable static-libs static)
+ $(use_enable lz4)
+ $(use_with sasl)
+ $(use_enable smartcard)
+ --enable-gstreamer=$(usex gstreamer "1.0" "no")
+ --enable-celt051
+ --disable-gui
+ "
+ econf ${myconf}
+}
+
+src_compile() {
+ # Prevent sandbox violations, bug #586560
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744134
+ # https://bugzilla.gnome.org/show_bug.cgi?id=744135
+ addpredict /dev
+
+ default
+}
+
+src_install() {
+ default
+ use static-libs || prune_libtool_files
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}