File xrdp.spec of Package xrdp

# spec file for package xrdp
# 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 _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
Name:           xrdp
Version:        0.6.1
Release:        0
Summary:        Open Source remo desktop protocol (RDP) server
License:        Apache-2.0 and GPL-2.0+
Group:          System/X11/Utilities
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libX11-devel
BuildRequires:  libXfixes-devel
BuildRequires:  libavahi-devel
BuildRequires:  libtool
BuildRequires:  openssl-devel
BuildRequires:  pam-devel
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(systemd)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source1:        xrdp.fw
Source2:        sysconfig.xrdp
Patch1:         xrdp-avahi.diff
# PATCH-FIX-OPENSUSE xrdp-lsb.patch bnc#442211 -
Patch2:         xrdp-lsb.patch
# PATCH-FIX-OPENSSUE xrdp-pam.patch bnc#441750 -
Patch3:         xrdp-pam.patch
Patch4:         xrdp-filter-tab-from-mstsc-on-focus-change.patch
Patch5:         xrdp-tab-from-mstsc-updated.patch
# set the default crypto level to high bnc#764044 -
Patch6:         xrdp-change-default-crypto_level.patch
Patch7:         xrdp-add-systemd-support.patch
Patch8:         xrdp-fix-segfaults-in-xrdp-chansrv-code.patch
Patch9:         xrdp-some-minor-changes-to-arch.h.patch

A full functionnal Linux terminal server, capable of accepting
connection from rdesktop and Microsoft's own terminal server / remote
desktop clients.

%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1

sh ./bootstrap
%configure \
make %{?_smp_mflags}

make install DESTDIR=%{buildroot}
find %{buildroot} -name '*.a' -exec rm {} \;
find %{buildroot} -name '*.la' -exec rm -f {} ';'
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
install -m 644 %{S:1} $RPM_BUILD_ROOT/%{_fwdefdir}/xrdp

mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates
install -m 644 %{S:2} $RPM_BUILD_ROOT/%{_localstatedir}/adm/fillup-templates/sysconfig.xrdp

rm -rf %{buildroot}

%service_add_pre xrdp-sesman.service
%service_add_pre xrdp.service

%service_add_post xrdp-sesman.service
%service_add_post xrdp.service
%{fillup_only -n xrdp}
if [ ! -e %{_sysconfdir}/xrdp/rsakeys.ini ]; then
    xrdp-keygen xrdp %{_sysconfdir}/xrdp/rsakeys.ini
    if [ $? -eq 0 ]; then
        echo "Could not generate rsakeys.ini, please check manually!"
exit 0

%service_del_preun xrdp.service
%service_del_preun xrdp-sesman.service

%service_del_postun xrdp.service
%service_del_postun xrdp-sesman.service

%config(noreplace) %{_sysconfdir}/xrdp/
%ghost %config(noreplace) %{_sysconfdir}/xrdp/rsakeys.ini
%config(noreplace) %{_sysconfdir}/pam.d/xrdp-sesman
%config %{_localstatedir}/adm/fillup-templates/sysconfig.xrdp
%doc COPYING *.txt
%doc %{_mandir}/man5/*.5*
%doc %{_mandir}/man8/*.8*
%config %{_fwdefdir}/xrdp

openSUSE Build Service is sponsored by