[am-utils/f16] add missing scriptlets

Tom Callaway spot at fedoraproject.org
Fri Sep 9 16:01:50 UTC 2011


commit ecbcb5cffb0d67c9551e8ec32b931a4d2472f747
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Fri Sep 9 12:01:38 2011 -0400

    add missing scriptlets

 am-utils.spec |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)
---
diff --git a/am-utils.spec b/am-utils.spec
index c8b5dfe..e30681d 100644
--- a/am-utils.spec
+++ b/am-utils.spec
@@ -1,7 +1,7 @@
 Summary: Automount utilities including an updated version of Amd
 Name: am-utils
 Version: 6.1.5
-Release: 19%{?dist}
+Release: 20%{?dist}
 License: BSD
 Epoch: 5
 Group: System Environment/Daemons
@@ -29,10 +29,13 @@ Requires: grep
 Requires: gawk
 Requires: findutils
 
-Requires(pre):   /bin/grep
-Requires(post):  /sbin/install-info
-Requires(post):  systemd-sysv
-Requires(preun): /sbin/install-info
+Requires(pre):    /bin/grep
+Requires(post):   /sbin/install-info
+Requires(post):   systemd-sysv
+Requires(post):   systemd-units
+Requires(preun):  systemd-units
+Requires(postun): systemd-units
+Requires(preun):  /sbin/install-info
 
 # 203193 - tmpfile usage
 Patch1: am-utils-6.1.5-rmtab-temp.patch
@@ -123,9 +126,6 @@ for I in %{_libdir}/libamu.a \
          rm -f  $RPM_BUILD_ROOT$I
 done
 
-%clean
-rm -rf ${RPM_BUILD_ROOT}
-
 %define __find_requires %{_builddir}/%{name}-%{version}/find-requires
 
 %pre
@@ -142,18 +142,31 @@ fi
 
 %post
 /sbin/ldconfig
+if [ $1 -eq 1 ] ; then 
+    # Initial installation 
+    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
 if [ -f %{_infodir}/am-utils.info.gz ]; then
     /sbin/install-info %{_infodir}/am-utils.info.gz %{_infodir}/dir || :
 fi
 
 %preun
 if [ $1 -eq 0 ]; then
+   # Package removal, not upgrade
+   /bin/systemctl --no-reload disable amd.service > /dev/null 2>&1 || :
+   /bin/systemctl stop amd.service > /dev/null 2>&1 || :
    if [ -f %{_infodir}/am-utils.info.gz ]; then
       /sbin/install-info --delete %{_infodir}/am-utils.info.gz %{_infodir}/dir || :
    fi
 fi
 
-%postun -p /sbin/ldconfig
+%postun
+/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+if [ $1 -ge 1 ] ; then
+    # Package upgrade, not uninstall
+    /bin/systemctl try-restart amd.service >/dev/null 2>&1 || :
+fi
+/sbin/ldconfig
 
 %triggerun -- am-utils < 6.1.5-19
 # Save the current service runlevel info
@@ -182,6 +195,9 @@ fi
 %{_libdir}/libamu.so*
 
 %changelog
+* Fri Sep 09 2011 Tom Callaway <spot at fedoraproject.org> - 5:6.1.5-20
+- add missing systemd scriptlets
+
 * Thu Sep 08 2011 Tom Callaway <spot at fedoraproject.org> - 5:6.1.5-19
 - convert from sysvinit to systemd
 


More information about the scm-commits mailing list