Use %%ghost for /var/lock/mrtg

This commit is contained in:
Vitezslav Crhonek 2011-03-24 15:59:40 +01:00
parent ec89a9b4c8
commit 8975cb95d8
2 changed files with 21 additions and 2 deletions

View File

@ -6,7 +6,7 @@
Summary: Multi Router Traffic Grapher Summary: Multi Router Traffic Grapher
Name: mrtg Name: mrtg
Version: 2.17.2 Version: 2.17.2
Release: 1%{?dist} Release: 2%{?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
@ -15,6 +15,7 @@ Source3: filter-requires-mrtg.sh
Source4: mrtg.crond.in Source4: mrtg.crond.in
Source5: mrtg-httpd.conf Source5: mrtg-httpd.conf
Source6: filter-provides-mrtg.sh Source6: filter-provides-mrtg.sh
Source7: mrtg.tmpfiles
Patch0: mrtg-2.15.0-lib64.patch Patch0: mrtg-2.15.0-lib64.patch
License: GPLv2+ License: GPLv2+
Group: Applications/Internet Group: Applications/Internet
@ -75,6 +76,10 @@ chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/mrtg
install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/mrtg.conf install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/mrtg.conf
%if %{?fedora}0 > 140 || %{?rhel}0 > 60
install -p -D -m 644 %{SOURCE7} $RPM_BUILD_ROOT/%{_sysconfdir}/tmpfiles.d/mrtg.conf
%endif
# Add mrtg-traffic-sum here when upstream decides to install it # Add mrtg-traffic-sum here when upstream decides to install it
for i in mrtg cfgmaker indexmaker mrtg-traffic-sum; do for i in mrtg cfgmaker indexmaker mrtg-traffic-sum; do
sed -i 's;@@lib@@;%{_lib};g' "$RPM_BUILD_ROOT"%{_bindir}/"$i" sed -i 's;@@lib@@;%{_lib};g' "$RPM_BUILD_ROOT"%{_bindir}/"$i"
@ -84,8 +89,14 @@ sed -i 's;@@lib@@;%{_lib};g' "$RPM_BUILD_ROOT"%{_mandir}/man1/*.1
# Tell crond to reload its configuration. # Tell crond to reload its configuration.
%post %post
install -d -m 0755 -o root -g root /var/lock/mrtg
/sbin/service crond condrestart 2>&1 > /dev/null || : /sbin/service crond condrestart 2>&1 > /dev/null || :
%preun
if [ $1 -eq 0 ]; then
rm -rf /var/lock/mrtg
fi
%postun %postun
/sbin/service crond condrestart 2>&1 > /dev/null || : /sbin/service crond condrestart 2>&1 > /dev/null || :
@ -107,9 +118,16 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_datadir}/mrtg2/icons %exclude %{_datadir}/mrtg2/icons
%exclude %{_datadir}/doc/mrtg2 %exclude %{_datadir}/doc/mrtg2
%dir %{_localstatedir}/lib/mrtg %dir %{_localstatedir}/lib/mrtg
%dir %{_localstatedir}/lock/mrtg %if %{?fedora}0 > 140 || %{?rhel}0 > 60
%config(noreplace) %{_sysconfdir}/tmpfiles.d/mrtg.conf
%endif
%ghost /var/lock/mrtg
%changelog %changelog
* Thu Mar 24 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.17.2-2
- Use %%ghost for /var/lock/mrtg
Resolves: #656629
* Tue Feb 22 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.17.2-1 * Tue Feb 22 2011 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.17.2-1
- Update to mrtg-2.17.2 - Update to mrtg-2.17.2

1
mrtg.tmpfiles Normal file
View File

@ -0,0 +1 @@
d /var/lock/mrtg 0755 root root -