File virt-viewer.spec of Package virt-viewer
%define realname virt-viewer
%define srcext tar.bz2
# turn off the generation of debuginfo rpm (RH9) ??
%global debug_package %{nil}
%define _bashcompletiondir %(pkg-config --variable=completionsdir bash-completion)
# Common info
Name: %{realname}
Version: 0
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-2.0
Group: Productivity/Networking/Remote Desktop
URL: https://gitlab.com/virt-viewer/virt-viewer
Summary: Graphical viewer for the guest OS display
# Install-time parameters
Requires(post): shared-mime-info
Requires(postun): shared-mime-info
# Build-time parameters
BuildRequires: meson >= 0.54.0 ninja
BuildRequires: pkg-config
BuildRequires: gettext intltool >= 0.35.0
BuildRequires: pkgconfig(glib-2.0) >= 2.48
BuildRequires: pkgconfig(gmodule-2.0) >= 2.48
BuildRequires: pkgconfig(gtk+-3.0) >= 3.18
BuildRequires: pkgconfig(libxml-2.0) >= 2.6.0
BuildRequires: pkgconfig(libvirt) >= 1.2.8
BuildRequires: pkgconfig(libvirt-glib-1.0) >= 0.1.8
BuildRequires: pkgconfig(gtk-vnc-2.0) >= 0.4.0
BuildRequires: pkgconfig(spice-client-glib-2.0) >= 0.35
BuildRequires: pkgconfig(spice-client-gtk-3.0) >= 0.35
BuildRequires: pkgconfig(spice-protocol) >= 0.12.7
### BuildRequires: pkgconfig(govirt-1.0) >= 0.3.3
BuildRequires: pkgconfig(rest-0.7) >= 0.8
BuildRequires: pkgconfig(vte-2.91) >= 0.46.0
BuildRequires: pkgconfig(bash-completion) >= 2.0
%if 0%{?suse_version}
BuildRequires: update-desktop-files
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source: https://virt-manager.org/download/sources/virt-viewer/%{realname}-%{version}%{?extraver}.%{srcext}
%description
Virt Viewer provides a graphical viewer for the guest OS
display. At this time is supports guest OS using the VNC
or SPICE protocols. Further protocols may be supported in
the future as user demand dicatates. The viewer can connect
directly to both local and remotely hosted guest OS, optionally
using SSL/TLS encryption.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%build
_CFLAGS='%{optflags}'
_LDFLAGS='-Wl,--strip-all -Wl,-z,now -Wl,-z,relro'
meson setup build \
--buildtype=release \
--strip \
--optimization=2 \
\
--prefix=%{_prefix} \
--default-library=shared \
\
-Db_lto=%{?gcc_lto:true}%{!?gcc_lto:false} \
-Db_ndebug=if-release \
-Dc_args="$_CFLAGS" \
-Dc_link_args="$_LDFLAGS"
ninja -v -C build %{?_smp_mflags}
%install
DESTDIR=%{buildroot} ninja -v -C build install
%find_lang %{name}
%if "%{expand:%_vendor}" == "suse"
%suse_update_desktop_file -r remote-viewer Network RemoteAccess GTK
%endif
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING NEWS README.md
%{_bindir}/*
%{_datadir}/applications/remote-viewer.desktop
%{_bashcompletiondir}/virt-viewer
%{_datadir}/icons/hicolor/*/apps/virt-viewer.png
%{_datadir}/icons/hicolor/scalable/apps/virt-viewer.svg
%{_datadir}/metainfo/remote-viewer.appdata.xml
%{_datadir}/mime/packages/virt-viewer-mime.xml
%doc %{_mandir}/man1/*
%post
%{_bindir}/update-desktop-database %{_datadir}/applications &> /dev/null || :
%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :
%postun
%{_bindir}/update-desktop-database %{_datadir}/applications &> /dev/null || :
%{_bindir}/update-mime-database %{_datadir}/mime &> /dev/null || :
%changelog