[xinetd] Add systemd-rpm macros

jsynacek jsynacek at fedoraproject.org
Wed Aug 22 08:59:48 UTC 2012


commit 165251f091dabc6e577da92a788170072779b845
Author: Jan Synacek <jsynacek at redhat.com>
Date:   Wed Aug 22 10:56:50 2012 +0200

    Add systemd-rpm macros
    
    Resolves: #850370

 xinetd.spec |   30 +++++-------------------------
 1 files changed, 5 insertions(+), 25 deletions(-)
---
diff --git a/xinetd.spec b/xinetd.spec
index 4e60b37..fbd0d34 100644
--- a/xinetd.spec
+++ b/xinetd.spec
@@ -136,35 +136,13 @@ mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
 install -m 644 %SOURCE3 $RPM_BUILD_ROOT/etc/sysconfig/xinetd
 
 %post
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    /bin/systemctl enable xinetd.service >/dev/null 2>&1 || :
-fi
+%systemd_post xinetd.service
 
 %preun
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    /bin/systemctl --no-reload disable xinetd.service > /dev/null 2>&1 || :
-    /bin/systemctl stop xinetd.service > /dev/null 2>&1 || :
-fi
+%systemd_preun xinetd.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    /bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || :
-fi
-
-%triggerun -- xinetd < 2:2.3.14-37
-# Save the current service runlevel info
-# User must manually run systemd-sysv-convert --apply xinetd
-# to migrate them to systemd targets
-/usr/bin/systemd-sysv-convert --save xinetd >/dev/null 2>&1 ||:
-/bin/systemctl --no-reload enable xinetd.service >/dev/null 2>&1 ||:
-
-# Run these because the SysV package being removed won't do them
-/sbin/chkconfig --del xinetd >/dev/null 2>&1 || :
-/bin/systemctl try-restart xinetd.service >/dev/null 2>&1 || :
+%systemd_postun_with_restart xinetd.service
 
 %files
 %doc CHANGELOG COPYRIGHT README xinetd/sample.conf contrib/empty.conf
@@ -178,6 +156,8 @@ fi
 %changelog
 * Wed Aug 22 2012 Jan Synáček <jsynacek at redhat.com> - 2:2.3.15-3
 - Replace the makeinstall macro
+- Add systemd-rpm macros
+- Resolves: #850370
 
 * Sun Jul 22 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2:2.3.15-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild


More information about the scm-commits mailing list