Name:           spice-gtk
Version:        0.35
Release:        4
Summary:        A GIMP Toolkit (GTK+) widget for SPICE clients
License:        LGPLv2+
URL:            https://www.spice-space.org/spice-gtk.html
Source0:        https://www.spice-space.org/download/gtk/%{name}-%{version}%{?_version_suffix}.tar.bz2
Patch0001:      0001-display-Trigger-wheel-scrolling-after-one-click.patch

BuildRequires:  git-core intltool usbredir-devel >= 0.5.2 libusb1-devel >= 1.0.9 pixman-devel libjpeg-turbo-devel
BuildRequires:  celt051-devel pulseaudio-libs-devel opus-devel zlib-devel cyrus-sasl-devel libcacard-devel
BuildRequires:  gobject-introspection-devel libacl-devel polkit-devel gtk-doc vala-tools usbutils
BuildRequires:  libsoup-devel >= 2.49.91 libphodav-devel lz4-devel gtk3-devel spice-protocol >= 0.12.14
BuildRequires:  gstreamer1-devel gstreamer1-plugins-base-devel libxslt openssl-devel
Requires:       spice-gtk3-devel = %{version}-%{release}
Provides:       spice-glib = %{version}-%{release} spice-gtk3 = %{version}-%{release}
Provides:       spice-gtk3-vala = %{version}-%{release} spice-gtk-tools = %{version}-%{release}
Obsoletes:      spice-gtk-python < 0.32 spice-glib < %{version}-%{release} spice-gtk3 < %{version}-%{release}
Obsoletes:      spice-gtk3-vala < %{version}-%{release} spice-gtk-tools < %{version}-%{release}


%description
The spice-gtk packages provide a GIMP Toolkit (GTK+) widget for SPICE (Simple
Protocol for Independent Computing Environments) clients. Both Virtual Machine
Manager and Virtual Machine Viewer can make use of this widget to access virtual
machines using the SPICE protocol.

%package        devel
Summary:        Development files for spice-gtk
Requires:       spice-glib = %{version}-%{release} spice-gtk3 = %{version}-%{release} pkgconfig glib2-devel
Provides:       spice-glib-devel = %{version}-%{release} spice-gtk3-devel = %{version}-%{release}
Obsoletes:      spice-glib-devel < %{version}-%{release} spice-gtk3-devel < %{version}-%{release} spice-gtk-devel < 0.32

%description    devel
The spice-gtk-devel package includes header files and libraries necessary
for the spice-gtk library.

%package        help
Summary:        This package contains help documents
Requires:       %{name} = %{version}-%{release}

%description    help
Files for help with spice-gtk.

%prep
%autosetup -n %{name}-%{version} -p1

%build
%configure --disable-celt051 --enable-gtk-doc --enable-webdav --with-usb-acl-helper-dir=%{_libexecdir}/spice-gtk-%{_arch}/ \
    --enable-lz4 --enable-vala --disable-werror
%make_build V=1

%install
%make_install
%delete_la_and_a
%find_lang %{name}

%post
/sbin/ldconfig

%postun
/sbin/ldconfig

%files -f %{name}.lang
%doc COPYING
%{_libdir}/libspice-client-*.so.*
%{_libdir}/girepository-1.0/SpiceClient*.typelib
%attr(4755, root, root) %{_libexecdir}/spice-gtk-%{_arch}/spice-client-glib-usb-acl-helper
%{_datadir}/polkit-1/actions/*
%{_datadir}/vala/vapi/*
%{_bindir}/*

%files devel
%{_libdir}/libspice-client-*.0.so
%{_includedir}/*
%{_libdir}/pkgconfig/*
%{_datadir}/gir-1.0/*

%files help
%doc AUTHORS README NEWS
%doc %{_datadir}/gtk-doc/html/*
%{_mandir}/man1/spice-client.1*

%changelog
* Mon Nov 25 2019 gulining<gulining1@huawei.com> - 0.35-4
- Pakcage init
