Name:           spice
Version:        0.14.3
Release:        3
Summary:        Implements the SPICE protocol
Group:          User Interface/Desktops
License:        LGPLv2+
URL:            https://www.spice-space.org/
Source0:        https://www.spice-space.org/download/releases/%{name}-%{version}.tar.bz2
Source1:        https://www.spice-space.org/download/releases/%{name}-%{version}.tar.bz2.sign
Source2:        victortoso-E37A484F.keyring

Patch6000:      backport-0001-CVE-2020-14355.patch
Patch6001:      backport-0002-CVE-2020-14355.patch
Patch6002:      backport-0003-CVE-2020-14355.patch
Patch6003:      backport-0004-CVE-2020-14355.patch
Patch6004:      backport-0001-CVE-2021-20201.patch
Patch6005:      backport-0002-CVE-2021-20201.patch

ExclusiveArch:  %{ix86} x86_64 %{arm} aarch64

BuildRequires:  gcc pkgconfig glib2-devel spice-protocol >= 0.14.0 opus-devel git-core gnupg2
BuildRequires:  pixman-devel openssl-devel libjpeg-devel libcacard-devel cyrus-sasl-devel
BuildRequires:  lz4-devel gstreamer1-devel gstreamer1-plugins-base-devel orc-devel 

%description
The SPICE package provides the SPICE server library and client.
These components are used to provide access to a remote machine's
display and devices.

%package        server
Summary:        Implements the server side of the SPICE protocol
Obsoletes:      spice-client < %{version}-%{release}

%description    server
This package contains the run-time libraries for any application that wishes
to be a SPICE server and is used to expose a remote machine's display and devices.

%package        server-devel
Summary:        Header files and development files for %{name}-server
Requires:       %{name}-server  pkgconfig
  
%description    server-devel
The %{name}-server-devel package contains static libraries and header files for
developing applications that use %{name}-server.

%package_help

%prep
gpgv2 --quiet --keyring %{SOURCE2} %{SOURCE1} %{SOURCE0}
%autosetup -n %{name}-%{version} -p1

%build
%define configure_client --disable-client
%configure --enable-smartcard --disable-client --enable-lz4 --enable-gstreamer=1.0 --disable-celt051
%make_build WARN_CFLAGS='' V=1

%install
make DESTDIR=%{buildroot} install
%delete_la_and_a
install -d  %{buildroot}%{_libexecdir}

%ldconfig_scriptlets server

%files server
%defattr(-,root,root)
%license COPYING
%{_libdir}/libspice-server.so.*

%files server-devel
%defattr(-,root,root)
%{_includedir}/spice-server/*.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libspice-server.so

%files help
%defattr(-,root,root)
%doc README

%changelog
* Mon Jun 07 2021 wangkerong <wangkerong@huawei.com> - 0.14.3-3
- Type:CVE
- Id:CVE-2021-20201
- SUG:NA
- DESC:fix CVE-2021-20201

* Tue Feb 23 2021 jinzhimin <jinzhimin2@huawei.com> - 0.14.3-2
- fix CVE-2020-14355

* Sun Oct 4 2020 jinzhimin<jinzhimin2@huawei.com> - 0.14.3-1
- update to 0.14.3

* Fri Oct 11 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.14.0-6
- Package init

