[tftp] add systemd-rpm macros

jsynacek jsynacek at fedoraproject.org
Wed Aug 22 07:10:12 UTC 2012


commit a42027d8bba359861fcbd92c22fcf3bdf6a623cf
Author: Jan Synacek <jsynacek at redhat.com>
Date:   Wed Aug 22 09:09:35 2012 +0200

    add systemd-rpm macros
    
    Resolves: #850338

 tftp.spec |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/tftp.spec b/tftp.spec
index d8ccaa2..2f44f02 100644
--- a/tftp.spec
+++ b/tftp.spec
@@ -3,7 +3,7 @@
 Summary: The client for the Trivial File Transfer Protocol (TFTP)
 Name: tftp
 Version: 5.2
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: BSD
 Group: Applications/Internet
 URL: http://www.kernel.org/pub/software/network/tftp/
@@ -78,24 +78,13 @@ install -p -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir}
 install -p -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir}
 
 %post server
-if [ $1 -eq 1 ] ; then
-    # Initial installation
-    %{systemctl_bin} daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post tftp.service
 
 %preun server
-if [ $1 -eq 0 ] ; then
-    # Package removal, not upgrade
-    %{systemctl_bin} --no-reload disable tftp.service > /dev/null 2>&1 || :
-    %{systemctl_bin} stop tftp.service > /dev/null 2>&1 || :
-fi
+%systemd_preun tftp.service
 
 %postun server
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-    # Package upgrade, not uninstall
-    %{systemctl_bin} try-restart tftp.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart tftp.service
 
 
 %clean
@@ -115,6 +104,10 @@ rm -rf ${RPM_BUILD_ROOT}
 %{_unitdir}/*
 
 %changelog
+* Wed Aug 22 2012 Jan Synáček <jsynacek at redhat.com> - 5.2-6
+- add systemd-rpm macros
+- Resolves: #850338
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 5.2-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list