File freerdp.spec of Package freerdp

#
# spec file for package freerdp
#
# Copyright (c) 2017 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 http://bugs.opensuse.org/
#
# Copyright (c) 2020 Hendrik Woltersdorf
#


%define sover 2
%define gitrelease git20210525
# rpm does not automatically find this:
%define libname lib%{name}%{sover}
Name:           freerdp
Version:        2.3.2~%{gitrelease}
Release:        0
Summary:        Remote Desktop Viewer Client
License:        Apache-2.0
Group:          Productivity/Networking/Other
Url:            http://www.freerdp.com/
Source0:        FreeRDP-stable-2.0.zip
##Patch0:         mask_cached_brush.patch
##Patch1:         crash_virt_desk.patch
BuildRequires:  cmake
BuildRequires:  cups-devel
BuildRequires:  dbus-1-glib-devel
BuildRequires:  desktop-file-utils
BuildRequires:  docbook-xsl-stylesheets
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(gstreamer-1.0)
BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
BuildRequires:  pkgconfig(icu-i18n)
BuildRequires:  pkgconfig(libpcsclite)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libsystemd)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(xkbcommon)
BuildRequires:  pkgconfig(xkbfile)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(uuid)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xfixes)
BuildRequires:  pkgconfig(xinerama)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xv)
BuildRequires:  pkgconfig(xdamage)
BuildRequires:  pkgconfig(xtst)
BuildRequires:  ffmpeg
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libusb)
BuildRequires:  libgsm-devel
BuildRequires:  libxml2-devel
BuildRequires:  libxslt-tools
BuildRequires:  unzip
BuildRequires:  libmp3lame-devel
BuildRequires:  cairo-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  libjpeg-devel
Requires:       lib%{name}%{sover} = %{version}-%{release}


%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
Provides:       lib%{name} = %{version}-%{release}

%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 FreeRDP-stable-2.0
##patch0 -p1
##patch1 -p1

%build
if [ -z "$SOURCE_DATE_EPOCH" ]; then
find . -type f -name "*.c" -exec perl -i -pe 's{__(DATE|TIME)__}{""}g' "{}" "+"
fi
%if %{__isa_bits} == 64
 export LDFLAGS="-pie"
 export CFLAGS="%{optflags} -fPIE -pie"
%endif
#export CFLAGS=" %%{optflags}"
# SERVER works only with BUILTIN_CHANNELS=ON
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
    -DCMAKE_INSTALL_LIBDIR:PATH=%{_lib} \
    -DCMAKE_SKIP_INSTALL_RPATH=ON \
    -DWITH_CUPS=ON \
    -DWITH_CLIENT=ON \
    -DWITH_PCSC=ON \
    -DWITH_ALSA=ON \
    -DWITH_PULSE=ON \
    -DWITH_OSS=OFF \
    -DWITH_DIRECTFB=OFF \
    -DWITH_JPEG=ON \
    -DWITH_GSM=ON \
    -DWITH_GSTREAMER_1_0=ON \
    -DWITH_IPP=OFF \
    -DWITH_OPENSSL=ON \
    -DWITH_CHANNELS=ON \
    -DWITH_X11=ON \
    -DWITH_XCURSOR=ON \
    -DWITH_XEXT=ON \
    -DWITH_XKBFILE=ON \
    -DWITH_XI=ON \
    -DWITH_XINERAMA=ON \
    -DWITH_XRENDER=ON \
    -DWITH_XV=ON \
    -DWITH_ZLIB=ON \
    -DWITH_KRB5=OFF \
    -DWITH_GSSAPI=OFF \
    -DBUILTIN_CHANNELS=OFF \
    -DWITH_SERVER=ON \
    -DWITH_SSE2=ON \
    -DWITH_DEBUG_SCARD=OFF \
    -DWITH_SMARTCARD_INSPECT=ON \
    -DWITH_ICU=ON \
    -DWITH_FFMPEG=ON \
    -DWITH_DSP_FFMPEG=ON \
    -DWITH_WAYLAND=OFF \
    -DWITH_SANITIZE_ADDRESS=OFF \
    -DWITH_LIBSYSTEMD=ON \
    -DCMAKE_NO_BUILTIN_CHRPATH=ON \
    -DWITH_LAME=ON \
    -DWITH_CAIRO=ON \
    -DCHANNEL_URBDRC_CLIENT=ON \
    -DCHANNEL_URBDRC=ON \
    .

echo 0%{?suse_version}
echo %{optflags}
echo %{?_smp_mflags}
gcc -v

make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot} INSTALL='install -p'
%fdupes -s %{buildroot}

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

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

%files

%defattr(-,root,root)
%doc LICENSE README.md ChangeLog
%{_bindir}/x%{name}
%{_bindir}/freerdp-shadow-cli
%{_bindir}/freerdp-proxy
%{_bindir}/winpr-hash
%{_bindir}/winpr-makecert
%{_mandir}/man*/*

%files -n %{libname}
%defattr(-,root,root)
%doc LICENSE
%dir %{_libdir}/freerdp2
%{_libdir}/lib*.so.*
%{_libdir}/freerdp2/lib*.so

%files devel
%defattr(-,root,root)
%{_includedir}/freerdp2/
%{_includedir}/winpr2/
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/%{name}*.pc
%{_libdir}/pkgconfig/winpr*2.pc
%{_libdir}/cmake/FreeRDP*/
%{_libdir}/cmake/WinPR2/

%changelog
openSUSE Build Service is sponsored by