- add support for systemd

This commit is contained in:
Itamar Reis Peixoto 2012-02-04 21:36:33 -02:00
parent 86e0ee81c3
commit 1880550ff3

View File

@ -2,17 +2,15 @@
Summary: Open source remote desktop protocol (RDP) server Summary: Open source remote desktop protocol (RDP) server
Name: xrdp Name: xrdp
Version: 0.5.0 Version: 0.6.0
Release: 0.15%{?dist} Release: 1.0%{?dist}
License: GPLv2+ with exceptions License: GPLv2+ with exceptions
Group: Applications/Internet Group: Applications/Internet
URL: http://xrdp.sourceforge.net/ URL: http://xrdp.sourceforge.net/
Source0: http://server1.xrdp.org/xrdp/xrdp-HEAD-a9cfc23.tar.gz Source0: http://server1.xrdp.org/xrdp/xrdp-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: xrdp-pam-auth.patch Patch0: xrdp-pam-auth.patch
Patch1: xrdp-use-xinitrc-in-startm-sh.patch Patch1: xrdp-use-xinitrc-in-startm-sh.patch
Patch2: xrdp-0.5.0-version.patch
Source1: xrdp.init Source1: xrdp.init
Source2: xrdp.sysconfig Source2: xrdp.sysconfig
@ -25,18 +23,15 @@ BuildRequires: automake
BuildRequires: libtool BuildRequires: libtool
Buildrequires: libX11-devel Buildrequires: libX11-devel
BuildRequires: libXfixes-devel BuildRequires: libXfixes-devel
BuildRequires: systemd-units
#vnc-server provides Xvnc (tigervnc-server in fedora) #vnc-server provides Xvnc (tigervnc-server in fedora)
Requires: tigervnc-server-minimal Requires: tigervnc-server-minimal
#initscripts requires Requires(post): systemd-units
Requires(post): chkconfig Requires(preun): systemd-units
Requires(preun): chkconfig Requires(postun): systemd-units
# This is for /sbin/service Requires(post): systemd-sysv
Requires(preun): initscripts
# This is for /sbin/service
Requires(postun): initscripts
%description %description
The goal of this project is to provide a fully functional Linux terminal The goal of this project is to provide a fully functional Linux terminal
@ -44,10 +39,9 @@ server, capable of accepting connections from rdesktop and Microsoft's own
terminal server / remote desktop clients. terminal server / remote desktop clients.
%prep %prep
%setup -q -n xrdp-HEAD-a9cfc23 %setup -q -n %{name}-%{version}
%patch0 -p2 %patch0 -p2
%patch1 -p2 %patch1 -p2
%patch2 -p2
# remove unused modules from xrdp login combobox # remove unused modules from xrdp login combobox
@ -60,9 +54,6 @@ terminal server / remote desktop clients.
# increase encryption to 128 bit's # increase encryption to 128 bit's
%{__sed} -i 's/crypt_level=low/crypt_level=high/g' xrdp/xrdp.ini %{__sed} -i 's/crypt_level=low/crypt_level=high/g' xrdp/xrdp.ini
#fix wrong permission
%{__chmod} 644 keygen/keygen.c
%build %build
./bootstrap ./bootstrap
@ -98,31 +89,38 @@ touch %{buildroot}%{_sysconfdir}/xrdp/rsakeys.ini
%{__chmod} 0600 %{buildroot}%{_sysconfdir}/xrdp/rsakeys.ini %{__chmod} 0600 %{buildroot}%{_sysconfdir}/xrdp/rsakeys.ini
%preun %post
if [ $1 = 0 ] ; then if [ $1 -eq 1 ] ; then
/sbin/service %{name} stop >/dev/null 2>&1 # Initial installation
/sbin/chkconfig --del %{name} /bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi fi
%preun
%post if [ $1 -eq 0 ] ; then
# This adds the proper /etc/rc*.d links for the script # Package removal, not upgrade
/sbin/chkconfig --add %{name} /bin/systemctl --no-reload disable xrdp.service > /dev/null 2>&1 || :
/bin/systemctl stop xrdp.service > /dev/null 2>&1 || :
xrdp-keygen xrdp %{_sysconfdir}/xrdp/rsakeys.ini > /dev/null fi
%{__chmod} 0600 %{_sysconfdir}/xrdp/rsakeys.ini
%postun %postun
if [ "$1" -ge "1" ] ; then /bin/systemctl daemon-reload >/dev/null 2>&1 || :
/sbin/service %{name} condrestart >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart apache-httpd.service >/dev/null 2>&1 || :
fi fi
%clean %triggerun -- xrdp < 0.6.0-1
rm -rf %{buildroot} /usr/bin/systemd-sysv-convert --save xrdp >/dev/null 2>&1 ||:
# If the package is allowed to autostart:
/bin/systemctl --no-reload enable xrdp.service >/dev/null 2>&1 ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del xrdp >/dev/null 2>&1 || :
/bin/systemctl try-restart xrdp.service >/dev/null 2>&1 || :
%files %files
%defattr(-,root,root,-)
%doc COPYING *.txt %doc COPYING *.txt
%dir %{_libdir}/xrdp %dir %{_libdir}/xrdp
%dir %{_sysconfdir}/xrdp %dir %{_sysconfdir}/xrdp
@ -139,6 +137,7 @@ rm -rf %{buildroot}
%{_bindir}/xrdp-sesadmin %{_bindir}/xrdp-sesadmin
%{_bindir}/xrdp-keygen %{_bindir}/xrdp-keygen
%{_bindir}/xrdp-sesrun %{_bindir}/xrdp-sesrun
%{_bindir}/xrdp-dis
%{_bindir}/xrdp-sestest %{_bindir}/xrdp-sestest
%{_sbindir}/xrdp-chansrv %{_sbindir}/xrdp-chansrv
%{_sbindir}/xrdp %{_sbindir}/xrdp
@ -161,10 +160,16 @@ rm -rf %{buildroot}
%{_libdir}/xrdp/libvnc.so %{_libdir}/xrdp/libvnc.so
%{_libdir}/xrdp/libxrdp.so %{_libdir}/xrdp/libxrdp.so
%{_libdir}/xrdp/libxup.so %{_libdir}/xrdp/libxup.so
/lib/systemd/system/xrdp-sesman.service
/lib/systemd/system/xrdp.service
%ghost %{_localstatedir}/log/xrdp-sesman.log %ghost %{_localstatedir}/log/xrdp-sesman.log
%attr(0600,root,root) %verify(not size md5 mtime) %{_sysconfdir}/xrdp/rsakeys.ini %attr(0600,root,root) %verify(not size md5 mtime) %{_sysconfdir}/xrdp/rsakeys.ini
%changelog %changelog
* Sat Feb 04 2012 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.5.0-0.16
- add support for systemd
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-0.15 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-0.15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild