Use new systemd-rpm macros

This commit is contained in:
Vitezslav Crhonek 2012-08-22 13:49:39 +02:00
parent b309ac3eaa
commit fa093cdb97

View File

@ -6,7 +6,7 @@
Summary: Multi Router Traffic Grapher Summary: Multi Router Traffic Grapher
Name: mrtg Name: mrtg
Version: 2.17.4 Version: 2.17.4
Release: 3%{?dist} Release: 4%{?dist}
URL: http://oss.oetiker.ch/mrtg/ URL: http://oss.oetiker.ch/mrtg/
Source0: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz Source0: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz
Source1: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz.md5 Source1: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz.md5
@ -97,25 +97,17 @@ sed -i 's;@@lib@@;%{_lib};g' "$RPM_BUILD_ROOT"%{_mandir}/man1/*.1
%post %post
install -d -m 0755 -o root -g root /var/lock/mrtg install -d -m 0755 -o root -g root /var/lock/mrtg
if [ $1 -eq 1 ] ; then %systemd_post mrtg.service
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun %preun
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
# Package removal, not upgrade
rm -rf /var/lock/mrtg rm -rf /var/lock/mrtg
# Package removal, not upgrade
/bin/systemctl --no-reload disable mrtg.service > /dev/null 2>&1 || :
/bin/systemctl stop mrtg.service > /dev/null 2>&1 || :
fi fi
%systemd_preun mrtg.service
%postun %postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || : %systemd_postun_with_restart mrtg.service
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart mrtg.service >/dev/null 2>&1 || :
fi
%files %files
%doc contrib CHANGES COPYING COPYRIGHT README THANKS %doc contrib CHANGES COPYING COPYRIGHT README THANKS
@ -138,6 +130,10 @@ fi
%{_unitdir}/mrtg.timer %{_unitdir}/mrtg.timer
%changelog %changelog
* Wed Aug 22 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.17.4-4
- Use new systemd-rpm macros
Resolves: #850215
* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.17.4-3 * Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.17.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild