add systemd-rpm macros

Resolves: #850338
This commit is contained in:
Jan Synacek 2012-08-22 09:09:35 +02:00
parent 569572a4fb
commit a42027d8bb

View File

@ -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@redhat.com> - 5.2-6
- add systemd-rpm macros
- Resolves: #850338
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild