2007-07-20 23:26:08 +04:00
# -*- rpm-spec -*-
2008-03-09 23:36:17 +03:00
# Plugin isn't ready for real world use yet - it needs
# a security audit at very least
%define _with_plugin %{?with_plugin:1}%{!?with_plugin:0}
2011-07-01 18:26:33 +04:00
%define with_gtk3 0
%if 0%{?fedora} >= 15
%define with_gtk3 1
%endif
2011-02-11 18:55:49 +03:00
%define with_spice 0
2011-07-01 18:26:33 +04:00
%if 0%{?fedora} >= 16
2011-02-11 18:55:49 +03:00
%define with_spice 1
%endif
2012-03-07 14:20:59 +04:00
%if 0%{?rhel} >= 6
%define with_spice 1
%endif
2011-07-12 15:11:58 +04:00
# spice-gtk is x86 x86_64 only currently:
%ifnarch %{ix86} x86_64
%define with_spice 0
%endif
2007-07-20 23:26:08 +04:00
Name : @PACKAGE@
Version : @VERSION@
2007-08-16 04:14:44 +04:00
Release : 1%{?dist} %{?extra_release}
2007-07-20 23:26:08 +04:00
Summary : Virtual Machine Viewer
2007-08-16 04:18:51 +04:00
Group : Applications/System
2008-03-07 20:53:56 +03:00
License : GPLv2+
2007-07-20 23:26:08 +04:00
URL : http://virt-manager.org/
Source0 : http://virt-manager.org/download/sources/%{name} /%{name} -%{version} .tar.gz
BuildRoot : %{_tmppath} /%{name} -%{version} -%{release} -root-%(%{__id_u} -n)
2008-03-07 20:53:56 +03:00
Requires : openssh-clients
2012-02-06 18:22:42 +04:00
Requires(post) : %{_sbindir} /update-alternatives
Requires(postun) : %{_sbindir} /update-alternatives
2007-07-20 23:26:08 +04:00
2011-07-01 18:26:33 +04:00
%if %{with_gtk3}
BuildRequires : gtk3-devel >= 3.0.0
%else
2011-07-01 16:41:54 +04:00
BuildRequires : gtk2-devel >= 2.12.0
2011-07-01 18:26:33 +04:00
%endif
2012-03-09 16:52:42 +04:00
BuildRequires : libvirt-devel >= 0.9.7
2007-08-16 04:18:51 +04:00
BuildRequires : libxml2-devel
2011-07-12 16:10:40 +04:00
%if %{with_gtk3}
2012-02-16 18:44:19 +04:00
BuildRequires : gtk-vnc2-devel >= 0.4.0
2011-07-12 16:10:40 +04:00
%else
2012-02-16 18:44:19 +04:00
BuildRequires : gtk-vnc-devel >= 0.3.8
2011-07-12 16:10:40 +04:00
%endif
2011-02-11 18:55:49 +03:00
%if %{with_spice}
2011-07-12 16:10:40 +04:00
%if %{with_gtk3}
2012-03-09 16:52:42 +04:00
BuildRequires : spice-gtk3-devel >= 0.11
2011-07-12 16:10:40 +04:00
%else
2012-03-09 16:52:42 +04:00
BuildRequires : spice-gtk-devel >= 0.11
2011-02-11 18:55:49 +03:00
%endif
2012-03-09 16:52:42 +04:00
BuildRequires : spice-protocol >= 0.10.1
2011-07-12 16:10:40 +04:00
%endif
2007-07-20 23:59:19 +04:00
BuildRequires : /usr/bin/pod2man
2011-02-21 15:38:45 +03:00
BuildRequires : intltool
2008-03-09 23:36:17 +03:00
%if %{_with_plugin}
2011-02-21 15:38:45 +03:00
%if 0%{?fedora} > 8
2008-03-09 23:36:17 +03:00
BuildRequires : xulrunner-devel
%else
BuildRequires : firefox-devel
%endif
%endif
2007-07-20 23:26:08 +04:00
%description
Virtual Machine Viewer provides a graphical console client for connecting
2011-07-01 14:18:36 +04:00
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.
2007-07-20 23:26:08 +04:00
2008-03-09 23:36:17 +03:00
%if %{_with_plugin}
%package plugin
Summary : Mozilla plugin for the gtk-vnc library
Group : Development/Libraries
Requires : %{name} = %{version}
%description plugin
2011-07-01 14:18:36 +04:00
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.
2008-03-09 23:36:17 +03:00
This package provides a web browser plugin for Mozilla compatible
browsers.
%endif
2007-07-20 23:26:08 +04:00
%prep
%setup -q
%build
2011-02-11 18:55:49 +03:00
2008-03-09 23:36:17 +03:00
%if %{_with_plugin}
2011-02-11 18:55:49 +03:00
%define plugin_arg --enable-plugin
2008-03-09 23:36:17 +03:00
%else
2011-02-11 18:55:49 +03:00
%define plugin_arg --disable-plugin
2008-03-09 23:36:17 +03:00
%endif
2011-02-11 18:55:49 +03:00
%if %{with_spice}
2011-11-04 00:37:48 +04:00
%define spice_arg --with-spice-gtk
2011-02-11 18:55:49 +03:00
%else
2011-11-04 00:37:48 +04:00
%define spice_arg --without-spice-gtk
2011-02-11 18:55:49 +03:00
%endif
2011-07-01 18:26:33 +04:00
%if %{with_gtk3}
%define gtk_arg --with-gtk=3.0
%else
%define gtk_arg --with-gtk=2.0
%endif
%configure %{spice_arg} %{plugin_arg} %{gtk_arg}
2008-03-09 23:36:17 +03:00
%__make %{?_smp_mflags}
2007-07-20 23:26:08 +04:00
%install
rm -rf $RPM_BUILD_ROOT
2008-03-07 20:53:56 +03:00
%__make install DESTDIR=$RPM_BUILD_ROOT
2012-02-06 18:22:42 +04:00
mkdir -p %{buildroot} %{_libexecdir}
touch %{buildroot} %{_libexecdir} /spice-xpi-client
install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot} %{_libexecdir} /
2008-03-09 23:36:17 +03:00
%if %{_with_plugin}
rm -f %{buildroot} %{_libdir} /mozilla/plugins/%{name} -plugin.a
rm -f %{buildroot} %{_libdir} /mozilla/plugins/%{name} -plugin.la
%endif
2010-01-11 20:00:37 +03:00
%find_lang %{name}
2007-07-20 23:26:08 +04:00
%clean
rm -rf $RPM_BUILD_ROOT
2012-02-06 18:22:42 +04:00
%post
2012-02-08 20:41:37 +04:00
/bin/touch --no-create %{_datadir} /icons/hicolor &>/dev/null || :
2012-02-06 18:22:42 +04:00
%{_sbindir} /update-alternatives --install %{_libexecdir} /spice-xpi-client \
spice-xpi-client %{_libexecdir} /spice-xpi-client-remote-viewer 20
%postun
if [ $1 -eq 0 ] ; then
2012-02-08 20:41:37 +04:00
/bin/touch --no-create %{_datadir} /icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir} /icons/hicolor &>/dev/null || :
2012-02-06 18:22:42 +04:00
%{_sbindir} /update-alternatives --remove spice-xpi-client %{_libexecdir} /spice-xpi-client-remote-viewer
fi
2012-02-08 20:41:37 +04:00
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir} /icons/hicolor &>/dev/null || :
2010-01-11 20:00:37 +03:00
%files -f %{name}.lang
2007-07-20 23:26:08 +04:00
%defattr (-,root,root,-)
%doc README COPYING AUTHORS ChangeLog NEWS
%{_bindir} /%{name}
2012-01-27 17:51:23 +04:00
%{_bindir} /remote-viewer
2008-11-26 21:03:50 +03:00
%dir %{_datadir} /%{name}
%dir %{_datadir} /%{name} /ui/
2011-07-01 19:12:20 +04:00
%{_datadir} /%{name} /ui/virt-viewer.xml
%{_datadir} /%{name} /ui/virt-viewer-auth.xml
%{_datadir} /%{name} /ui/virt-viewer-about.xml
2012-02-08 20:41:37 +04:00
%{_datadir} /icons/hicolor/*/apps/*
2012-02-06 18:22:42 +04:00
%ghost %{_libexecdir} /spice-xpi-client
%{_libexecdir} /spice-xpi-client-remote-viewer
2012-02-06 18:04:45 +04:00
%{_mandir} /man1/virt-viewer.1*
%{_mandir} /man1/remote-viewer.1*
2007-07-20 23:26:08 +04:00
2008-03-09 23:36:17 +03:00
%if %{_with_plugin}
%files plugin
%defattr (-, root, root)
%{_libdir} /mozilla/plugins/%{name} -plugin.so
%endif
2007-07-20 23:26:08 +04:00
%changelog