diff --git a/xrdp.spec b/xrdp.spec index be2f092..6900186 100644 --- a/xrdp.spec +++ b/xrdp.spec @@ -112,27 +112,13 @@ touch %{buildroot}%{_sysconfdir}/xrdp/rsakeys.ini %post -if [ $1 -eq 1 ] ; then -# Initial installation - /bin/systemctl daemon-reload >/dev/null 2>&1 || : -fi +%systemd_post xrdp.service %preun -if [ $1 -eq 0 ] ; then -# Package removal, not upgrade - /bin/systemctl --no-reload disable xrdp.service > /dev/null 2>&1 || : - /bin/systemctl stop xrdp.service > /dev/null 2>&1 || : -fi +%systemd_preun xrdp.service %postun -/bin/systemctl daemon-reload >/dev/null 2>&1 || : -if [ $1 -ge 1 ] ; then -# Package upgrade, not uninstall - if [ "`/bin/systemctl is-active xrdp.service`" = 'active' ]; then - /bin/systemctl stop xrdp.service >/dev/null 2>&1 || : - /bin/systemctl start xrdp.service >/dev/null 2>&1 || : - fi -fi +%systemd_postun_with_restart xrdp.service %triggerun -- xrdp < 0.6.0-1 /usr/bin/systemd-sysv-convert --save xrdp >/dev/null 2>&1 ||: @@ -194,6 +180,9 @@ fi %attr(0600,root,root) %verify(not size md5 mtime) %{_sysconfdir}/xrdp/rsakeys.ini %changelog +* Mon Dec 8 2014 Bojan Smojver - 0.6.1-6 +- use systemd rpm macros: bug #850374 + * Thu Aug 21 2014 Kevin Fenzi - 0.6.1-5 - Rebuild for rpm bug 1131960