--- /dev/null
+--- virt-viewer-0.5.2/plugin/virt-viewer-plugin.h.orig 2012-03-09 14:42:10.000000000 +0100
++++ virt-viewer-0.5.2/plugin/virt-viewer-plugin.h 2012-04-26 17:45:39.725500899 +0200
+@@ -46,10 +46,10 @@
+ #define PLUGIN_DESCRIPTION "Virtual machine console viewer plugin"
+
+ typedef struct {
+- uint16 mode;
++ uint16_t mode;
+ NPWindow *window;
+- int32 x, y;
+- uint32 width, height;
++ int32_t x, y;
++ uint32_t width, height;
+
+ NPP instance;
+ NPBool pluginsHidden;
+@@ -62,7 +62,7 @@
+
+ extern NPError VirtViewerXSetWindow (NPP instance, NPWindow* window);
+ extern NPError VirtViewerDestroyWindow (NPP instance);
+-extern int16 VirtViewerXHandleEvent (NPP instance, void* event);
++extern int16_t VirtViewerXHandleEvent (NPP instance, void* event);
+
+ #ifdef ENABLE_DEBUG
+ static void
+--- virt-viewer-0.5.2/plugin/virt-viewer-plugin.c.orig 2012-03-09 14:42:10.000000000 +0100
++++ virt-viewer-0.5.2/plugin/virt-viewer-plugin.c 2012-04-26 17:55:14.225488926 +0200
+@@ -111,7 +111,7 @@
+
+ static NPWindow windowlessWindow;
+
+-int16
++int16_t
+ VirtViewerXHandleEvent(NPP instance, void *event)
+ {
+ XGraphicsExposeEvent exposeEvent;
+--- virt-viewer-0.5.2/plugin/npshell.c.orig 2012-03-09 14:42:10.000000000 +0100
++++ virt-viewer-0.5.2/plugin/npshell.c 2012-04-26 19:54:27.675339819 +0200
+@@ -84,7 +84,7 @@
+ #include <strings.h>
+
+ #include <npapi.h>
+-#include <npupp.h>
++#include <nspr/prtypes.h>
+
+ #include "virt-viewer-plugin.h"
+
+@@ -94,7 +94,7 @@
+ *
+ ***********************************************************************/
+
+-char *
++const char *
+ NPP_GetMIMEDescription(void)
+ {
+ return (char *) MIME_TYPES_HANDLED;
+@@ -150,8 +150,8 @@
+ NPError
+ NPP_New(NPMIMEType pluginType G_GNUC_UNUSED,
+ NPP instance,
+- uint16 mode,
+- int16 argc,
++ uint16_t mode,
++ int16_t argc,
+ char* argn[],
+ char* argv[],
+ NPSavedData *saved G_GNUC_UNUSED)
+@@ -253,7 +253,7 @@
+ return VirtViewerXSetWindow(instance, window);
+ }
+
+-int32
++int32_t
+ NPP_WriteReady(NPP instance, NPStream *stream)
+ {
+ /*printf("NPP_WriteReady()\n");*/
+@@ -267,9 +267,9 @@
+ return -1L; /* don't accept any bytes in NPP_Write() */
+ }
+
+-int32
++int32_t
+ NPP_Write(NPP instance, NPStream *stream,
+- int32 offset G_GNUC_UNUSED, int32 len G_GNUC_UNUSED,
++ int32_t offset G_GNUC_UNUSED, int32_t len G_GNUC_UNUSED,
+ void *buffer G_GNUC_UNUSED)
+ {
+ /*printf("NPP_Write()\n");*/
+@@ -386,7 +386,7 @@
+ }
+ }
+
+-int16 NPP_HandleEvent(NPP instance, void* event)
++int16_t NPP_HandleEvent(NPP instance, void* event)
+ {
+ /*printf("NPP_HandleEvent()\n");*/
+
+--- virt-viewer-0.5.2/plugin/npunix.c.orig 2012-03-09 14:42:10.000000000 +0100
++++ virt-viewer-0.5.2/plugin/npunix.c 2012-04-26 19:59:30.808666841 +0200
+@@ -57,7 +57,7 @@
+
+ #include <stdio.h>
+ #include <npapi.h>
+-#include <npupp.h>
++#include <npfunctions.h>
+
+ #include <glib.h> /* just for G_GNUC_UNUSED */
+
+@@ -134,14 +134,14 @@
+
+ NPError
+ NPN_PostURL(NPP instance, const char* url, const char* window,
+- uint32 len, const char* buf, NPBool file)
++ uint32_t len, const char* buf, NPBool file)
+ {
+ return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
+ url, window, len, buf, file);
+ }
+
+ NPError
+-NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len,
++NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len,
+ const char* buf, NPBool file, void* notifyData)
+ {
+ return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
+@@ -163,8 +163,8 @@
+ type, window, stream_ptr);
+ }
+
+-int32
+-NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
++int32_t
++NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
+ {
+ return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
+ stream, len, buffer);
+@@ -190,7 +190,7 @@
+ }
+
+ void*
+-NPN_MemAlloc(uint32 size)
++NPN_MemAlloc(uint32_t size)
+ {
+ return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
+ }
+@@ -200,7 +200,7 @@
+ CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
+ }
+
+-uint32 NPN_MemFlush(uint32 size)
++uint32_t NPN_MemFlush(uint32_t size)
+ {
+ return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
+ }
+@@ -269,8 +269,8 @@
+ ***********************************************************************/
+
+ static NPError
+-Private_New(NPMIMEType pluginType, NPP instance, uint16 mode,
+- int16 argc, char* argn[], char* argv[], NPSavedData* saved)
++Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
++ int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
+ {
+ NPError ret;
+ PLUGINDEBUGSTR("New");
+@@ -297,7 +297,7 @@
+ static NPError
+ Private_NewStream(NPP instance G_GNUC_UNUSED, NPMIMEType type G_GNUC_UNUSED,
+ NPStream* stream G_GNUC_UNUSED,
+- NPBool seekable G_GNUC_UNUSED, uint16* stype G_GNUC_UNUSED)
++ NPBool seekable G_GNUC_UNUSED, uint16_t* stype G_GNUC_UNUSED)
+ {
+ NPError err = NPERR_NO_ERROR;
+ PLUGINDEBUGSTR("NewStream");
+@@ -305,7 +305,7 @@
+ return err;
+ }
+
+-static int32
++static int32_t
+ Private_WriteReady(NPP instance, NPStream* stream)
+ {
+ unsigned int result;
+@@ -314,8 +314,8 @@
+ return result;
+ }
+
+-static int32
+-Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
++static int32_t
++Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len,
+ void* buffer)
+ {
+ unsigned int result;
+@@ -376,7 +376,7 @@
+ }
+ #endif
+
+-static int16
++static int16_t
+ Private_HandleEvent(NPP instance, void* event)
+ {
+ return NPP_HandleEvent(instance, event);
+@@ -394,7 +394,7 @@
+ * - Netscape uses the return value to identify when an object instance
+ * of this plugin should be created.
+ */
+-char *
++const char *
+ NP_GetMIMEDescription(void)
+ {
+ return NPP_GetMIMEDescription();
#
# Conditional build:
-%bcond_with gtk2
-%bcond_without gtk3
-%bcond_without spice
-%bcond_with plugin
+%bcond_with gtk2 # use GTK+ 2.x instead of GTK+ 3.x
+%bcond_without spice # SPICE support
+%bcond_without plugin # Mozilla plugin (doesn't work with GTK+ 3)
#
+%if %{without gtk2}
+%undefine with_plugin
+%endif
Summary: Virtual Machine Viewer
+Summary(pl.UTF-8): Przeglądarka maszyny wirtualnej
Name: virt-viewer
Version: 0.5.2
Release: 1
Group: X11/Applications/Networking
Source0: http://virt-manager.org/download/sources/virt-viewer/%{name}-%{version}.tar.gz
# Source0-md5: 4a8e1c4d69cff00d89a13efb26ec1050
+Patch0: %{name}-plugin.patch
URL: http://virt-manager.org/
-BuildRequires: autoconf
+BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: gettext-devel >= 0.14.1
-BuildRequires: glib2-devel
+BuildRequires: glib2-devel >= 1:2.12.0
BuildRequires: intltool >= 0.35.0
-%if %{with gtk3}
+BuildRequires: libtool
+BuildRequires: libvirt-devel >= 0.9.7
+BuildRequires: libxml2-devel >= 1:2.6.0
+BuildRequires: perl-tools-pod
+BuildRequires: sed >= 4.0
+BuildRequires: spice-protocol >= 0.10.1
+%if %{with gtk2}
+BuildRequires: gtk+2-devel >= 2:2.18.0
+BuildRequires: gtk-vnc-devel >= 0.4.3
+%{?with_spice:BuildRequires: spice-gtk2-devel >= 0.11}
+%else
BuildRequires: gtk+3-devel >= 3.0.0
BuildRequires: gtk3-vnc-devel >= 0.4.3
%{?with_spice:BuildRequires: spice-gtk-devel >= 0.11}
%endif
-%if %{with gtk2}
-BuildRequires: gtk+2-devel >= 2.12.0
-BuildRequires: gtk-vnc-devel >= 0.4.3
-%{?with_spice:BuildRequires: spice-gtk2-devel >= 0.11}
+%if %{with plugin}
+BuildRequires: nspr-devel >= 4.0.0
+BuildRequires: xulrunner-devel >= 1.8
%endif
-BuildRequires: libtool
-BuildRequires: libvirt-devel >= 0.9.7
-BuildRequires: libxml2-devel
-BuildRequires: perl-tools-pod
-BuildRequires: sed >= 4.0
-%{?with_plugin:BuildRequires: xulrunner-devel}
Requires(post,postun): gtk-update-icon-cache
+Requires: glib2 >= 1:2.12.0
Requires: hicolor-icon-theme
+Requires: libvirt >= 0.9.7
+Requires: libxml2 >= 1:2.6.0
+%if %{with gtk2}
+Requires: gtk+2 >= 2:2.18.0
+Requires: gtk-vnc >= 0.4.3
+%{?with_spice:Requires: spice-gtk2 >= 0.11}
+%else
+BuildRequires: gtk+3 >= 3.0.0
+BuildRequires: gtk3-vnc >= 0.4.3
+%{?with_spice:BuildRequires: spice-gtk >= 0.11}
+%endif
Suggests: openssh-clients
Suggests: gnome-keyring >= 0.4.9
-ExclusiveArch: %{ix86} x86_64 ia64
+ExclusiveArch: %{ix86} %{x8664} ia64
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
widgets to provide the display, and libvirt for looking up VNC/SPICE
server details.
-Virtual Machine Viewer provides a graphical console client for
-connecting to virtual machines. It uses the GTK-VNC or SPICE-GTK
-widgets to provide the display, and libvirt for looking up VNC/SPICE
-server details.
+%description -l pl.UTF-8
+Virtual Machine Viewer udostępnia klienta graficznej konsoli do
+łączenia z maszynami wirtualnymi. Wykorzystuje widgety GTK-VNC lub
+SPICE-GTK do zapewnienia obrazu oraz libvirt do odczytu szczegółów
+serwera VNC/SPICE.
%package plugin
Summary: Mozilla plugin for the gtk-vnc library
+Summary(pl.UTF-8): Wtyczka Mozilli do biblioteki gtk-vnc
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
This package provides a web browser plugin for Mozilla compatible
browsers.
+%description plugin -l pl.UTF-8
+Virtual Machine Viewer udostępnia klienta graficznej konsoli do
+łączenia z maszynami wirtualnymi. Wykorzystuje widgety GTK-VNC lub
+SPICE-GTK do zapewnienia obrazu oraz libvirt do odczytu szczegółów
+serwera VNC/SPICE.
+
+Ten pakiet dostarcza wtyczkę dla przeglądarek WWW zgodnych z Mozillą.
+
%prep
%setup -q
+%patch0 -p1
%{__sed} -i -e 's|PWD|shell pwd|g' icons/*/Makefile.am
%{__libtoolize}
%{__aclocal}
%{__autoconf}
+%{__autoheader}
%{__automake}
%configure \
+ --disable-silent-rules \
%{__enable_disable plugin} \
%{__with_without spice spice-gtk} \
- %{__with_without gtk2 gtk 2.0} \
- %{__with_without gtk3 gtk 3.0}
+ --with-gtk=%{?with_gtk2:2.0}%{!?with_gtk2:3.0}
%{__make}
rm -rf $RPM_BUILD_ROOT
%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT
+ DESTDIR=$RPM_BUILD_ROOT \
+ plugindir=%{_libdir}/browser-plugins
%find_lang %{name}
%if %{with plugin}
%files plugin
%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/browser-plugins/virt-viewer-plugin.so
%endif