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
# 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
##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}

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

%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

%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.

%setup -q -n FreeRDP-stable-2.0
##patch0 -p1
##patch1 -p1

if [ -z "$SOURCE_DATE_EPOCH" ]; then
find . -type f -name "*.c" -exec perl -i -pe 's{__(DATE|TIME)__}{""}g' "{}" "+"
%if %{__isa_bits} == 64
 export LDFLAGS="-pie"
 export CFLAGS="%{optflags} -fPIE -pie"
#export CFLAGS=" %%{optflags}"
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_X11=ON \
    -DWITH_XI=ON \
    -DWITH_XV=ON \
    -DWITH_SSE2=ON \

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

make %{?_smp_mflags}

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

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

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


%doc LICENSE ChangeLog

%files -n %{libname}
%dir %{_libdir}/freerdp2

%files devel

openSUSE Build Service is sponsored by