File freerdp.spec of Package freerdp

# spec file for package freerdp
# Copyright (c) 2014 SUSE LINUX Products 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

%define libname libfreerdp-1_0

Name:           freerdp
Version:        1.0.2
Release:        0
Summary:        Remote Desktop Viewer Client
License:        Apache-2.0
Group:          Productivity/Networking/Other
Source1:        FindALSA.cmake
# PATCH-FIX-UPSTREAM freerdp-fix-FindPCSC-macro.patch -- Fix the build by setting PCSC_LIBRARIES and PCSC_INCLUDE_DIRS variables explicitly which are otherwise empty
Patch1:         freerdp-fix-FindPCSC-macro.patch
# PATCH-FIX-UPSTREAM freerdp-fix-pulse-no-device-name.patch bnc#785437 -- Fix a segfault in case device name is not provided
Patch4:         freerdp-handle-null-device-name.patch
# PATCH-FIX-UPSTREAM (wip) fix handle of kpdivide on keypad - issue #831
Patch5:         freerdp_branch-1.0.x_fix-kpdivide-issue831.patch
# PATCH-FIX-UPSTREAM freerdp-CVE-2014-0250.patch bnc#880317 - backport from upstream 
Patch6:         freerdp-CVE-2014-0250.patch
Patch7:         freerdp-CVE-2014-0791.patch
BuildRequires:  alsa-devel
BuildRequires:  cmake
BuildRequires:  cups-devel
BuildRequires:  ed
BuildRequires:  libopenssl-devel
BuildRequires:  libpulse-devel
BuildRequires:  pcsc-lite-devel
BuildRequires:  xmlto
BuildRequires:  xorg-x11-devel
BuildRequires:  zlib-devel
Recommends:     libfreerdp-plugins
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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

%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 -n %{libname}-plugins
Summary:        Plugins for %{libname}
Group:          System/Libraries
Provides:       libfreerdp-plugins = %{version}
Requires:       %{libname} = %{version}

%description -n %{libname}-plugins
This package provides plugins for %{libname}.

%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-%{version}
%patch1 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
# use a versioned subdirectory for plugins in order to comply with the shared
# library policy
ed -s CMakeLists.txt 2>/dev/null <<'EOF'
%if 0%{?sles_version} == 11
    cp %SOURCE1 cmake/

mkdir build
cd build
export CFLAGS="%{optflags} -DOPENSSL_LOAD_CONF"
cmake \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_BUILD_TYPE=Release \
%ifarch %ix86 x86_64
    -DWITH_SSE2=ON \
make %{?_smp_mflags} VERBOSE=1

cd build
make install 'DESTDIR=%{buildroot}'

# remove keymaps as we make use of libxkbfile
# rm -rf $RPM_BUILD_ROOT/usr/share/freerdp/keymaps/

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

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


%files -n %{libname}

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

%files devel
%dir %{_includedir}/freerdp
%dir %{_includedir}/freerdp/*

openSUSE Build Service is sponsored by