[autofs] - update systemd scriplet macros .

Ian Kent iankent at fedoraproject.org
Mon Aug 27 11:15:19 UTC 2012


commit ef349fe68edec9d7ca795b0bdb21f9abb9829d96
Author: Ian Kent <ikent at redhat.com>
Date:   Mon Aug 27 19:14:51 2012 +0800

    - update systemd scriplet macros .

 autofs.spec |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/autofs.spec b/autofs.spec
index fadc25c..0c603bc 100644
--- a/autofs.spec
+++ b/autofs.spec
@@ -8,7 +8,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 Version: 5.0.7
-Release: 1%{?dist}
+Release: 2%{?dist}
 Epoch: 1
 License: GPLv2+
 Group: System Environment/Daemons
@@ -104,12 +104,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %post
 %if %{with_systemd}
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -eq 1 ]; then
-	%{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || :
-	# autofs has been approved to be enabled by default
-	%{_bindir}/systemctl enable %{name}.service >/dev/null 2>&1 || :
-fi
+%systemd_post %{name}.service
 %else
 if [ $1 -eq 1 ]; then
 	%{_sbindir}/sbin/chkconfig --add autofs
@@ -118,10 +113,7 @@ fi
 
 %preun
 %if %{with_systemd}
-if [ $1 -eq 0 ] ; then
-    %{_bindir}/systemctl --no-reload disable %{name}.service > /dev/null 2>&1 || :
-    %{_bindir}/systemctl stop %{name}.service > /dev/null 2>&1 || :
-fi
+%systemd_preun %{name}.service
 %else
 if [ $1 -eq 0 ] ; then
     %{_sbindir}/service autofs stop > /dev/null 2>&1 || :
@@ -131,10 +123,7 @@ fi
 
 %postun
 %if %{with_systemd}
-%{_bindir}/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    %{_bindir}/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart %{name}.service
 %else
 if [ $1 -ge 1 ] ; then
     %{_sbindir}/sbin/service autofs condrestart > /dev/null 2>&1 || :
@@ -171,6 +160,9 @@ fi
 %dir /etc/auto.master.d
 
 %changelog
+* Mon Aug 27 2012 Ian Kent <ikent at redhat.com> - 1:5.0.7-2
+- update systemd scriplet macros (bz850040).
+
 * Wed Jul 25 2012 Ian Kent <ikent at redhat.com> - 1:5.0.7-1
 - Update to upstream version 5.0.7.
 


More information about the scm-commits mailing list