File freerdp.spec of Package freerdp.6948

#
# spec file for package freerdp
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define sover 2

Name:           freerdp
Version:        2.0.0~git.1463131968.4e66df7
Release:        0
Summary:        Remote Desktop Viewer Client
License:        Apache-2.0
Group:          Productivity/Networking/Other
Url:            http://www.freerdp.com/
Source0:        %{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM freerdp-Fix-TALOS-issues.patch bsc#1050699 bsc#1050704 bsc#1050708 bsc#1050711 bsc#1050712 bsc#1050714 fezhang@suse.com -- Fix a bunch of secury issues: CVE-2017-2834, CVE-2017-2835, CVE-2017-2836, CVE-2017-2837, CVE-2017-2838, CVE-2017-2839 
Patch0:         freerdp-Fix-TALOS-issues.patch
Patch1:         freerdp-KB408876.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-8789.patch boo#1117965 fezhang@suse.com -- Fix CVE-2018-8789
Patch2:         freerdp-CVE-2018-8789.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-8785.patch boo#1117967 fezhang@suse.com -- Fix CVE-2018-8785
Patch3:         freerdp-CVE-2018-8785.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-8786.patch boo#1117966 fezhang@suse.com -- Fix CVE-2018-8786
Patch4:         freerdp-CVE-2018-8786.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-8787.patch boo#1117964 fezhang@suse.com -- Fix CVE-2018-8787
Patch5:         freerdp-CVE-2018-8787.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-8788.patch boo#1117963 fezhang@suse.com -- Fix CVE-2018-8788
Patch6:         freerdp-CVE-2018-8788.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-8784.patch boo#1116708 fezhang@suse.com -- Fix CVE-2018-8784
Patch7:         freerdp-CVE-2018-8784.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2018-1000852.patch boo#1120507 fezhang@suse.com -- Fix CVE-2018-1000852
Patch8:         freerdp-CVE-2018-1000852.patch
BuildRequires:  alsa-devel
BuildRequires:  cmake
BuildRequires:  cups-devel
BuildRequires:  ed
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gstreamer-devel
BuildRequires:  gstreamer-plugins-base-devel
BuildRequires:  libopenssl-devel
BuildRequires:  libpulse-devel
BuildRequires:  libxkbcommon-devel
BuildRequires:  pcsc-lite-devel
BuildRequires:  systemd-devel
BuildRequires:  xmlto
BuildRequires:  xorg-x11-devel
BuildRequires:  zlib-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%define libname lib%{name}%{sover}

%description
FreeRDP is a client-side implementation of the Remote Desktop Protocol (RDP)
following the Microsoft Open Specifications. This package provides the client
application.

%package -n %{libname}
Summary:        Remote Desktop Viewer Library
Group:          System/Libraries
Obsoletes:      libfreerdp-1_0-plugins

%description -n %{libname}
FreeRDP is a client-side implementation of the Remote Desktop Protocol (RDP)
following the Microsoft Open Specifications. This package provides the shared
library.

%package devel
Summary:        Development Files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version}

%description devel
This package contains development files necessary for developing applications
based on libfreerdp.

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1

%build
find . -type f -name "*.c" -exec perl -i -pe 's{__(DATE|TIME)__}{""}g' "{}" "+"
%cmake \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_INSTALL_LIBDIR=%{_lib} \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_ALSA=ON \
    -DWITH_PULSEAUDIO=ON \
    -DWITH_PCSC=ON \
    -DWITH_CUPS=ON \
    -DCMAKE_NO_BUILTIN_CHRPATH=ON \
%ifarch %ix86 x86_64
    -DWITH_SSE2=ON \
%endif
    ..
make %{?_smp_mflags} VERBOSE=1

%install
cd build
make install 'DESTDIR=%{buildroot}'
find %{buildroot} -name "*.a" -delete
%fdupes -s %{buildroot}

%post   -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc LICENSE README ChangeLog
%{_bindir}/winpr-hash
%{_bindir}/winpr-makecert
%{_bindir}/xfreerdp
%{_mandir}/man1/xfreerdp.1%{ext_man}

%files -n %{libname}
%defattr(-,root,root)
%doc LICENSE
%{_libdir}/libfreerdp-client.so.*
%{_libdir}/libfreerdp.so.*
%{_libdir}/libwinpr.so.*
%{_libdir}/libwinpr-tools.so.*

%files devel
%defattr(-,root,root)
%doc LICENSE
%{_includedir}/freerdp2
%{_includedir}/winpr2
%{_libdir}/cmake/FreeRDP2
%{_libdir}/cmake/FreeRDP-Client2
%{_libdir}/cmake/WinPR2
%{_libdir}/libfreerdp-client.so
%{_libdir}/libfreerdp.so
%{_libdir}/libwinpr.so
%{_libdir}/libwinpr-tools.so
%{_libdir}/pkgconfig/freerdp2.pc
%{_libdir}/pkgconfig/freerdp-client2.pc
%{_libdir}/pkgconfig/winpr2.pc
%{_libdir}/pkgconfig/winpr-tools2.pc

%changelog
openSUSE Build Service is sponsored by