virt-viewer/virt-viewer.spec.in

162 lines
4.0 KiB
RPMSpec
Raw Normal View History

2007-07-20 23:26:08 +04:00
# -*- rpm-spec -*-
# Default to skipping autoreconf. Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
# touch configure.ac or Makefile.am.
2013-05-01 20:40:06 +04:00
%{!?enable_autotools:%define enable_autotools 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
2012-04-05 13:17:01 +04:00
%if 0%{?fedora} >= 17
2011-02-11 18:55:49 +03:00
%define with_spice 1
%endif
%define with_govirt 0
2013-05-01 20:40:06 +04:00
%if 0%{?fedora} >= 19
%define with_govirt 1
%endif
2012-03-07 14:20:59 +04:00
%if 0%{?rhel} >= 6
%define with_spice 1
%endif
2013-05-01 20:40:06 +04:00
# spice-gtk is x86 x86_64 arm only currently:
%ifnarch %{ix86} x86_64 %{arm}
%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
Group: Applications/System
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)
Requires: openssh-clients
Requires(post): %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
2007-07-20 23:26:08 +04:00
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif
BuildRequires: glib2-devel >= 2.22
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
BuildRequires: libvirt-devel >= 0.9.7
BuildRequires: libxml2-devel
2011-07-12 16:10:40 +04:00
%if %{with_gtk3}
BuildRequires: gtk-vnc2-devel >= 0.4.0
2011-07-12 16:10:40 +04:00
%else
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}
BuildRequires: spice-gtk3-devel >= 0.16.26
2011-07-12 16:10:40 +04:00
%else
BuildRequires: spice-gtk-devel >= 0.16.26
2011-02-11 18:55:49 +03:00
%endif
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
2013-05-01 20:40:06 +04:00
%if %{with_govirt}
BuildRequires: libgovirt-devel >= 0.0.3
%endif
2007-07-20 23:26:08 +04:00
%description
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.
2007-07-20 23:26:08 +04:00
%prep
%setup -q
%build
2011-02-11 18:55:49 +03:00
%if 0%{?enable_autotools}
autoreconf -if
%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
%if %{with_govirt}
%define govirt_arg --with-ovirt
%endif
%configure %{spice_arg} %{gtk_arg} %{govirt_arg} --with-buildid=-%{release}
%__make %{?_smp_mflags}
2007-07-20 23:26:08 +04:00
%install
rm -rf $RPM_BUILD_ROOT
%__make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p %{buildroot}%{_libexecdir}
touch %{buildroot}%{_libexecdir}/spice-xpi-client
install -m 0755 data/spice-xpi-client-remote-viewer %{buildroot}%{_libexecdir}/
%find_lang %{name}
2007-07-20 23:26:08 +04:00
%clean
rm -rf $RPM_BUILD_ROOT
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
%{_sbindir}/update-alternatives --install %{_libexecdir}/spice-xpi-client \
spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer 25
update-desktop-database -q %{_datadir}/applications
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_sbindir}/update-alternatives --remove spice-xpi-client %{_libexecdir}/spice-xpi-client-remote-viewer
fi
update-desktop-database -q %{_datadir}/applications
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%files -f %{name}.lang
2007-07-20 23:26:08 +04:00
%defattr(-,root,root,-)
%doc README COPYING AUTHORS ChangeLog NEWS
%{_bindir}/%{name}
%{_bindir}/remote-viewer
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/ui/
%{_datadir}/%{name}/ui/virt-viewer.xml
%{_datadir}/%{name}/ui/virt-viewer-auth.xml
%{_datadir}/%{name}/ui/virt-viewer-about.xml
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/applications/remote-viewer.desktop
2013-02-12 21:59:04 +04:00
%{_datadir}/mime/packages/virt-viewer-mime.xml
%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
%changelog