summaryrefslogtreecommitdiff
path: root/virt-viewer.spec.in
blob: 9a7c314018d839cc29141320e2aadb29cd09becc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# -*- 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.
%{!?enable_autotools:%global enable_autotools 0}

%define with_spice 0
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 6
%define with_spice 1
%endif

%define with_govirt 0
%define with_bash_completion 0
%if 0%{?fedora} > 19 || 0%{?rhel} >= 7
%define with_govirt 1
%define with_bash_completion 1
%endif

Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?dist}
Summary: Virtual Machine Viewer
License: GPLv2+
URL: http://gitlab.com/virt-viewer/virt-viewer
Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
Requires: openssh-clients
Requires(post):   %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils

%if %{with_bash_completion}
# Our bash completion script uses virsh to list domains
Requires: libvirt-client
%endif


%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif

BuildRequires: gcc
BuildRequires: pkgconfig(glib-2.0) >= @GLIB2_REQUIRED@
BuildRequires: pkgconfig(gtk+-3.0) >= @GTK_REQUIRED@
BuildRequires: pkgconfig(libvirt) >= @LIBVIRT_REQUIRED@
BuildRequires: pkgconfig(libvirt-glib-1.0) >= @LIBVIRT_GLIB_REQUIRED@
BuildRequires: pkgconfig(libxml-2.0) >= @LIBXML2_REQUIRED@
BuildRequires: pkgconfig(gtk-vnc-2.0) >= @GTK_VNC_REQUIRED@
%if %{with_spice}
BuildRequires: pkgconfig(spice-client-gtk-3.0) >= @SPICE_GTK_REQUIRED@
BuildRequires: pkgconfig(spice-protocol) >= @SPICE_PROTOCOL_REQUIRED@
%endif
BuildRequires: /usr/bin/pod2man
BuildRequires: gettext
%if %{with_govirt}
BuildRequires: pkgconfig(govirt-1.0) >= @GOVIRT_REQUIRED@
BuildRequires: pkgconfig(rest-0.7) >= @REST_REQUIRED@
%endif
%if %{with_bash_completion}
BuildRequires: pkgconfig(bash-completion) >= @BASH_COMPLETION_REQUIRED@
%endif

%if 0%{?fedora} >= 20
Obsoletes: spice-client < 0.12.3-2
%endif


%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.

%prep
%setup -q

%build

%if 0%{?enable_autotools}
autoreconf -if
%endif

%if %{with_spice}
%define spice_arg --with-spice-gtk
%else
%define spice_arg --without-spice-gtk
%endif

%if %{with_govirt}
%define govirt_arg --with-ovirt
%endif

%configure %{spice_arg} %{govirt_arg} --with-buildid=%{release} --disable-update-mimedb
%__make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
%__make install  DESTDIR=$RPM_BUILD_ROOT
%find_lang %{name}


%files -f %{name}.lang
%doc README.md COPYING AUTHORS ChangeLog NEWS
%{_bindir}/%{name}
%{_bindir}/remote-viewer
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/icons/hicolor/*/devices/*
%{_datadir}/applications/remote-viewer.desktop
%{_datadir}/appdata/remote-viewer.appdata.xml
%{_datadir}/mime/packages/virt-viewer-mime.xml
%{_mandir}/man1/virt-viewer.1*
%{_mandir}/man1/remote-viewer.1*
%if %{with_bash_completion}
%{_datadir}/bash-completion/completions/virt-viewer
%endif

%changelog