diff options
author | Tiziano Müller <dev-zero@gentoo.org> | 2011-01-05 13:14:18 +0000 |
---|---|---|
committer | Tiziano Müller <dev-zero@gentoo.org> | 2011-01-05 13:14:18 +0000 |
commit | 2fb5e561a3b9a971503860665b8172c08b3198ac (patch) | |
tree | 3f8ccbfa90378f6008f6b54b150a51c040d2d4a6 /app-emulation/spice | |
parent | restore ~alpha and ~ppc64 keywords (diff) | |
download | historical-2fb5e561a3b9a971503860665b8172c08b3198ac.tar.gz historical-2fb5e561a3b9a971503860665b8172c08b3198ac.tar.bz2 historical-2fb5e561a3b9a971503860665b8172c08b3198ac.zip |
Added uri handling patch.
Package-Manager: portage-2.1.9.26/cvs/Linux x86_64
Diffstat (limited to 'app-emulation/spice')
-rw-r--r-- | app-emulation/spice/Manifest | 5 | ||||
-rw-r--r-- | app-emulation/spice/files/0001-Added-initial-connection-url-handling-using-the-urip.patch | 158 | ||||
-rw-r--r-- | app-emulation/spice/metadata.xml | 3 | ||||
-rw-r--r-- | app-emulation/spice/spice-0.7.1.ebuild | 48 |
4 files changed, 208 insertions, 6 deletions
diff --git a/app-emulation/spice/Manifest b/app-emulation/spice/Manifest index de9f46d1a1d9..16e75f849a2a 100644 --- a/app-emulation/spice/Manifest +++ b/app-emulation/spice/Manifest @@ -1,8 +1,9 @@ +AUX 0001-Added-initial-connection-url-handling-using-the-urip.patch 5924 RMD160 7a1b8ecec21f3be3941bd302881f7a7b0d95971e SHA1 0c5e10679378428ec0b2ed33c76d943cf6b61488 SHA256 440b64fbdad24484fabee2ac39aba555ef954989e53e21bdd41b2c024d0bf212 DIST spice-0.5.3.tar.bz2 1187585 RMD160 e4cd8750c548188a76c2ef77e71b61fb0004567b SHA1 17d2a4a1547d69be9c9992e7058898dd0a53d646 SHA256 a1bdb2d731c5dbbf2582e1a88de4042b1199911172c8f178d912c375178306f2 DIST spice-0.6.3.tar.bz2 1212086 RMD160 6574495568af8e78a374eec88288162def08b52d SHA1 bf4fc209404072cc9a35bb5f920c91ce04b96b74 SHA256 1e43ab34d39ba54c9ee30e788caeae56ead968090dd7b2a59b4af72df45e3310 DIST spice-0.7.1.tar.bz2 1194659 RMD160 78dba1b4b0f5ccb173bd9024816975c011ce4c1f SHA1 e1167461472f201aec89b166c43e0dc3290eae8d SHA256 ee396c46cb1933f967fd03b67ac150b3d5f0caeb29dd179d81542b5f3fe85fb5 EBUILD spice-0.5.3.ebuild 1106 RMD160 a15a186d5ede086243b1c13a835419fc65146e0d SHA1 716a1ab3ec49d6334678455d7d484f3bec74be04 SHA256 8a95095cc20ecb17ae461f4c1e9e98f961d8f71fc9136a89d00e41f30cf5dbc8 EBUILD spice-0.6.3.ebuild 1100 RMD160 df8bd9e16653448da8bcf6785717836bbf70b3ea SHA1 e951714fd4e5dd0fc2a0e4e8f8e3556631d3072a SHA256 89c2a74d49dfcf8494eee92dda5760e7ff3a02d6958ff3e477063f65a48d9c6b -EBUILD spice-0.7.1.ebuild 1107 RMD160 e7b4417f0c365e798ce02194e108ef641bc6ae92 SHA1 89bca3d328e4de378f5bf13fda5178e9fb0c015c SHA256 d0a92d4e89253eb982f55f02738bea0209b19027fa7e3ff08026b773d9c75643 +EBUILD spice-0.7.1.ebuild 2123 RMD160 a7afb3b1b37cc5b3a09f2c95a43ed4a4c7b55307 SHA1 5ba485e660bb9a06a9ef4d61e84ed0e2489f2b48 SHA256 be2cada6f69d41495d6ec021c1fe34710c163877e462a35fd82364c45559b355 MISC ChangeLog 1125 RMD160 3787d066d8579d8c4bc077e3aa2b1ae4fc524cfb SHA1 571b3541304f9a9555da41d806095d58a1986180 SHA256 c4ed3db04f8487030884c0135376f8527784b47122bea1bbae6afbcc889c7cd1 -MISC metadata.xml 362 RMD160 fa76aaae634a6de60e65ec65c161581f94ad1ec8 SHA1 59e62bfe42e590fe2c14d16bf72fc53da754c9bc SHA256 393bbd9bd6e028ed393cbaec1c4784c7fb9f25f4c685fe99a49e122721b2b505 +MISC metadata.xml 591 RMD160 48a1a51f8ab4050e84f580fb7f8828fbb94338ef SHA1 a2ca907b208b449bbd2366668942c1a3e4965453 SHA256 5b25bdfca5600ec80f91d11db75a2d1c9635d305d574e5ca2992124858ca4b60 diff --git a/app-emulation/spice/files/0001-Added-initial-connection-url-handling-using-the-urip.patch b/app-emulation/spice/files/0001-Added-initial-connection-url-handling-using-the-urip.patch new file mode 100644 index 000000000000..36ab8fc6c45f --- /dev/null +++ b/app-emulation/spice/files/0001-Added-initial-connection-url-handling-using-the-urip.patch @@ -0,0 +1,158 @@ +From d885244f70bff899b58f81eb4be76d7da3869706 Mon Sep 17 00:00:00 2001 +From: Tiziano Mueller <dev-zero@gentoo.org> +Date: Fri, 24 Dec 2010 13:23:23 +0100 +Subject: [PATCH] Added initial connection url handling using the uriparser library for + proper URI parsing and handling. Can handle port, tls-port and password + for now. + +--- + client/application.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ + client/application.h | 1 + + configure.ac | 19 +++++++++++++++ + 3 files changed, 81 insertions(+), 0 deletions(-) + +diff --git a/client/application.cpp b/client/application.cpp +index d865e84..a9e86d1 100644 +--- a/client/application.cpp ++++ b/client/application.cpp +@@ -53,6 +53,8 @@ + #include <smartcard_channel.h> + #endif + ++#include <uriparser/Uri.h> ++ + #define STICKY_KEY_PIXMAP ALT_IMAGE_RES_ID + #define STICKY_KEY_TIMEOUT 750 + +@@ -2130,6 +2132,56 @@ bool Application::set_disabled_display_effects(CmdLineParser& parser, char *val, + return true; + } + ++bool Application::parse_connection_uri(const char* uri, std::string& host, int& port, int& sport, std::string& password) ++{ ++ UriParserStateA state; ++ UriUriA uri_object; ++ ++ state.uri = &uri_object; ++ ++ if (uriParseUriA(&state, uri) != URI_SUCCESS) { ++ uriFreeUriMembersA(&uri_object); ++ return false; ++ } ++ ++ if ((uri_object.scheme.afterLast != uri_object.scheme.first + 5) || ++ (strncmp(uri_object.scheme.first, "spice", 5) != 0)) { ++ uriFreeUriMembersA(&uri_object); ++ return false; ++ } ++ ++ host.assign(uri_object.hostText.first, uri_object.hostText.afterLast); ++ ++ UriQueryListA* queryList; ++ int itemCount; ++ ++ if (uriDissectQueryMallocA(&queryList, &itemCount, ++ uri_object.query.first, uri_object.query.afterLast) != URI_SUCCESS) { ++ uriFreeUriMembersA(&uri_object); ++ return false; ++ } ++ ++ for (UriQueryListA* i(queryList); i != NULL; i = i->next) { ++ if ((strcmp(i->key, "port") == 0) && (i->value != NULL)) { ++ port = str_to_port(i->value); ++ continue; ++ } ++ if ((strcmp(i->key, "tls-port") == 0) && (i->value != NULL)) { ++ sport = str_to_port(i->value); ++ continue; ++ } ++ if ((strcmp(i->key, "password") == 0) && (i->value != NULL)) { ++ password = i->value; ++ continue; ++ } ++ /* ignore all other parameters for now */ ++ } ++ ++ uriFreeQueryListA(queryList); ++ uriFreeUriMembersA(&uri_object); ++ return true; ++} ++ + void Application::on_cmd_line_invalid_arg(const char* arg0, const char* what, const char* val) + { + Platform::term_printf("%s: invalid %s value %s\n", arg0, what, val); +@@ -2185,6 +2237,7 @@ bool Application::process_cmd_line(int argc, char** argv) + SPICE_OPT_HOST = CmdLineParser::OPTION_FIRST_AVILABLE, + SPICE_OPT_PORT, + SPICE_OPT_SPORT, ++ SPICE_OPT_URI, + SPICE_OPT_PASSWORD, + SPICE_OPT_FULL_SCREEN, + SPICE_OPT_SECURE_CHANNELS, +@@ -2225,6 +2278,7 @@ bool Application::process_cmd_line(int argc, char** argv) + parser.add(SPICE_OPT_HOST, "host", "spice server address", "host", true, 'h'); + parser.add(SPICE_OPT_PORT, "port", "spice server port", "port", true, 'p'); + parser.add(SPICE_OPT_SPORT, "secure-port", "spice server secure port", "port", true, 's'); ++ parser.add(SPICE_OPT_URI, "uri", "spice uri", "uri", true); + parser.add(SPICE_OPT_SECURE_CHANNELS, "secure-channels", + "force secure connection on the specified channels", "channel", + true); +@@ -2301,6 +2355,13 @@ bool Application::process_cmd_line(int argc, char** argv) + } + break; + } ++ case SPICE_OPT_URI: { ++ if (parse_connection_uri(val, host, port, sport, password) == false) { ++ on_cmd_line_invalid_arg(argv[0], "uri", val); ++ return false; ++ } ++ break; ++ } + case SPICE_OPT_FULL_SCREEN: + if (val) { + if (strcmp(val, "auto-conf")) { +diff --git a/client/application.h b/client/application.h +index f9bbd53..f6ec524 100644 +--- a/client/application.h ++++ b/client/application.h +@@ -289,6 +289,7 @@ private: + bool set_canvas_option(CmdLineParser& parser, char *val, const char* arg0); + bool set_disabled_display_effects(CmdLineParser& parser, char *val, const char* arg0, + DisplaySetting& disp_setting); ++ bool parse_connection_uri(const char* uri, std::string& host, int& port, int& sport, std::string& password); + void on_cmd_line_invalid_arg(const char* arg0, const char* what, const char* val); + bool process_cmd_line(int argc, char** argv); + void register_channels(); +diff --git a/configure.ac b/configure.ac +index 511d94e..ef4d68e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -297,6 +297,25 @@ AC_SUBST(JPEG_LIBS) + AC_CHECK_LIB(z, deflate, Z_LIBS='-lz', AC_MSG_ERROR([zlib not found])) + AC_SUBST(Z_LIBS) + ++URIPARSER_MISSING="Please install uriparser 0.7.5 or later. ++ On a Debian-based system enter 'sudo apt-get install liburiparser-dev'." ++AC_CHECK_LIB(uriparser, uriParseUriA,, AC_MSG_ERROR(${URIPARSER_MISSING})) ++AC_CHECK_HEADER(uriparser/Uri.h,, AC_MSG_ERROR(${URIPARSER_MISSING})) ++ ++URIPARSER_TOO_OLD="uriparser 0.7.5 or later is required, your copy is too old." ++AC_COMPILE_IFELSE([ ++#include <uriparser/Uri.h> ++#if (defined(URI_VER_MAJOR) && defined(URI_VER_MINOR) && defined(URI_VER_RELEASE) \ ++&& ((URI_VER_MAJOR > 0) \ ++|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR > 7)) \ ++|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR == 7) && (URI_VER_RELEASE >= 5)) \ ++)) ++/* FINE */ ++#else ++# error uriparser not recent enough ++#endif ++],,AC_MSG_ERROR(${URIPARSER_TOO_OLD})) ++ + dnl =========================================================================== + dnl check compiler flags + +-- +1.7.3.4 + diff --git a/app-emulation/spice/metadata.xml b/app-emulation/spice/metadata.xml index 802f892562a9..03b4eb311310 100644 --- a/app-emulation/spice/metadata.xml +++ b/app-emulation/spice/metadata.xml @@ -8,5 +8,8 @@ </maintainer> <use> <flag name="gui">Build some GUI components (inside the guest window).</flag> + <flag name="uri">Add uri-handling support to spicec using <pkg>dev-libs/uriparser</pkg>.</flag> + <flag name="kde">Install a KDE protocol handler configuration for spice + (only in combination with the uri USE flag)</flag> </use> </pkgmetadata> diff --git a/app-emulation/spice/spice-0.7.1.ebuild b/app-emulation/spice/spice-0.7.1.ebuild index a2f972fbf625..0eddf89f708e 100644 --- a/app-emulation/spice/spice-0.7.1.ebuild +++ b/app-emulation/spice/spice-0.7.1.ebuild @@ -1,9 +1,11 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/spice/spice-0.7.1.ebuild,v 1.1 2010/12/29 09:30:52 dev-zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/spice/spice-0.7.1.ebuild,v 1.2 2011/01/05 13:14:18 dev-zero Exp $ EAPI=3 +inherit autotools eutils + DESCRIPTION="SPICE server and client." HOMEPAGE="http://spice-space.org/" SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2" @@ -11,7 +13,7 @@ SRC_URI="http://spice-space.org/download/releases/${P}.tar.bz2" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64" -IUSE="+gui static-libs" +IUSE="+gui kde static-libs uri" RDEPEND=">=app-emulation/spice-protocol-0.7.0 >=x11-libs/pixman-0.17.7 @@ -25,13 +27,21 @@ RDEPEND=">=app-emulation/spice-protocol-0.7.0 x11-libs/libXfixes virtual/jpeg sys-libs/zlib - gui? ( =dev-games/cegui-0.6* )" + gui? ( =dev-games/cegui-0.6* ) + uri? ( dev-libs/uriparser )" DEPEND="dev-util/pkgconfig ${RDEPEND}" # maintainer notes: # * opengl support is currently broken +src_prepare() { + if use uri ; then + epatch "${FILESDIR}/0001-Added-initial-connection-url-handling-using-the-urip.patch" + eautoreconf + fi +} + src_configure() { local myconf="" use gui && myconf+="--enable-gui " @@ -43,4 +53,34 @@ src_install() { emake DESTDIR="${D}" install || die "emake install failed" dodoc NEWS TODO use static-libs || rm "${D}"/usr/lib*/*.la + + if use uri && use kde ; then + dodir /usr/share/kde4/services + cat > "${D}/usr/share/kde4/services/spice.protocol" << EOF +[Protocol] +exec=/usr/bin/spicec --uri "%u" +protocol=spice +input=none +output=none +helper=true +listing= +reading=false +writing=false +makedir=false +deleting=false +EOF + fi +} + +pkg_postinst() { + if use uri ; then + elog "You enabled uri-handler support in spice. Therefore you" + elog "might want your browser / deskop environment to handle" + elog "spice uri's using spicec. To enable this, run:" + elog " gconftool-2 -s /desktop/gnome/url-handlers/spice/command '/usr/bin/spicec --uri "%s"' --type String" + elog " gconftool-2 -s /desktop/gnome/url-handlers/spice/enabled --type Boolean true" + if use kde ; then + elog "For KDE the protocol could be registered automatically." + fi + fi } |