[bootparamd] Add postun section in spec file

Lukáš Nykrýn lnykryn at fedoraproject.org
Mon Sep 5 15:51:07 UTC 2011


commit d2d9bc783c1d759be7fc11e3fc0f1d9aeda9d5d0
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Mon Sep 5 17:50:26 2011 +0200

    Add postun section in spec file

 bootparamd.spec |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/bootparamd.spec b/bootparamd.spec
index 24b924a..fcba451 100644
--- a/bootparamd.spec
+++ b/bootparamd.spec
@@ -1,7 +1,7 @@
 Summary: A server process which provides boot information to diskless clients
 Name: bootparamd
 Version: 0.17
-Release: 32%{?dist}
+Release: 33%{?dist}
 License: BSD
 Group: System Environment/Daemons
 Source: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/netkit-%{name}-%{version}.tar.gz
@@ -19,6 +19,8 @@ BuildRequires: systemd-units
 Requires(post):	systemd-units
 Requires(post):	systemd-sysv
 Requires(preun):systemd-units
+Requires(postun): systemd-units
+
 Requires: portmap
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -90,6 +92,13 @@ if [ $1 = 0 ]; then	#	Package removal, not upgrade.
 	/bin/systemctl stop bootparamd.service > /dev/null 2>&1 || :
 fi
 
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart bootparamd.service >/dev/null 2>&1 || :
+fi
+
 
 %triggerun -- bootparamd < 0.17-31
 %{_bindir}/systemd-sysv-convert --save bootparamd > /dev/null 2>&1 || :
@@ -106,6 +115,9 @@ fi
 %{_unitdir}/*
 
 %changelog
+* Thu Sep 05 2011 Lukas Nykryn <lnykryn at redhat.com> - 0.17-33
+- Add postun section in spec file
+
 * Thu Sep 05 2011 Lukas Nykryn <lnykryn at redhat.com> - 0.17-32
 - Migration from SysV daemon handling to systemd (#722629)
 


More information about the scm-commits mailing list