[lldpad] Migrate to systemd scriptlets

Petr Šabata psabata at fedoraproject.org
Tue Aug 28 11:35:07 UTC 2012


commit c59f8e5204e8de026907b23eb5676f6283738a3e
Author: Petr Šabata <contyk at redhat.com>
Date:   Tue Aug 28 13:28:28 2012 +0200

    Migrate to systemd scriptlets

 lldpad.spec |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/lldpad.spec b/lldpad.spec
index a3a4d52..ae15f78 100644
--- a/lldpad.spec
+++ b/lldpad.spec
@@ -3,7 +3,7 @@
 
 Name:               lldpad
 Version:            0.9.45
-Release:            2%{?dist}
+Release:            3%{?dist}
 Summary:            Intel LLDP Agent
 Group:              System Environment/Daemons
 License:            GPLv2
@@ -63,21 +63,14 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la
 
 %post
 /sbin/ldconfig
-if [ $1 -eq 1 ]; then
-    systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post %{name}.service
 
 %preun
-if [ $1 -eq 0 ]; then
-    systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
-    systemctl stop %{name}.service >/dev/null 2>&1 || :
-fi
+%systemd_preun %{name}.service
 
 %postun
 /sbin/ldconfig
-if [ $1 -eq 1 ]; then
-    systemctl try-restart %{name}.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart %{name}.service
 
 %post devel
 ## provide legacy support for apps that use the old dcbd interface.
@@ -112,6 +105,9 @@ fi
 %{_libdir}/liblldp_clif.so
 
 %changelog
+* Tue Aug 28 2012 Petr Šabata <contyk at redhat.com> - 0.9.45-3
+- Migrate to systemd scriptlets (#850192)
+
 * Thu Aug 23 2012 Petr Šabata <contyk at redhat.com> - 0.9.45-2
 - Fix displaying of the Management Address TLV (327ef662)
 


More information about the scm-commits mailing list