Use new systemd-rpm macros
This commit is contained in:
parent
b309ac3eaa
commit
fa093cdb97
22
mrtg.spec
22
mrtg.spec
@ -6,7 +6,7 @@
|
||||
Summary: Multi Router Traffic Grapher
|
||||
Name: mrtg
|
||||
Version: 2.17.4
|
||||
Release: 3%{?dist}
|
||||
Release: 4%{?dist}
|
||||
URL: http://oss.oetiker.ch/mrtg/
|
||||
Source0: http://oss.oetiker.ch/mrtg/pub/mrtg-%{version}.tar.gz
|
||||
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
|
||||
install -d -m 0755 -o root -g root /var/lock/mrtg
|
||||
if [ $1 -eq 1 ] ; then
|
||||
# Initial installation
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
%systemd_post mrtg.service
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ]; then
|
||||
# Package removal, not upgrade
|
||||
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
|
||||
%systemd_preun mrtg.service
|
||||
|
||||
%postun
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ] ; then
|
||||
# Package upgrade, not uninstall
|
||||
/bin/systemctl try-restart mrtg.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
%systemd_postun_with_restart mrtg.service
|
||||
|
||||
%files
|
||||
%doc contrib CHANGES COPYING COPYRIGHT README THANKS
|
||||
@ -138,6 +130,10 @@ fi
|
||||
%{_unitdir}/mrtg.timer
|
||||
|
||||
%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
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user