[smartmontools/f18] use new systemd rpm macros (#850316)

Michal Hlavinka mhlavink at fedoraproject.org
Tue Aug 21 16:28:19 UTC 2012


commit ce30992ade46f298081a3df4caefe314d2596e03
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Tue Aug 21 18:27:54 2012 +0200

    use new systemd rpm macros (#850316)

 smartmontools.spec |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/smartmontools.spec b/smartmontools.spec
index 0370e81..7e04850 100644
--- a/smartmontools.spec
+++ b/smartmontools.spec
@@ -1,7 +1,7 @@
 Summary:	Tools for monitoring SMART capable hard disks
 Name:		smartmontools
 Version:	5.43
-Release:	2%{?dist}
+Release:	3%{?dist}
 Epoch:		1
 Group:		System Environment/Base
 License:	GPLv2+
@@ -73,28 +73,13 @@ rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}
 rm -rf $RPM_BUILD_ROOT
 
 %preun
-if [ $1 -eq 0 ] ; then
-        # Package removal, not upgrade
-        /bin/systemctl --no-reload disable smartd.service >/dev/null 2>&1 || :
-        /bin/systemctl stop smartd.service > /dev/null 2>&1 || :
-fi
+%systemd_preun smartd.service
 
 %post
-if [ $1 -eq 1 ]; then
-	/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-	/bin/systemctl enable smartd.service >/dev/null 2>&1 || :
-else
-	if [ -n "$(find /etc/rc.d/rc5.d/ -name 'S??smartd' 2>/dev/null)" ]; then
-		/bin/systemctl enable smartd.service >/dev/null 2>&1 || :
-	fi
-fi
+%systemd_post smartd.service
 
 %postun
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-        # Package upgrade, not uninstall
-        /bin/systemctl try-restart smartd.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart smartd.service
 
 %files
 %defattr(-,root,root,-)
@@ -111,6 +96,9 @@ fi
 %{_datadir}/%{name}
 
 %changelog
+* Tue Aug 21 2012 Michal Hlavinka <mhlavink at redhat.com> - 1:5.43-3
+- use new systemd rpm macros (#850316)
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:5.43-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list