File xrdp.spec of Package xrdp

#
# spec file for package xrdp (Version 0.4.1)
#
# Copyright (c) 2009 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 http://bugs.opensuse.org/
#


Url:            http://xrdp.sourceforge.net/

Name:           xrdp
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
Version:        0.4.1
Release:        25
License:        GPL v2 or later
Requires:       dbus-1 xorg-x11-libXau xorg-x11-libxcb xorg-x11-server-dmx xorg-x11-server-rdp
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  dbus-1-devel gcc-c++ glibc-devel libavahi-devel openssl-devel pam-devel pkg-config xorg-x11-libXau-devel xorg-x11-libxcb-devel
Group:          System/X11/Utilities
Summary:        Open Source remote desktop protocol (RDP) server
Source:         http://dl.sf.net/xrdp/xrdp-%{version}.tar.bz2
Source1:        xrdp.fw
Patch0:         xrdp-0.4.1..48f00f.diff.bz2
Patch1:         xrdp-NOMAD.diff
Patch2:         xrdp-avahi.diff
# PATCH-FIX-OPENSUSE xrdp-lsb.patch bnc#442211 - hfiguiere@novell.com
Patch3:         xrdp-lsb.patch
# PATCH-FIX-OPENSSUE xrdp-pam.patch bnc#441750 - hfiguiere@novell.com
Patch4:         xrdp-pam.patch

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



%prep
%setup
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%{__perl} -pi.orig -e 's|/lib\b|/%{_lib}|g' instfiles/*.sh

%build
sh ./bootstrap
%configure
make

%install
%{__make} install DESTDIR=$RPM_BUILD_ROOT
chmod a-x %{buildroot}%{_sysconfdir}/xrdp/*.ini
rm -f %{buildroot}/%{_libdir}/%{name}/*.*a
ln -sf %{_sysconfdir}/init.d/xrdp %{buildroot}/%{_sbindir}/rcxrdp
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
install -m 644 %{S:1} $RPM_BUILD_ROOT/%{_fwdefdir}/xrdp

%clean
rm -rf "$RPM_BUILD_ROOT"

%post
/sbin/ldconfig
/usr/bin/xrdp-keygen xrdp /etc/xrdp/rsakeys.ini

%preun
%stop_on_removal xrdp

%postun
/sbin/ldconfig
%restart_on_update xrdp
%{insserv_cleanup}

%files
%defattr(-,root,root)
%doc COPYING *.txt 
%{_libdir}/xrdp/
%{_sysconfdir}/init.d/xrdp
%doc %{_mandir}/man5/*.5*
%doc %{_mandir}/man8/*.8*
%{_bindir}/xrdp*
%{_sbindir}/*
%{_datadir}/xrdp/
%config(noreplace) %{_sysconfdir}/xrdp/
%config(noreplace) %{_sysconfdir}/pam.d/xrdp-sesman
%config %{_fwdefdir}/xrdp

%changelog
* Thu Feb 05 2009 davidr@novell.com
- Add proper Xdmx keyboard layout handling and allow X server to
  reset when last client disconnects. (bnc#447682) (bnc#442292)
* Thu Jan 22 2009 davidr@novell.com
- Fall-back to regular RDP connection when X11 channel
  fails. (bnc#450142)
- Make sure multiple RDP connections to the same DMX
  session can exist at the same.
* Fri Jan 09 2009 davidr@novell.com
- Fix multiple buffer overflows. (bnc#450898)
* Tue Jan 06 2009 davidr@novell.com
- Properly install firewall definition file. (bnc#460835)
* Mon Jan 05 2009 davidr@novell.com
- Register session as remote. (bnc#441751)
* Tue Dec 23 2008 hfiguiere@suse.de
- Fixed xrdp-pam.patch according the the last comment in bnc#441750
* Tue Dec 23 2008 davidr@novell.com
- Add firewall definition (bnc#460835)
  source: xrdp.fw
* Tue Dec 09 2008 hfiguiere@suse.de
- Added patch xrdp-pam.patch: fix pam config file, and fix pam
  calls to use the proper service name (bnc#441750)
* Sun Nov 23 2008 davidr@novell.com
- Use authorization files for all sessions. (bnc#442223)
- Use authorization file for X11rdp. (bnc#442223)
* Tue Nov 18 2008 davidr@novell.com
- Fix initial screen resolution.
* Wed Nov 12 2008 davidr@novell.com
- Fix X server startup issue.
  * Avoid using unix domain socket files to determine the
  presence of X servers.
* Fri Nov 07 2008 hfiguiere@suse.de
- Remove fuzz from xrdp-avahi.diff
- Add xrdp-lsb.patch
  * Make the init script LSB compliant (bnc#442211)
* Fri Nov 07 2008 hfiguiere@suse.de
- Add /usr/sbin/rcxrdp (bnc#442692)
* Thu Nov 06 2008 ro@suse.de
- fix last change (just adding "#" does not work for
  multiline rpm macros)
* Wed Nov 05 2008 hfiguiere@suse.de
- Don't enable xrdp by default (bnc#441742)
* Mon Oct 27 2008 davidr@novell.com
- Include .so files for modules.
* Mon Oct 27 2008 davidr@novell.com
- Update xrdp-NOMAD.diff
  * Fix zlib compression.
* Sun Oct 12 2008 hfiguiere@suse.de
- Update xrdp-NOMAD.diff
  * Fix openSUSE branding
* Wed Oct 08 2008 hfiguiere@suse.de
- Update xrdp-avahi.diff
  * remove warnings for missing prototypes.
* Wed Sep 17 2008 hfiguiere@suse.de
- Update xrdp-NOMAD.diff
  * Fix Xdmx command line arguments
  * Fix session data matching for XDMX sessions
* Thu Sep 11 2008 hfiguiere@suse.de
- Add Avahi support.
- More comprehensive support of NOMAD.
* Tue Sep 02 2008 hfiguiere@suse.de
- Initial release.