From 791eded5c9faec9162f05de1d1b287e368507451 Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: May 30 2012 11:07:58 +0000 Subject: use systemd instead of xinetd as a default --- diff --git a/tftp.spec b/tftp.spec index fd21220..ea4a755 100644 --- a/tftp.spec +++ b/tftp.spec @@ -1,7 +1,9 @@ +%global systemctl_bin /usr/bin/systemctl + Summary: The client for the Trivial File Transfer Protocol (TFTP) Name: tftp Version: 5.2 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD Group: Applications/Internet URL: http://www.kernel.org/pub/software/network/tftp/ @@ -77,13 +79,26 @@ install -p -m 644 %SOURCE1 ${RPM_BUILD_ROOT}%{_unitdir} install -p -m 644 %SOURCE2 ${RPM_BUILD_ROOT}%{_unitdir} %post server -/sbin/service xinetd reload > /dev/null 2>&1 || : +if [ $1 -eq 1 ] ; then + # Initial installation + %{systemctl_bin} daemon-reload >/dev/null 2>&1 || : +fi + +%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 %postun server -if [ $1 = 0 ]; then - /sbin/service xinetd reload > /dev/null 2>&1 || : +/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 + %clean rm -rf ${RPM_BUILD_ROOT} @@ -103,6 +118,9 @@ rm -rf ${RPM_BUILD_ROOT} %{_unitdir}/* %changelog +* Wed May 30 2012 Jan Synáček - 5.2-4 +- use systemd instead of xinetd as a default + * Tue May 22 2012 Jan Synáček - 5.2-3 - provide native systemd service files - Resolves: #737212