[mrtg/f15/master] Use %%ghost for /var/lock/mrtg
vcrhonek
vcrhonek at fedoraproject.org
Tue Apr 26 13:43:01 UTC 2011
commit 8a201d4bc5e1c6c9a88c4d1975ac4014ee91fc3a
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date: Tue Apr 26 15:42:49 2011 +0200
Use %%ghost for /var/lock/mrtg
mrtg.spec | 22 ++++++++++++++++++++--
mrtg.tmpfiles | 1 +
2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/mrtg.spec b/mrtg.spec
index 6b33e03..b17418b 100644
--- a/mrtg.spec
+++ b/mrtg.spec
@@ -6,7 +6,7 @@
Summary: Multi Router Traffic Grapher
Name: mrtg
Version: 2.17.0
-Release: 2%{?dist}
+Release: 3%{?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
@@ -15,6 +15,7 @@ Source3: filter-requires-mrtg.sh
Source4: mrtg.crond.in
Source5: mrtg-httpd.conf
Source6: filter-provides-mrtg.sh
+Source7: mrtg.tmpfiles
Patch0: mrtg-2.15.0-lib64.patch
Patch1: mrtg-2.10.5-norpath.patch
# DO NOT DROP THIS PATCH. Without it, the mrtg logs fill up with:
@@ -86,6 +87,10 @@ chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/mrtg
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
for i in mrtg cfgmaker indexmaker mrtg-traffic-sum; do
sed -i 's;@@lib@@;%{_lib};g' "$RPM_BUILD_ROOT"%{_bindir}/"$i"
@@ -95,8 +100,14 @@ sed -i 's;@@lib@@;%{_lib};g' "$RPM_BUILD_ROOT"%{_mandir}/man1/*.1
# Tell crond to reload its configuration.
%post
+install -d -m 0755 -o root -g root /var/lock/mrtg
/sbin/service crond condrestart 2>&1 > /dev/null || :
+%preun
+if [ $1 -eq 0 ]; then
+ rm -rf /var/lock/mrtg
+fi
+
%postun
/sbin/service crond condrestart 2>&1 > /dev/null || :
@@ -118,9 +129,16 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_datadir}/mrtg2/icons
%exclude %{_datadir}/doc/mrtg2
%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
+* Tue Apr 26 2011 Vitezslav Crhonek <vcrhonek at redhat.com> - 2.17.0-3
+- Use %%ghost for /var/lock/mrtg
+ Resolves: #699193
+
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
diff --git a/mrtg.tmpfiles b/mrtg.tmpfiles
new file mode 100644
index 0000000..80ad928
--- /dev/null
+++ b/mrtg.tmpfiles
@@ -0,0 +1 @@
+d /var/lock/mrtg 0755 root root -
More information about the scm-commits
mailing list