041d3ce
%global _hardened_build 1
041d3ce
4faf1d1
Summary:   Open source remote desktop protocol (RDP) server
4faf1d1
Name:      xrdp
0f6603a
Epoch:     1
19dd11b
Version:   0.9.2
c248a7d
Release:   4%{?dist}
1b680bd
License:   ASL 2.0
4faf1d1
Group:     Applications/Internet
5c6b1d1
URL:       http://www.xrdp.org/
5c6b1d1
Source0:   https://github.com/neutrinolabs/xrdp/releases/download/v%{version}/xrdp-%{version}.tar.gz
310bc76
Source1:   xrdp-sesman.pamd
310bc76
Source2:   xrdp.sysconfig
310bc76
Source3:   xrdp.logrotate
703134b
Source4:   openssl.conf
2824937
Source5:   README.Fedora
0e2197f
Patch0:    xrdp-0.9.2-sesman.patch
19dd11b
Patch1:    xrdp-0.9.2-xrdp-ini.patch
19dd11b
Patch2:    xrdp-0.9.2-service.patch
4faf1d1
dcc8234
BuildRequires: libX11-devel
1880550
BuildRequires: libXfixes-devel
310bc76
BuildRequires: libXrandr-devel
6aa3c55
BuildRequires: openssl
6aa3c55
BuildRequires: pam-devel
a8b78e2
BuildRequires: pkgconfig(fuse)
a8b78e2
BuildRequires: pkgconfig(openssl)
a8b78e2
BuildRequires: pkgconfig(pixman-1)
a8b78e2
BuildRequires: pkgconfig(systemd)
ef84d9f
BuildRequires: nasm
310bc76
5e20737
# tigervnc-server-minimal provides Xvnc (default for now)
5e20737
Requires: tigervnc-server-minimal
5e20737
# xorgxrdp is another back end (small, so require it too)
d3c6495
Requires: xorgxrdp
9b7edb4
Requires: xorg-x11-xinit
c248a7d
Requires: util-linux
4faf1d1
310bc76
Requires(post): systemd
1880550
Requires(post): systemd-sysv
2d35ec0
Requires(posttrans): openssl
310bc76
Requires(preun): systemd
2d35ec0
Requires(posttrans): systemd
310bc76
4faf1d1
74dabc2
%package devel
74dabc2
Summary: Headers and pkg-config files needed to compile xrdp backends
74dabc2
4faf1d1
%description
ca5aa8f
xrdp provides a fully functional RDP server compatible with a wide range
ca5aa8f
of RDP clients, including FreeRDP and Microsoft RDP client.
4faf1d1
74dabc2
%description devel
74dabc2
This package contains headers necessary for developing xrdp backends that
74dabc2
talk to xrdp.
74dabc2
4faf1d1
%prep
b3f7769
%autosetup -p1
2824937
%{__cp} %{SOURCE5} .
2fab812
d37d973
# create 'bash -l' based startwm, to pick up PATH etc.
d37d973
echo '#!/bin/bash -l
d37d973
. %{_sysconfdir}/xrdp/startwm.sh' > sesman/startwm-bash.sh
d37d973
4faf1d1
%build
c248a7d
# Do not detect prctl.h
c248a7d
export ac_cv_header_sys_prctl_h=no
6277dba
%configure --enable-fuse --enable-pixman --enable-painter
8524738
%make_build
4faf1d1
4faf1d1
%install
8524738
%make_install
4faf1d1
4faf1d1
#install sesman pam config /etc/pam.d/xrdp-sesman
310bc76
%{__install} -Dp -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pam.d/xrdp-sesman
4faf1d1
4faf1d1
#install xrdp sysconfig /etc/sysconfig/xrdp
310bc76
%{__install} -Dp -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/xrdp
4faf1d1
4faf1d1
#install logrotate /etc/logrotate.d/xrdp
310bc76
%{__install} -Dp -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/xrdp
4faf1d1
1ab54b8
#install openssl.conf /etc/xrdp
703134b
%{__install} -Dp -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/xrdp/openssl.conf
1ab54b8
d37d973
#install 'bash -l' startwm script
d37d973
%{__install} -Dp -m 755 sesman/startwm-bash.sh %{buildroot}%{_sysconfdir}/xrdp/startwm-bash.sh
d37d973
4faf1d1
%post
ccdfc5c
%systemd_post xrdp.service
4faf1d1
1880550
%preun
ccdfc5c
%systemd_preun xrdp.service
993073e
if [ $1 -eq 0 ]; then
993073e
  # Stop services on package removal (see bug 1349083)
993073e
  systemctl stop xrdp.service > /dev/null 2>&1 || :
993073e
fi
4faf1d1
1880550
%triggerun -- xrdp < 0.6.0-1
6fa5239
systemd-sysv-convert --save xrdp >/dev/null 2>&1 ||:
1880550
1880550
# If the package is allowed to autostart:
6fa5239
systemctl preset xrdp.service >/dev/null 2>&1 ||:
1880550
1880550
# Run these because the SysV package being removed won't do them
1880550
/sbin/chkconfig --del xrdp >/dev/null 2>&1 || :
6fa5239
if [ "`systemctl is-active xrdp.service`" = 'active' ]; then
6fa5239
    systemctl stop xrdp.service >/dev/null 2>&1 || :
6fa5239
    systemctl start xrdp.service >/dev/null 2>&1 || :
c17bb4d
fi
4faf1d1
7271948
%posttrans
7271948
if [ ! -s %{_sysconfdir}/xrdp/rsakeys.ini ]; then
81cb103
  (umask 377; %{_bindir}/xrdp-keygen xrdp %{_sysconfdir}/xrdp/rsakeys.ini >/dev/null)
7271948
fi
7271948
chmod 400 %{_sysconfdir}/xrdp/rsakeys.ini
7271948
7271948
if [ ! -s %{_sysconfdir}/xrdp/cert.pem ]; then
7271948
  (umask 377; openssl req -x509 -newkey rsa:2048 -sha256 -nodes -days 3652 \
7271948
    -keyout %{_sysconfdir}/xrdp/key.pem \
7271948
    -out %{_sysconfdir}/xrdp/cert.pem \
7271948
    -config %{_sysconfdir}/xrdp/openssl.conf >/dev/null 2>&1)
7271948
fi
7271948
chmod 400 %{_sysconfdir}/xrdp/cert.pem
7271948
chmod 400 %{_sysconfdir}/xrdp/key.pem
7271948
4faf1d1
4faf1d1
%files
2824937
%doc COPYING *.txt README.Fedora
4faf1d1
%dir %{_libdir}/xrdp
4faf1d1
%dir %{_sysconfdir}/xrdp
6e84605
%dir %{_sysconfdir}/xrdp/pulse
4faf1d1
%dir %{_datadir}/xrdp
4faf1d1
%config(noreplace) %{_sysconfdir}/xrdp/xrdp.ini
4faf1d1
%config(noreplace) %{_sysconfdir}/pam.d/xrdp-sesman
4faf1d1
%config(noreplace) %{_sysconfdir}/logrotate.d/xrdp
4faf1d1
%config(noreplace) %{_sysconfdir}/sysconfig/xrdp
310bc76
%config(noreplace) %{_sysconfdir}/xrdp/sesman.ini
ab7b4e9
%exclude %{_sysconfdir}/xrdp/xrdp.sh
1ab54b8
%exclude %ghost %{_sysconfdir}/xrdp/*.pem
1ab54b8
%exclude %ghost %{_sysconfdir}/xrdp/rsakeys.ini
df20ba5
%{_sysconfdir}/xrdp/km*.ini
1ab54b8
%{_sysconfdir}/xrdp/openssl.conf
ab7b4e9
%{_sysconfdir}/xrdp/startwm*.sh
310bc76
%{_sysconfdir}/xrdp/xrdp_keyboard.ini
df20ba5
%{_bindir}/xrdp-genkeymap
4faf1d1
%{_bindir}/xrdp-sesadmin
4faf1d1
%{_bindir}/xrdp-keygen
4faf1d1
%{_bindir}/xrdp-sesrun
88d0b98
%{_bindir}/xrdp-dis
4faf1d1
%{_sbindir}/xrdp-chansrv
4faf1d1
%{_sbindir}/xrdp
4faf1d1
%{_sbindir}/xrdp-sesman
4faf1d1
%{_datadir}/xrdp/ad256.bmp
4faf1d1
%{_datadir}/xrdp/cursor0.cur
4faf1d1
%{_datadir}/xrdp/cursor1.cur
4faf1d1
%{_datadir}/xrdp/xrdp256.bmp
4faf1d1
%{_datadir}/xrdp/sans-10.fv1
df20ba5
%{_datadir}/xrdp/ad24b.bmp
df20ba5
%{_datadir}/xrdp/xrdp24b.bmp
310bc76
%{_datadir}/xrdp/xrdp_logo.bmp
4faf1d1
%{_mandir}/man5/*
4faf1d1
%{_mandir}/man8/*
310bc76
%{_mandir}/man1/*
19dd11b
%{_libdir}/lib*.so.*
19dd11b
%exclude %{_libdir}/librfxencode.so
4faf1d1
%{_libdir}/xrdp/lib*.so.*
e27e31d
%exclude %{_libdir}/xrdp/libcommon.so
4faf1d1
%{_libdir}/xrdp/libmc.so
e27e31d
%exclude %{_libdir}/xrdp/libscp.so
4faf1d1
%{_libdir}/xrdp/libvnc.so
e27e31d
%exclude %{_libdir}/xrdp/libxrdp.so
4faf1d1
%{_libdir}/xrdp/libxup.so
e27e31d
%exclude %{_libdir}/xrdp/libxrdpapi.so
310bc76
%{_sysconfdir}/xrdp/pulse/default.pa
310bc76
%{_unitdir}/xrdp-sesman.service
310bc76
%{_unitdir}/xrdp.service
6277dba
%exclude %{_includedir}/painter.h
6277dba
%exclude %{_libdir}/libpainter.*
6277dba
%exclude %{_libdir}/pkgconfig/libpainter.pc
19dd11b
%exclude %{_libdir}/*.a
19dd11b
%exclude %{_libdir}/*.la
91f91dc
%exclude %{_libdir}/xrdp/*.a
91f91dc
%exclude %{_libdir}/xrdp/*.la
7e49690
%ghost %{_localstatedir}/log/xrdp.log
4faf1d1
%ghost %{_localstatedir}/log/xrdp-sesman.log
4faf1d1
74dabc2
%files devel
5504de0
%{_includedir}/xrdp*
19dd11b
%{_includedir}/rfxcodec_*.h
74dabc2
%{_libdir}/pkgconfig/xrdp.pc
19dd11b
%{_libdir}/pkgconfig/rfxcodec.pc
74dabc2
4faf1d1
%changelog
c248a7d
* Fri Apr  7 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.2-4
c248a7d
- Do not call prctl() from xrdp, use setpriv instead
c248a7d
2824937
* Tue Apr  4 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.2-3
2824937
- Do not attempt xrdp restarts, may cause dnf transaction problems
2824937
- Stop depending on Xorg server, xorgxrdp already does
2824937
- Add README.Fedora
2824937
2824937
* Mon Apr  3 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.2-2
9b7edb4
- Stop using /usr/libexec/Xorg, not present on EL7
9b7edb4
19dd11b
* Fri Mar 31 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.2-1
19dd11b
- Bump up to 0.9.2
19dd11b
5e20737
* Tue Mar 14 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.1-8
5e20737
- Require tigervnc-server-minimal again, make it default
5e20737
- Comment out references to X11rdp
5e20737
3c9d286
* Fri Mar 10 2017 Pavel Roskin <plroskin@gmail.com> - 1:0.9.1-7
3c9d286
- Require /etc/X11/xinit/Xsession, it's called from startwm.sh
81cb103
- Call xrdp-keygen with full path in %posttrans
e27e31d
- Exclude *.so files for non-modules
3c9d286
d3c6495
* Thu Mar 09 2017 Pavel Roskin <plroskin@gmail.com> - 1:0.9.1-6
d3c6495
- Make xrdp depend on xorgxrdp, not on tigervnc-server-minimal
d3c6495
- Make Xorg backend default
d3c6495
- Call /usr/libexec/Xorg directly to avoid permission checks
d3c6495
2d35ec0
* Tue Feb 21 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.1-5
2d35ec0
- Require openssl in posttrans phase
2d35ec0
- Move conditional restart to posttrans phase
2d35ec0
7271948
* Mon Feb 20 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.1-4
7271948
- Move key/cert generation to posttrans stage
7271948
341ecd4
* Thu Feb 16 2017 Bojan Smojver <bojan@rexurive.com> - 1:0.9.1-3
341ecd4
- Fix log file rotation
341ecd4
3a33d2e
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.9.1-2
3a33d2e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
3a33d2e
041d3ce
* Tue Feb 07 2017 Pavel Roskin <plroskin@gmail.com> - 1:0.9.1-2
041d3ce
- Enable hardened build
041d3ce
c02680c
* Tue Jan 24 2017 Pavel Roskin <plroskin@gmail.com> - 1:0.9.1-1
dcc8234
- Split out xrdp-devel
dcc8234
- Generate certificate for TLS authentication on package install
dcc8234
- Add fastpath hotfix
dcc8234
- Fix stopping services on package uninstall
dcc8234
- Use packaged pixman library
6277dba
- Enable libpainter for compatibility with "noorders" clients
c02680c
- Upgrade to 0.9.1
dd6ac31
30049d3
* Sun Mar 13 2016 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 1:0.9.0-6
30049d3
- enable fuse for drive redirection or clipboard file transfer
30049d3
85c478a
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1:0.9.0-5
85c478a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
85c478a
6e84605
* Mon Jul 20 2015 Bojan Smojver <bojan@rexursive.com> - 1:0.9.0-4
6e84605
- own /etc/xrdp/pulse directory
6e84605
0807851
* Fri Jul 17 2015 Bojan Smojver <bojan@rexursive.com> - 1:0.9.0-3
0807851
- service files fixes and dependencies
0807851
- sesman default configuration
0807851
0bc91fd
* Wed Jul 15 2015 Dan Horák <dan[at]danny.cz> - 1:0.9.0-2
0f6603a
- install epoch back to keep clean upgrade path
0f6603a
310bc76
* Tue Jul 14 2015 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.9.0-1
310bc76
- upgrade to 0.9.0
310bc76
a51d30a
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:0.6.1-11
a51d30a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
a51d30a
7acfd85
* Thu Jun  4 2015 Bojan Smojver <bojan@rexursive.com> - 1:0.6.1-10
7acfd85
- remove -ac from X server calls: bug #1105202
7acfd85
- put other sesman.ini changes into a patch
7acfd85
cfb3ac7
* Fri May 15 2015 Bojan Smojver <bojan@rexursive.com> - 1:0.6.1-9
cfb3ac7
- hopefully better service dependencies
cfb3ac7
ae76cf7
* Thu Apr 23 2015 Dan Horák <dan[at]danny.cz> - 1:0.6.1-8
ae76cf7
- fix upgrade path after the 0.8 bump in 2014-09 by adding Epoch
ae76cf7
bc184a5
* Mon Dec 22 2014 Bojan Smojver <bojan@rexursive.com> - 0.6.1-7
bc184a5
- add a delay loop when connecting to VNC back end
bc184a5
ccdfc5c
* Mon Dec  8 2014 Bojan Smojver <bojan@rexursive.com> - 0.6.1-6
ccdfc5c
- use systemd rpm macros: bug #850374
ccdfc5c
627e77d
* Thu Aug 21 2014 Kevin Fenzi <kevin@scrye.com> - 0.6.1-5
627e77d
- Rebuild for rpm bug 1131960
627e77d
6d28139
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-4
6d28139
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
6d28139
9607308
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
9607308
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
9607308
e71625c
* Tue Apr  1 2014 Bojan Smojver <bojan@rexursive.com> - 0.6.1-2
eeeef36
- try a bump to official 0.6.1
27e2414
- provide format for syslog() call
e71625c
- fix memset() call
48ba454
- fix implicit declarations
eeeef36
9acd09d
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-0.8
9acd09d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
9acd09d
bec09a0
* Tue Jan 29 2013 Dan Horák <dan[at]danny.cz> - 0.6.0-0.7
bec09a0
- fix check for big endian arches (#905411)
bec09a0
a8eba7d
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-0.6
a8eba7d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
a8eba7d
fb46d3e
* Mon May 28 2012 Bojan Smojver <bojan@rexursive.com> - 0.6.0-0.5
fb46d3e
- bind xrdp-sesman.service to xrdp.service, so that restarts work
fb46d3e
- do not use forking style, but run services in the foreground instead
fb46d3e
- dispense with ExecStop, systemd will do that for us
fb46d3e
98bd694
* Sat May 26 2012 Bojan Smojver <bojan@rexursive.com> - 0.6.0-0.4
98bd694
- do explicit stop/start in order to get xrdp-sesman.service up too
98bd694
182f0e8
* Sat May 26 2012 Bojan Smojver <bojan@rexursive.com> - 0.6.0-0.3
182f0e8
- also attempt to restart xrdp-sesman.service (just xrdp.service won't do it)
182f0e8
- stop xrdp-sesman.service when not needed by xrdp.service
182f0e8
7e41e2f
* Fri May 25 2012 Bojan Smojver <bojan@rexursive.com> - 0.6.0-0.2
7e41e2f
- bump release for rebuild with the correct e-mail address
7e41e2f
deb41fa
* Fri May 25 2012 Bojan Smojver <bojan@rexursive.com> - 0.6.0-0.1
c24970c
- more work on systemd support
c24970c
- remove xrdp-dis for now, current HEAD is broken (explicit rpaths)
c24970c
d37d973
* Wed May 23 2012 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.6.0-0.1
d37d973
- include patch's from Bojan Smojver bz#821569 , bz#611669
1880550
c24970c
* Sat Feb 04 2012 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.16
c24970c
- add support for systemd
c24970c
86e0ee8
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-0.15
86e0ee8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
86e0ee8
8625603
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-0.14
8625603
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
8625603
c468641
* Thu Nov 18 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.13
c468641
- up to git tag a9cfc235211a49c69c3cce3f98ee5976ff8103a4
c468641
5a536b6
* Thu Nov 18 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.12.03172010
5a536b6
- fix logrotate to not restart xrdp and drop all open connections
5a536b6
Itamar Reis Peixoto c70e62f
* Mon Oct 04 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.11.03172010
Itamar Reis Peixoto c70e62f
- Load a default keymap when current keymap doesnt exist
Itamar Reis Peixoto c70e62f
ecc73c7
* Thu Jul 08 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.10.03172010
ecc73c7
- fix rhbz #611669 (load environment variables)
ecc73c7
c3501d1
* Thu Mar 18 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.9.03172010
c3501d1
- buildrequires libXfixes-devel
c3501d1
1d453ff
* Thu Mar 18 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.8.03172010
1d453ff
- buildrequires libX11-devel
1d453ff
df20ba5
* Thu Mar 18 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.7.03172010
df20ba5
- sync with last xrdp cvs
df20ba5
859f21f
* Wed Sep 16 2009 Tomas Mraz <tmraz@redhat.com> - 0.5.0-0.6.20090811cvs
859f21f
- use password-auth instead of system-auth
859f21f
fda43e6
* Tue Sep 08 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.5.20090811cvs
fda43e6
- fix xrdp-sesman pam.d to uses system-auth
fda43e6
2fab812
* Fri Sep 04 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.4.20090811cvs
2fab812
- increase encryption to 128 bit's
2fab812
- include system-auth into /etc/pam.d/xrdp-sesman
2fab812
6f274d1
* Wed Aug 26 2009 Tomas Mraz <tmraz@redhat.com> - 0.5.0-0.3.20090811cvs
6f274d1
- rebuild with new openssl
6f274d1
4faf1d1
* Thu Aug 13 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.2.20090811cvs
4faf1d1
- more changes to spec file https://bugzilla.redhat.com/show_bug.cgi?id=516364#c10
4faf1d1
4faf1d1
* Wed Aug 12 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.1.20090811cvs
4faf1d1
- change versioning schema
4faf1d1
- improve initscript
4faf1d1
- fix some macros
4faf1d1
4faf1d1
4faf1d1
* Tue Aug 11 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-2.20090811cvs
4faf1d1
- changes from BZ#516364 comment 2 from Mamoru Tasaka
4faf1d1
- changed license to "GPLv2+ with exceptions"
4faf1d1
- dropped -libs subpackage
4faf1d1
- use cvs version
4faf1d1
- remove a patch and use sed instead
4faf1d1
- remove attr's
4faf1d1
4faf1d1
* Thu Apr 02 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> 0.5.0-1
4faf1d1
- Initial RPM release