From 11c74e11606d81fcde71246dbfa5806aac9ff49b Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Sun, 11 Jul 2010 21:10:33 +0000 Subject: [PATCH] Update to 0.4.0 release --- .cvsignore | 2 +- gtk-vnc-0.3.10-bounds.patch | 217 -------------------------- gtk-vnc-0.3.10-gcrypt-threading.patch | 73 --------- gtk-vnc.spec | 124 ++++++++++++--- sources | 2 +- 5 files changed, 106 insertions(+), 312 deletions(-) delete mode 100644 gtk-vnc-0.3.10-bounds.patch delete mode 100644 gtk-vnc-0.3.10-gcrypt-threading.patch diff --git a/.cvsignore b/.cvsignore index ef21dfd..6e9e818 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1,3 @@ .build*.log *.rpm -gtk-vnc-0.3.9.tar.bz2 +gtk-vnc-0.4.0.tar.bz2 diff --git a/gtk-vnc-0.3.10-bounds.patch b/gtk-vnc-0.3.10-bounds.patch deleted file mode 100644 index d552b4d..0000000 --- a/gtk-vnc-0.3.10-bounds.patch +++ /dev/null @@ -1,217 +0,0 @@ -diff -rup gtk-vnc-0.3.10/src/gvnc.c gtk-vnc-0.3.10.new/src/gvnc.c ---- gtk-vnc-0.3.10/src/gvnc.c 2010-04-27 12:04:45.657317541 +0100 -+++ gtk-vnc-0.3.10.new/src/gvnc.c 2010-04-27 12:12:00.726185001 +0100 -@@ -2192,35 +2192,64 @@ static void gvnc_ext_key_event(struct gv - gvnc->keycode_map = x_keycode_to_pc_keycode_map(); - } - --static void gvnc_framebuffer_update(struct gvnc *gvnc, int32_t etype, -- uint16_t x, uint16_t y, -- uint16_t width, uint16_t height) -+ -+static gboolean gvnc_validate_boundary(struct gvnc *gvnc, -+ uint16_t width, uint16_t height) -+{ -+ -+ if (width > gvnc->width || height > gvnc->height) { -+ GVNC_DEBUG("Framebuffer update %dx%d outside boundary %dx%d", -+ width, height, gvnc->width, gvnc->height); -+ gvnc->has_error = TRUE; -+ } -+ -+ return !gvnc_has_error(gvnc); -+} -+ -+static gboolean gvnc_framebuffer_update(struct gvnc *gvnc, int32_t etype, -+ uint16_t x, uint16_t y, -+ uint16_t width, uint16_t height) - { - GVNC_DEBUG("FramebufferUpdate(%d, %d, %d, %d, %d)", - etype, x, y, width, height); - -+ if (gvnc_has_error(gvnc)) -+ return !gvnc_has_error(gvnc); -+ - switch (etype) { - case GVNC_ENCODING_RAW: -+ if (!gvnc_validate_boundary(gvnc, width, height)) -+ break; - gvnc_raw_update(gvnc, x, y, width, height); - gvnc_update(gvnc, x, y, width, height); - break; - case GVNC_ENCODING_COPY_RECT: -+ if (!gvnc_validate_boundary(gvnc, width, height)) -+ break; - gvnc_copyrect_update(gvnc, x, y, width, height); - gvnc_update(gvnc, x, y, width, height); - break; - case GVNC_ENCODING_RRE: -+ if (!gvnc_validate_boundary(gvnc, width, height)) -+ break; - gvnc_rre_update(gvnc, x, y, width, height); - gvnc_update(gvnc, x, y, width, height); - break; - case GVNC_ENCODING_HEXTILE: -+ if (!gvnc_validate_boundary(gvnc, width, height)) -+ break; - gvnc_hextile_update(gvnc, x, y, width, height); - gvnc_update(gvnc, x, y, width, height); - break; - case GVNC_ENCODING_ZRLE: -+ if (!gvnc_validate_boundary(gvnc, width, height)) -+ break; - gvnc_zrle_update(gvnc, x, y, width, height); - gvnc_update(gvnc, x, y, width, height); - break; - case GVNC_ENCODING_TIGHT: -+ if (!gvnc_validate_boundary(gvnc, width, height)) -+ break; - gvnc_tight_update(gvnc, x, y, width, height); - gvnc_update(gvnc, x, y, width, height); - break; -@@ -2249,6 +2278,8 @@ static void gvnc_framebuffer_update(stru - gvnc->has_error = TRUE; - break; - } -+ -+ return !gvnc_has_error(gvnc); - } - - gboolean gvnc_server_message(struct gvnc *gvnc) -@@ -2256,6 +2287,9 @@ gboolean gvnc_server_message(struct gvnc - uint8_t msg; - int ret; - -+ if (gvnc_has_error(gvnc)) -+ return !gvnc_has_error(gvnc); -+ - /* NB: make sure that all server message functions - handle has_error appropriately */ - -@@ -2290,7 +2324,8 @@ gboolean gvnc_server_message(struct gvnc - h = gvnc_read_u16(gvnc); - etype = gvnc_read_s32(gvnc); - -- gvnc_framebuffer_update(gvnc, etype, x, y, w, h); -+ if (!gvnc_framebuffer_update(gvnc, etype, x, y, w, h)) -+ break; - } - } break; - case 1: { /* SetColorMapEntries */ -@@ -3459,8 +3494,11 @@ void gvnc_close(struct gvnc *gvnc) - gvnc->tls_session = NULL; - } - #if HAVE_SASL -- if (gvnc->saslconn) -+ if (gvnc->saslconn) { - sasl_dispose (&gvnc->saslconn); -+ gvnc->saslconn = NULL; -+ gvnc->saslDecodedOffset = gvnc->saslDecodedLength = 0; -+ } - #endif - - if (gvnc->channel) { -@@ -3512,6 +3550,7 @@ void gvnc_close(struct gvnc *gvnc) - g_free(gvnc->cred_x509_key); - gvnc->cred_x509_key = NULL; - } -+ gvnc->want_cred_x509 = gvnc->want_cred_username = gvnc->want_cred_password = FALSE; - - for (i = 0; i < 5; i++) - inflateEnd(&gvnc->streams[i]); -@@ -3519,7 +3558,28 @@ void gvnc_close(struct gvnc *gvnc) - gvnc->auth_type = GVNC_AUTH_INVALID; - gvnc->auth_subtype = GVNC_AUTH_INVALID; - -- gvnc->has_error = 0; -+ memset(&gvnc->fmt, 0, sizeof(gvnc->fmt)); -+ gvnc->perfect_match = FALSE; -+ memset(&gvnc->local, 0, sizeof(gvnc->local)); -+ gvnc->rm = gvnc->gm = gvnc->bm = 0; -+ gvnc->rrs = gvnc->grs = gvnc->brs = 0; -+ gvnc->rls = gvnc->gls = gvnc->bls = 0; -+ -+ gvnc->read_offset = gvnc->read_size = 0; -+ gvnc->write_offset = 0; -+ -+ if (gvnc->xmit_buffer) { -+ g_free(gvnc->xmit_buffer); -+ gvnc->xmit_buffer = NULL; -+ } -+ gvnc->xmit_buffer_size = gvnc->xmit_buffer_capacity = 0; -+ gvnc->uncompressed_length = 0; -+ gvnc->compressed_length = 0; -+ -+ gvnc->width = gvnc->height = 0; -+ gvnc->major = gvnc->minor = 0; -+ -+ gvnc->has_error = FALSE; - } - - void gvnc_shutdown(struct gvnc *gvnc) -@@ -3569,11 +3629,15 @@ gboolean gvnc_initialize(struct gvnc *gv - gvnc->absolute = 1; - - gvnc_read(gvnc, version, 12); -- version[12] = 0; -+ if (gvnc_has_error(gvnc)) { -+ GVNC_DEBUG("Error while reading server version"); -+ goto fail; -+ } - -+ version[12] = 0; - ret = sscanf(version, "RFB %03d.%03d\n", &gvnc->major, &gvnc->minor); - if (ret != 2) { -- GVNC_DEBUG("Error while getting server version"); -+ GVNC_DEBUG("Error while parsing server version"); - goto fail; - } - -@@ -3604,6 +3668,8 @@ gboolean gvnc_initialize(struct gvnc *gv - gvnc->width = gvnc_read_u16(gvnc); - gvnc->height = gvnc_read_u16(gvnc); - -+ GVNC_DEBUG("Initial desktop size %dx%d", gvnc->width, gvnc->height); -+ - if (gvnc_has_error(gvnc)) - return FALSE; - -@@ -3638,7 +3704,7 @@ gboolean gvnc_initialize(struct gvnc *gv - return !gvnc_has_error(gvnc); - - fail: -- gvnc->has_error = 1; -+ gvnc->has_error = TRUE; - return !gvnc_has_error(gvnc); - } - -diff -rup gtk-vnc-0.3.10/src/vncdisplay.c gtk-vnc-0.3.10.new/src/vncdisplay.c ---- gtk-vnc-0.3.10/src/vncdisplay.c 2009-10-16 17:52:28.000000000 +0100 -+++ gtk-vnc-0.3.10.new/src/vncdisplay.c 2010-04-27 12:10:24.790184856 +0100 -@@ -879,7 +879,8 @@ static void setup_gdk_image(VncDisplay * - priv->image = gdk_image_new(GDK_IMAGE_FASTEST, visual, width, height); - priv->pixmap = gdk_pixmap_new(GTK_WIDGET(obj)->window, width, height, -1); - -- GVNC_DEBUG("Visual mask: %3d %3d %3d\n shift: %3d %3d %3d", -+ GVNC_DEBUG("Size %dx%%d\n Visual mask: %3d %3d %3d\n shift: %3d %3d %3d", -+ width, height, - visual->red_mask, - visual->green_mask, - visual->blue_mask, -@@ -973,6 +974,8 @@ static gboolean do_resize(void *opaque, - VncDisplayPrivate *priv = obj->priv; - struct signal_data s; - -+ GVNC_DEBUG("Do resize %dx%d %d", width, height, quiet); -+ - if (priv->gvnc == NULL || !gvnc_is_initialized(priv->gvnc)) - return TRUE; - -@@ -1340,6 +1343,7 @@ static gboolean delayed_unref_object(gpo - { - VncDisplay *obj = VNC_DISPLAY(data); - -+ GVNC_DEBUG("Delayed unref %p %d", data, obj->priv->coroutine.exited); - g_assert(obj->priv->coroutine.exited == TRUE); - - if (obj->priv->image) { diff --git a/gtk-vnc-0.3.10-gcrypt-threading.patch b/gtk-vnc-0.3.10-gcrypt-threading.patch deleted file mode 100644 index fa602bf..0000000 --- a/gtk-vnc-0.3.10-gcrypt-threading.patch +++ /dev/null @@ -1,73 +0,0 @@ -commit 90225c7981ae7a1586e6dbf136ba34b0e1ec8cae -Author: Daniel P. Berrange -Date: Thu Dec 17 18:23:19 2009 +0000 - - Initialize gcrypt threading callbacks - - If GTK has threading enabled, we must be sure to enable gcrypt - threading callbacks too for safety - -diff --git a/src/gvnc.c b/src/gvnc.c -index 307bbfe..c42fd6e 100644 ---- a/src/gvnc.c -+++ b/src/gvnc.c -@@ -781,6 +781,47 @@ static void gvnc_debug_gnutls_log(int level, const char* str) { - } - #endif - -+ -+static int gvnc_tls_mutex_init (void **priv) -+{ \ -+ GMutex *lock = NULL; -+ lock = g_mutex_new(); -+ *priv = lock; -+ return 0; -+} -+ -+static int gvnc_tls_mutex_destroy(void **priv) -+{ -+ GMutex *lock = *priv; -+ g_mutex_free(lock); -+ return 0; -+} -+ -+static int gvnc_tls_mutex_lock(void **priv) -+{ -+ GMutex *lock = *priv; -+ g_mutex_lock(lock); -+ return 0; -+} -+ -+static int gvnc_tls_mutex_unlock(void **priv) -+{ -+ GMutex *lock = *priv; -+ g_mutex_unlock(lock); -+ return 0; -+} -+ -+static struct gcry_thread_cbs gvnc_thread_impl = { -+ (GCRY_THREAD_OPTION_PTHREAD | (GCRY_THREAD_OPTION_VERSION << 8)), -+ NULL, -+ gvnc_tls_mutex_init, -+ gvnc_tls_mutex_destroy, -+ gvnc_tls_mutex_lock, -+ gvnc_tls_mutex_unlock, -+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL -+}; -+ -+ - static gboolean gvnc_tls_initialize(void) - { - static int tlsinitialized = 0; -@@ -788,6 +829,11 @@ static gboolean gvnc_tls_initialize(void) - if (tlsinitialized) - return TRUE; - -+ if (g_thread_supported()) { -+ gcry_control(GCRYCTL_SET_THREAD_CBS, &gvnc_thread_impl); -+ gcry_check_version(NULL); -+ } -+ - if (gnutls_global_init () < 0) - return FALSE; - diff --git a/gtk-vnc.spec b/gtk-vnc.spec index 24ff868..db8df97 100644 --- a/gtk-vnc.spec +++ b/gtk-vnc.spec @@ -4,20 +4,33 @@ # a security audit at very least %define with_plugin 0 +%define with_gir 0 + +%if 0%{fedora} >= 12 +%define with_gir 1 +%endif + Summary: A GTK widget for VNC clients Name: gtk-vnc -Version: 0.3.10 -Release: 3%{?dist} +Version: 0.4.0 +Release: 1%{?dist} License: LGPLv2+ Group: Development/Libraries Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/0.3/%{name}-%{version}.tar.bz2 -Patch1: %{name}-%{version}-gcrypt-threading.patch -Patch2: %{name}-%{version}-bounds.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) URL: http://live.gnome.org/gtk-vnc -BuildRequires: gtk2-devel pygtk2-devel python-devel zlib-devel -BuildRequires: gnutls-devel cyrus-sasl-devel -BuildRequires: intltool +BuildRequires: gtk2-devel >= 2.14 +BuildRequires: pygtk2-devel python-devel zlib-devel +BuildRequires: gnutls-devel cyrus-sasl-devel intltool +%if %{with_gir} +# Temp hack for missing dep +# https://bugzilla.redhat.com/show_bug.cgi?id=613466 +BuildRequires: libtool +BuildRequires: gobject-introspection-devel +%if 0%{?fedora} < 14 +BuildRequires: gir-repository-devel +%endif +%endif %if %{with_plugin} %if 0%{?fedora} > 8 BuildRequires: xulrunner-devel @@ -33,7 +46,7 @@ allowing it to be completely asynchronous while remaining single threaded. %package devel Summary: Libraries, includes, etc. to compile with the gtk-vnc library Group: Development/Libraries -Requires: %{name} = %{version} +Requires: %{name} = %{version}-%{release} Requires: pkgconfig Requires: gtk2-devel gnutls-devel @@ -68,18 +81,54 @@ This package provides a web browser plugin for Mozilla compatible browsers. %endif +%package -n gvnc +Summary: A GObject for VNC connections + +%description -n gvnc +gvnc is a GObject for managing a VNC connection. It provides all the +infrastructure required to build a VNC client without having to deal +with the raw protocol itself. + +%package -n gvnc-devel +Summary: Libraries, includes, etc. to compile with the gvnc library +Group: Development/Libraries +Requires: gvnc = %{version}-%{release} +Requires: pkgconfig + +%description -n gvnc-devel +gvnc is a GObject for managing a VNC connection. It provides all the +infrastructure required to build a VNC client without having to deal +with the raw protocol itself. + +Libraries, includes, etc. to compile with the gvnc library + +%package -n gvnc-tools +Summary: Command line VNC tools +Group: Applications/Internet + +%description -n gvnc-tools +Provides useful command line utilities for interacting with +VNC servers. Includes the gvnccapture program for capturing +screenshots of a VNC desktop + %prep %setup -q -%patch1 -p1 -%patch2 -p1 %build -%if %{with_plugin} -%configure --enable-plugin=yes +%if %{with_gir} +%define gir_arg --enable-introspection=yes %else -%configure +%define gir_arg --enable-introspection=no %endif -%__make %{?_smp_mflags} + +%if %{with_plugin} +%define plugin_arg --enable-plugin=yes +%else +%define plugin_arg --enable-plugin=no +%endif + +%configure %{plugin_arg} %{gir_arg} +%__make %{?_smp_mflags} V=1 %install rm -fr %{buildroot} @@ -92,8 +141,7 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la %endif - -%find_lang gtk-vnc +%find_lang %{name} %clean rm -fr %{buildroot} @@ -102,18 +150,27 @@ rm -fr %{buildroot} %postun -p /sbin/ldconfig -%files -f gtk-vnc.lang +%files -f %{name}.lang %defattr(-, root, root) -%doc AUTHORS ChangeLog NEWS README COPYING.LIB -%{_libdir}/lib*.so.* +%doc AUTHORS ChangeLog ChangeLog-old NEWS README COPYING.LIB +%{_libdir}/libgtk-vnc-1.0.so.* +%if %{with_gir} +%{_libdir}/girepository-1.0/GtkVnc-1.0.typelib +%endif %files devel %defattr(-, root, root) %doc examples/gvncviewer.c -%{_libdir}/lib*.so +%if %{with_gir} +%doc examples/gvncviewer.js +%endif +%{_libdir}/libgtk-vnc-1.0.so %dir %{_includedir}/%{name}-1.0/ %{_includedir}/%{name}-1.0/*.h %{_libdir}/pkgconfig/%{name}-1.0.pc +%if %{with_gir} +%{_datadir}/gir-1.0/GtkVnc-1.0.gir +%endif %files python %defattr(-, root, root) @@ -126,7 +183,34 @@ rm -fr %{buildroot} %{_libdir}/mozilla/plugins/%{name}-plugin.so %endif +%files -n gvnc +%defattr(-, root, root) +%{_libdir}/libgvnc-1.0.so.* +%if %{with_gir} +%{_libdir}/girepository-1.0/GVnc-1.0.typelib +%endif + +%files -n gvnc-devel +%defattr(-, root, root) +%{_libdir}/libgvnc-1.0.so +%dir %{_includedir}/gvnc-1.0/ +%{_includedir}/gvnc-1.0/*.h +%{_libdir}/pkgconfig/gvnc-1.0.pc +%if %{with_gir} +%{_datadir}/gir-1.0/GVnc-1.0.gir +%endif + +%files -n gvnc-tools +%defattr(-, root, root) +%doc AUTHORS ChangeLog NEWS README COPYING.LIB +%{_bindir}/gvnccapture +%{_mandir}/man1/gvnccapture.1* + %changelog +* Sun Jul 11 2010 Daniel P. Berrange - 0.4.0-1 +- Update to 0.4.0 release +- Add new sub-packages for gvnc + * Tue Apr 27 2010 Daniel P. Berrange - 0.3.10-3 - Drop VNC connection if the server sends a update spaning outside bounds of desktop (rhbz #540810) - Fix gcrypt threading initialization (rhbz #537489) diff --git a/sources b/sources index d3aac23..3869c0f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9aa9d830b219255c8d6753ef55802932 gtk-vnc-0.3.10.tar.bz2 +f38ce99af9080637c915b1b608155ba3 gtk-vnc-0.4.0.tar.bz2