[ndoutils] Fix Fedora and RHEL 7 temporary directories (#1113767)

Simone Caronni slaanesh at fedoraproject.org
Fri Jun 27 06:51:45 UTC 2014


commit 96036382c81cd52e3a2a2bc15adf3727225c8b47
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Fri Jun 27 08:51:44 2014 +0200

    Fix Fedora and RHEL 7 temporary directories (#1113767)

 ndoutils.conf |    1 +
 ndoutils.spec |   20 ++++++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/ndoutils.conf b/ndoutils.conf
new file mode 100644
index 0000000..aeade77
--- /dev/null
+++ b/ndoutils.conf
@@ -0,0 +1 @@
+d /var/run/ndoutils 0755 nagios nagios -
diff --git a/ndoutils.spec b/ndoutils.spec
index df8b25a..04d1700 100644
--- a/ndoutils.spec
+++ b/ndoutils.spec
@@ -14,7 +14,8 @@ Source0:            http://downloads.sourceforge.net/nagios/%{name}-%{version}.t
 Source1:            README.Fedora
 Source2:            ndo2db.service
 Source3:            ndo2db.init
-Source4:            https://www.gnu.org/licenses/gpl-2.0.txt
+Source4:            ndoutils.conf
+Source5:            https://www.gnu.org/licenses/gpl-2.0.txt
 # Fedora 21+: https://fedoraproject.org/wiki/Format-Security-FAQ
 Patch0:             %{name}-2.0.0-format-security.patch
 # Better align with Fedora/Nagios places for temporary files
@@ -67,9 +68,8 @@ make %{?_smp_mflags}
 
 %install
 rm -rf %{buildroot}
-cp %{SOURCE1} %{SOURCE4} .
+cp %{SOURCE1} %{SOURCE5} .
 mkdir -p %{buildroot}%{_localstatedir}/log/nagios
-mkdir -p %{buildroot}%{_localstatedir}/run/ndoutils
 mkdir -p %{buildroot}%{_localstatedir}/cache/ndoutils
 mkdir -p %{buildroot}%{_libdir}/nagios/brokers
 
@@ -109,12 +109,18 @@ find docs/html -name "*.*" -exec chmod 644 {} \;
 mkdir -p %{buildroot}%{_unitdir}
 install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/ndo2db.service
 
+# Runtime files (tmpfs)
+install -p -m 644 -D %{SOURCE4} %{buildroot}%{_tmpfilesdir}/ndoutils.conf
+
 %else
 
 # Initscripts
 mkdir -p %{buildroot}%{_initrddir}
 install -p -m 755 -D %{SOURCE3} %{buildroot}%{_initrddir}/ndo2db
 
+# Runtime files
+mkdir -p %{buildroot}%{_localstatedir}/run/ndoutils
+
 %endif
 
 %clean
@@ -127,7 +133,6 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/nagios/ndo2db.cfg
 %config(noreplace) %{_sysconfdir}/nagios/ndomod.cfg
 %dir %attr(-,nagios,root) %{_localstatedir}/cache/ndoutils
-%dir %attr(-,nagios,root) %{_localstatedir}/run/ndoutils
 # Currently the one and only broker, but probably the brokers directory
 # should belong to nagios-common.
 %{_libdir}/nagios/brokers
@@ -137,9 +142,15 @@ rm -rf %{buildroot}
 %{_sbindir}/sockdebug
 
 %if 0%{?fedora} || 0%{?rhel} >= 7
+
+%{_tmpfilesdir}/ndoutils.conf
 %{_unitdir}/ndo2db.service
+
 %else
+
+%dir %attr(-,nagios,root) %{_localstatedir}/run/ndoutils
 %{_initrddir}/ndo2db
+
 %endif
 
 %if 0%{?fedora} || 0%{?rhel} >= 7
@@ -176,6 +187,7 @@ fi
 %changelog
 * Fri Jun 27 2014 Simone Caronni <negativo17 at gmail.com> - 2.0.0-6
 - Install Nagios 3 binaries on RHEL 7 (#1113757).
+- Fix Fedora and RHEL 7 temporary directories (#1113767).
 
 * Sat Jun 07 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.0-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild


More information about the scm-commits mailing list