From 034fb5f92686396ecd8bb74e3f58774e9590863d Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 11 Sep 2012 15:18:49 +0200 Subject: [PATCH 1/6] Add patch fixing symbol versioning This inadvertantly broke spice-gtk ABI --- 0002-build-sys-Fix-symbol-versioning.patch | 27 ++++++++++++++++++++++ spice-gtk.spec | 7 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0002-build-sys-Fix-symbol-versioning.patch diff --git a/0002-build-sys-Fix-symbol-versioning.patch b/0002-build-sys-Fix-symbol-versioning.patch new file mode 100644 index 0000000..c96fc9c --- /dev/null +++ b/0002-build-sys-Fix-symbol-versioning.patch @@ -0,0 +1,27 @@ +From df49129c9ee14ada3c6bcb45fc72057255bd0d9a Mon Sep 17 00:00:00 2001 +From: Christophe Fergeau +Date: Mon, 10 Sep 2012 14:49:44 +0200 +Subject: [spice-gtk] build-sys: Fix symbol versioning + +My changes in bug 5bf72a2e had a typo which broke symbol versioning +of libspice-client-gtk.so when -Wl,--version-script is available... +--- + gtk/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtk/Makefile.am b/gtk/Makefile.am +index 928f914..06cc6e1 100644 +--- a/gtk/Makefile.am ++++ b/gtk/Makefile.am +@@ -58,7 +58,7 @@ endif + + if HAVE_LD_VERSION_SCRIPT + GLIB_VERSION_LDFLAGS = -Wl,--version-script=${srcdir}/map-file +-GTK_VERSION_LD_FLAGS = $(GLIB_VERSION_LDFLAGS) ++GTK_VERSION_LDFLAGS = $(GLIB_VERSION_LDFLAGS) + else + GLIB_VERSION_LDFLAGS = -export-symbols ${srcdir}/spice-glib-sym-file + GTK_VERSION_LDFLAGS = -export-symbols ${srcdir}/spice-gtk-sym-file +-- +1.7.11.4 + diff --git a/spice-gtk.spec b/spice-gtk.spec index 5b98915..41777f3 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -13,7 +13,7 @@ Name: spice-gtk Version: 0.13.29 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -22,6 +22,7 @@ URL: http://spice-space.org/page/Spice-Gtk #VCS: git:git://anongit.freedesktop.org/spice/spice-gtk Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2 Patch1: 0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch +Patch2: 0002-build-sys-Fix-symbol-versioning.patch BuildRequires: intltool BuildRequires: gtk2-devel >= 2.14 @@ -149,6 +150,7 @@ fi pushd spice-gtk-%{version} %patch1 -p1 +%patch2 -p1 popd %if %{with_gtk3} @@ -268,6 +270,9 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc %{_bindir}/spicy-stats %changelog +* Tue Sep 11 2012 Christophe Fergeau - 0.13.29-2 +- Add patch to fix symbol versioning + * Fri Sep 7 2012 Hans de Goede - 0.13.29-1 - Update to the spice-gtk 0.13.29 development release - Rebuild for new usbredir From afbd71cadf1c91c4359a3403096c892aed863a50 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Thu, 13 Sep 2012 16:12:44 +0200 Subject: [PATCH 2/6] Forgot to run autoreconf after applying patch 2... --- spice-gtk.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spice-gtk.spec b/spice-gtk.spec index 41777f3..7e3ec31 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -13,7 +13,7 @@ Name: spice-gtk Version: 0.13.29 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -50,6 +50,8 @@ BuildRequires: pyparsing BuildRequires: spice-protocol # Hack because of bz #613466 BuildRequires: libtool +# For patch #2 +BuildRequires: autoconf automake Requires: spice-glib%{?_isa} = %{version}-%{release} %description @@ -151,6 +153,8 @@ fi pushd spice-gtk-%{version} %patch1 -p1 %patch2 -p1 +# Patch 2 changes Makefile.am +autoreconf -fi popd %if %{with_gtk3} @@ -270,6 +274,9 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc %{_bindir}/spicy-stats %changelog +* Thu Sep 13 2012 Christophe Fergeau - 0.13.29-3 +- Run autoreconf after applying patch 2 as it only modifies Makefile.am + * Tue Sep 11 2012 Christophe Fergeau - 0.13.29-2 - Add patch to fix symbol versioning From f351d2734411520af193eb3dc5e3f5f4d5b34768 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 14 Sep 2012 11:09:09 +0200 Subject: [PATCH 3/6] Add patch fixing CVE 2012-4425 --- 0003-CVE-2012-4425.patch | 60 ++++++++++++++++++++++++++++++++++++++++ spice-gtk.spec | 11 ++++++-- 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 0003-CVE-2012-4425.patch diff --git a/0003-CVE-2012-4425.patch b/0003-CVE-2012-4425.patch new file mode 100644 index 0000000..ba9b26d --- /dev/null +++ b/0003-CVE-2012-4425.patch @@ -0,0 +1,60 @@ +diff --git a/configure.ac b/configure.ac +index 3841c56..b2defd3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -243,6 +243,8 @@ else + EXTERNAL_PNP_IDS="$with_pnp_ids_path" + fi + ++AC_CHECK_FUNCS(clearenv) ++ + PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 2.22) + AC_SUBST(GLIB2_CFLAGS) + AC_SUBST(GLIB2_LIBS) +diff --git a/gtk/spice-client-glib-usb-acl-helper.c b/gtk/spice-client-glib-usb-acl-helper.c +index 724d62a..93b9b3a 100644 +--- a/gtk/spice-client-glib-usb-acl-helper.c ++++ b/gtk/spice-client-glib-usb-acl-helper.c +@@ -158,7 +158,8 @@ static void cleanup(void) + if (state == STATE_WAITING_FOR_STDIN_EOF) + set_facl(path, getuid(), 0); + +- g_main_loop_quit(loop); ++ if (loop) ++ g_main_loop_quit(loop); + } + + /* Not available in polkit < 0.101 */ +@@ -311,11 +312,32 @@ polkit_authority_get_sync (GCancellable *cancellable, GError **error) + } + #endif + ++#ifndef HAVE_CLEARENV ++extern char **environ; ++ ++static int ++clearenv (void) ++{ ++ if (environ != NULL) ++ environ[0] = NULL; ++ return 0; ++} ++#endif ++ + int main(void) + { + pid_t parent_pid; + GInputStream *stdin_unix_stream; + ++ /* Nuke the environment to get a well-known and sanitized ++ * environment to avoid attacks via e.g. the DBUS_SYSTEM_BUS_ADDRESS ++ * environment variable and similar. ++ */ ++ if (clearenv () != 0) { ++ FATAL_ERROR("Error clearing environment: %s\n", g_strerror (errno)); ++ return 1; ++ } ++ + g_type_init(); + + loop = g_main_loop_new(NULL, FALSE); diff --git a/spice-gtk.spec b/spice-gtk.spec index 7e3ec31..80b5be6 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -13,7 +13,7 @@ Name: spice-gtk Version: 0.13.29 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -23,6 +23,7 @@ URL: http://spice-space.org/page/Spice-Gtk Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2 Patch1: 0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch Patch2: 0002-build-sys-Fix-symbol-versioning.patch +Patch3: 0003-CVE-2012-4425.patch BuildRequires: intltool BuildRequires: gtk2-devel >= 2.14 @@ -50,7 +51,7 @@ BuildRequires: pyparsing BuildRequires: spice-protocol # Hack because of bz #613466 BuildRequires: libtool -# For patch #2 +# For patch #2 and #3 BuildRequires: autoconf automake Requires: spice-glib%{?_isa} = %{version}-%{release} @@ -153,7 +154,8 @@ fi pushd spice-gtk-%{version} %patch1 -p1 %patch2 -p1 -# Patch 2 changes Makefile.am +%patch3 -p1 +# Patch 2 changes Makefile.am and patch 3 changes configure.ac autoreconf -fi popd @@ -274,6 +276,9 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc %{_bindir}/spicy-stats %changelog +* Fri Sep 14 2012 Christophe Fergeau - 0.13.29-4 +- Add patch fixing CVE 2012-4425 + * Thu Sep 13 2012 Christophe Fergeau - 0.13.29-3 - Run autoreconf after applying patch 2 as it only modifies Makefile.am From cd43c2dba452a273b103a48ccae03b1fcfabe0a9 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 21 Sep 2012 10:31:47 +0200 Subject: [PATCH 4/6] spice-gtk 0.14 --- ...RECATED_FOR-must-be-defined-publicly.patch | 72 ------------------- 0002-build-sys-Fix-symbol-versioning.patch | 27 ------- 0003-CVE-2012-4425.patch | 60 ---------------- spice-gtk.spec | 24 +++---- 4 files changed, 9 insertions(+), 174 deletions(-) delete mode 100644 0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch delete mode 100644 0002-build-sys-Fix-symbol-versioning.patch delete mode 100644 0003-CVE-2012-4425.patch diff --git a/0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch b/0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch deleted file mode 100644 index 93e6f2c..0000000 --- a/0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6fb336e5218e85ca20010ba1f36092dcef955d92 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= -Date: Tue, 4 Sep 2012 23:27:05 +0200 -Subject: [PATCH spice-gtk] G_GNUC_DEPRECATED_FOR must be defined publicly - -It's not enough to define G_GNUC_DEPRECATED_FOR in glib-compat.h, -since this header is no public. Instead, let's define our own -SPICE_DEPRECATED_FOR macro ---- - gtk/glib-compat.h | 16 ---------------- - gtk/spice-util.h | 12 +++++++++++- - 2 files changed, 11 insertions(+), 17 deletions(-) - -diff --git a/gtk/glib-compat.h b/gtk/glib-compat.h -index a9efda3..909b4e1 100644 ---- a/gtk/glib-compat.h -+++ b/gtk/glib-compat.h -@@ -67,13 +67,6 @@ type_name##_get_type (void) \ - #define G_TYPE_ERROR (spice_error_get_type ()) - GType spice_error_get_type (void) G_GNUC_CONST; - --#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) --#define G_GNUC_DEPRECATED_FOR(f) \ -- __attribute__((deprecated("Use " #f " instead"))) --#else --#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED --#endif /* __GNUC__ */ -- - #define G_PARAM_DEPRECATED (1 << 31) - #endif /* glib 2.26 */ - -@@ -126,13 +119,4 @@ GType spice_main_context_get_type (void) G_GNUC_CONST; - } G_STMT_END - #endif - --#ifndef G_GNUC_DEPRECATED_FOR --#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) --#define G_GNUC_DEPRECATED_FOR(f) \ -- __attribute__((deprecated("Use " #f " instead"))) --#else --#define G_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED --#endif /* __GNUC__ */ --#endif -- - #endif /* GLIB_COMPAT_H */ -diff --git a/gtk/spice-util.h b/gtk/spice-util.h -index 271f3be..6996e55 100644 ---- a/gtk/spice-util.h -+++ b/gtk/spice-util.h -@@ -39,8 +39,18 @@ gulong spice_g_signal_connect_object(gpointer instance, - - #define SPICE_RESERVED_PADDING (10 * sizeof(void*)) - -+/* need to be in a public header, glib-compat.h is private */ -+#ifndef SPICE_GNUC_DEPRECATED_FOR -+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -+#define SPICE_GNUC_DEPRECATED_FOR(f) \ -+ __attribute__((deprecated("Use " #f " instead"))) -+#else -+#define SPICE_GNUC_DEPRECATED_FOR(f) G_GNUC_DEPRECATED -+#endif /* __GNUC__ */ -+#endif -+ - #ifndef SPICE_NO_DEPRECATED --#define SPICE_DEPRECATED_FOR(f) G_GNUC_DEPRECATED_FOR(f) -+#define SPICE_DEPRECATED_FOR(f) SPICE_GNUC_DEPRECATED_FOR(f) - #define SPICE_DEPRECATED G_GNUC_DEPRECATED - #else - #define SPICE_DEPRECATED_FOR(f) --- -1.7.11.4 - diff --git a/0002-build-sys-Fix-symbol-versioning.patch b/0002-build-sys-Fix-symbol-versioning.patch deleted file mode 100644 index c96fc9c..0000000 --- a/0002-build-sys-Fix-symbol-versioning.patch +++ /dev/null @@ -1,27 +0,0 @@ -From df49129c9ee14ada3c6bcb45fc72057255bd0d9a Mon Sep 17 00:00:00 2001 -From: Christophe Fergeau -Date: Mon, 10 Sep 2012 14:49:44 +0200 -Subject: [spice-gtk] build-sys: Fix symbol versioning - -My changes in bug 5bf72a2e had a typo which broke symbol versioning -of libspice-client-gtk.so when -Wl,--version-script is available... ---- - gtk/Makefile.am | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gtk/Makefile.am b/gtk/Makefile.am -index 928f914..06cc6e1 100644 ---- a/gtk/Makefile.am -+++ b/gtk/Makefile.am -@@ -58,7 +58,7 @@ endif - - if HAVE_LD_VERSION_SCRIPT - GLIB_VERSION_LDFLAGS = -Wl,--version-script=${srcdir}/map-file --GTK_VERSION_LD_FLAGS = $(GLIB_VERSION_LDFLAGS) -+GTK_VERSION_LDFLAGS = $(GLIB_VERSION_LDFLAGS) - else - GLIB_VERSION_LDFLAGS = -export-symbols ${srcdir}/spice-glib-sym-file - GTK_VERSION_LDFLAGS = -export-symbols ${srcdir}/spice-gtk-sym-file --- -1.7.11.4 - diff --git a/0003-CVE-2012-4425.patch b/0003-CVE-2012-4425.patch deleted file mode 100644 index ba9b26d..0000000 --- a/0003-CVE-2012-4425.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 3841c56..b2defd3 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -243,6 +243,8 @@ else - EXTERNAL_PNP_IDS="$with_pnp_ids_path" - fi - -+AC_CHECK_FUNCS(clearenv) -+ - PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 2.22) - AC_SUBST(GLIB2_CFLAGS) - AC_SUBST(GLIB2_LIBS) -diff --git a/gtk/spice-client-glib-usb-acl-helper.c b/gtk/spice-client-glib-usb-acl-helper.c -index 724d62a..93b9b3a 100644 ---- a/gtk/spice-client-glib-usb-acl-helper.c -+++ b/gtk/spice-client-glib-usb-acl-helper.c -@@ -158,7 +158,8 @@ static void cleanup(void) - if (state == STATE_WAITING_FOR_STDIN_EOF) - set_facl(path, getuid(), 0); - -- g_main_loop_quit(loop); -+ if (loop) -+ g_main_loop_quit(loop); - } - - /* Not available in polkit < 0.101 */ -@@ -311,11 +312,32 @@ polkit_authority_get_sync (GCancellable *cancellable, GError **error) - } - #endif - -+#ifndef HAVE_CLEARENV -+extern char **environ; -+ -+static int -+clearenv (void) -+{ -+ if (environ != NULL) -+ environ[0] = NULL; -+ return 0; -+} -+#endif -+ - int main(void) - { - pid_t parent_pid; - GInputStream *stdin_unix_stream; - -+ /* Nuke the environment to get a well-known and sanitized -+ * environment to avoid attacks via e.g. the DBUS_SYSTEM_BUS_ADDRESS -+ * environment variable and similar. -+ */ -+ if (clearenv () != 0) { -+ FATAL_ERROR("Error clearing environment: %s\n", g_strerror (errno)); -+ return 1; -+ } -+ - g_type_init(); - - loop = g_main_loop_new(NULL, FALSE); diff --git a/spice-gtk.spec b/spice-gtk.spec index 80b5be6..0973ff9 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -9,11 +9,11 @@ %define with_gtk3 1 %endif -%define _version_suffix -f256 +#define _version_suffix -f256 Name: spice-gtk -Version: 0.13.29 -Release: 4%{?dist} +Version: 0.14 +Release: 1%{?dist} Summary: A GTK+ widget for SPICE clients Group: System Environment/Libraries @@ -21,9 +21,6 @@ License: LGPLv2+ URL: http://spice-space.org/page/Spice-Gtk #VCS: git:git://anongit.freedesktop.org/spice/spice-gtk Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2 -Patch1: 0001-G_GNUC_DEPRECATED_FOR-must-be-defined-publicly.patch -Patch2: 0002-build-sys-Fix-symbol-versioning.patch -Patch3: 0003-CVE-2012-4425.patch BuildRequires: intltool BuildRequires: gtk2-devel >= 2.14 @@ -51,8 +48,6 @@ BuildRequires: pyparsing BuildRequires: spice-protocol # Hack because of bz #613466 BuildRequires: libtool -# For patch #2 and #3 -BuildRequires: autoconf automake Requires: spice-glib%{?_isa} = %{version}-%{release} %description @@ -151,13 +146,9 @@ if [ -n '%{?_version_suffix}' ]; then mv spice-gtk-%{version}%{?_version_suffix} spice-gtk-%{version} fi -pushd spice-gtk-%{version} -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -# Patch 2 changes Makefile.am and patch 3 changes configure.ac -autoreconf -fi -popd +#pushd spice-gtk-%{version} +#patch1 -p1 +#popd %if %{with_gtk3} cp -a spice-gtk-%{version} spice-gtk3-%{version} @@ -276,6 +267,9 @@ rm -rf %{buildroot}%{_datadir}/pkgconfig/spice-protocol.pc %{_bindir}/spicy-stats %changelog +* Fri Sep 21 2012 Christophe Fergeau - 0.14-1 +- Update to 0.14 release + * Fri Sep 14 2012 Christophe Fergeau - 0.13.29-4 - Add patch fixing CVE 2012-4425 From d24980b2dd9991757eb517e0acd7c82189e8070d Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 21 Sep 2012 16:27:40 +0200 Subject: [PATCH 5/6] Really update sources for spice-gtk 0.14 For some reason, git made the previous commit empty even if the .gitignore and sources changes were in the index --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d79a74d..d6acf60 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /spice-gtk-0.12.101.tar.bz2 /spice-gtk-0.13.tar.bz2 /spice-gtk-0.13.29-f256.tar.bz2 +/spice-gtk-0.14.tar.bz2 diff --git a/sources b/sources index 3227569..33f0831 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4296bc9e8e7afe629fc9ca7cc48f84a3 spice-gtk-0.13.29-f256.tar.bz2 +c105e3b7f9c9eb293b0d6a8d35f6a5fd spice-gtk-0.14.tar.bz2 From d68791c908d0276ab85169863da0ef3240134650 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 25 Sep 2012 22:41:39 +0200 Subject: [PATCH 6/6] Prepare for building with usbredir >= 0.5.2 Not actually building this, just making sure the next time we do a build it does not break because of the usbredir changes. --- ...redirparser.pc-rename-to-libusbredir.patch | 57 +++++++++++++++++++ spice-gtk.spec | 10 ++-- 2 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 0001-Deal-with-libusbredirparser.pc-rename-to-libusbredir.patch diff --git a/0001-Deal-with-libusbredirparser.pc-rename-to-libusbredir.patch b/0001-Deal-with-libusbredirparser.pc-rename-to-libusbredir.patch new file mode 100644 index 0000000..9cc8a55 --- /dev/null +++ b/0001-Deal-with-libusbredirparser.pc-rename-to-libusbredir.patch @@ -0,0 +1,57 @@ +From 6d1505386982aee3622afc1d25f1989965832a55 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Tue, 25 Sep 2012 12:59:13 +0200 +Subject: [PATCH spice-gtk] Deal with libusbredirparser.pc rename to + libusbredirparser-0.5.pc + +The usbredir 0.5 release introduced the new API for 64 bit packet ids, but +it kept the libusbredirparser.pc name as is, meaning that older versions of +qemu will still have their pkg-config check for usbredirparser fulfilled, +and build with the usb-redir device. Due to the API change there will be +some compiler warnings, but the build will succeed, however the usb-redir +device will be broken on 32 bit machines. + +To solve this, the usbredir-0.5.2 release renames the libusbredirparser.pc +file to libusbredirparser-0.5.pc, so that it will no longer fulfill the +pkg-config check of the qemu-1.2 and older releases, stopping the (silent) +breakage. + +spice-gtk does not use the changed parts of the API, but does +use libusbredirparser for the usbredirfilter* functions. This patch adapts +spice-gtk's configure to accept both the libusbredirparser-0.5 and the +libusbredirparser pkg-config names. + +Signed-off-by: Hans de Goede +--- + configure.ac | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c7367cc..7c59575 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -349,10 +349,17 @@ AC_ARG_ENABLE([usbredir], + if test "x$enable_usbredir" = "xno"; then + have_usbredir="no" + else +- PKG_CHECK_MODULES([USBREDIR], +- [libusb-1.0 >= 1.0.9 libusbredirhost >= 0.4.2 libusbredirparser >= 0.4], +- [have_usbredir=yes], +- [have_usbredir=no]) ++ if ${PKG_CONFIG} libusbredirparser-0.5; then ++ PKG_CHECK_MODULES([USBREDIR], ++ [libusb-1.0 >= 1.0.9 libusbredirhost libusbredirparser-0.5], ++ [have_usbredir=yes], ++ [have_usbredir=no]) ++ else ++ PKG_CHECK_MODULES([USBREDIR], ++ [libusb-1.0 >= 1.0.9 libusbredirhost >= 0.4.2 libusbredirparser >= 0.4], ++ [have_usbredir=yes], ++ [have_usbredir=no]) ++ fi + if test "x$have_usbredir" = "xno" && test "x$enable_usbredir" = "xyes"; then + AC_MSG_ERROR([usbredir support explicitly requested, but some required packages are not available]) + fi +-- +1.7.12 + diff --git a/spice-gtk.spec b/spice-gtk.spec index 0973ff9..47431a8 100644 --- a/spice-gtk.spec +++ b/spice-gtk.spec @@ -21,10 +21,11 @@ License: LGPLv2+ URL: http://spice-space.org/page/Spice-Gtk #VCS: git:git://anongit.freedesktop.org/spice/spice-gtk Source0: http://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2 +Patch0: 0001-Deal-with-libusbredirparser.pc-rename-to-libusbredir.patch BuildRequires: intltool BuildRequires: gtk2-devel >= 2.14 -BuildRequires: usbredir-devel >= 0.5 +BuildRequires: usbredir-devel >= 0.5.2 BuildRequires: libusb1-devel >= 1.0.9 BuildRequires: libgudev1-devel BuildRequires: perl-Text-CSV @@ -146,9 +147,10 @@ if [ -n '%{?_version_suffix}' ]; then mv spice-gtk-%{version}%{?_version_suffix} spice-gtk-%{version} fi -#pushd spice-gtk-%{version} -#patch1 -p1 -#popd +pushd spice-gtk-%{version} +%patch0 -p1 +autoreconf -f -i +popd %if %{with_gtk3} cp -a spice-gtk-%{version} spice-gtk3-%{version}