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

Simone Caronni slaanesh at fedoraproject.org
Fri Jun 27 07:12:16 UTC 2014


commit 6da3b7b66a7269934bcfd4e1e4550951913d846c
Author: Simone Caronni <negativo17 at gmail.com>
Date:   Fri Jun 27 09:12:15 2014 +0200

    Fix Fedora and RHEL 7 temporary directories (#1113767)

 ndoutils.conf |    1 +
 ndoutils.spec |   23 +++++++++++++++++++----
 2 files changed, 20 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 27f9cc8..906ffd4 100644
--- a/ndoutils.spec
+++ b/ndoutils.spec
@@ -14,6 +14,7 @@ Source2:        ndo2db.cfg
 Source3:        ndomod.cfg
 Source4:        ndo2db.service
 Source5:        ndo2db.init
+Source6:        ndoutils.conf
 Patch0:         ndo-shared-so.patch
 
 BuildRequires:  mysql-devel
@@ -85,7 +86,6 @@ install -p -m 755 -D src/ndo2db.mysql %{buildroot}%{_sbindir}/ndo2db.mysql
 install -p -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/nagios/ndo2db.cfg
 install -p -m 644 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/nagios/ndomod.cfg
 mkdir -p %{buildroot}%{_localstatedir}/log/ndoutils
-mkdir -p %{buildroot}%{_localstatedir}/run/ndoutils
 mkdir -p %{buildroot}%{_localstatedir}/cache/ndoutils
 
 # Remove some spurious permissions from docs
@@ -97,12 +97,18 @@ find docs/html -name "*.*" -exec chmod 644 {} \;
 mkdir -p %{buildroot}%{_unitdir}
 install -p -m 644 -D %{SOURCE4} %{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 %{SOURCE5} %{buildroot}%{_initrddir}/ndo2db
 
+# Runtime files
+mkdir -p %{buildroot}%{_localstatedir}/run/ndoutils
+
 %endif
 
 %clean
@@ -113,15 +119,21 @@ rm -rf %{buildroot}
 %doc README.Fedora docs/html README REQUIREMENTS TODO UPGRADING
 %config(noreplace) %{_sysconfdir}/nagios/ndo2db.cfg
 %config(noreplace) %{_sysconfdir}/nagios/ndomod.cfg
+%dir %attr(-,nagios,root) %{_localstatedir}/log/ndoutils
+%dir %attr(-,nagios,root) %{_localstatedir}/cache/ndoutils
 %{_libdir}/nagios/brokers/ndomod.so
+
 %if 0%{?fedora} || 0%{?rhel} >= 7
+
 %{_unitdir}/ndo2db.service
+%{_tmpfilesdir}/ndoutils.conf
+
 %else
+
+%dir %attr(-,nagios,root) %{_localstatedir}/run/ndoutils
 %{_initrddir}/ndo2db
+
 %endif
-%dir %attr(-,nagios,root) %{_localstatedir}/run/ndoutils
-%dir %attr(-,nagios,root) %{_localstatedir}/log/ndoutils
-%dir %attr(-,nagios,root) %{_localstatedir}/cache/ndoutils
 
 %files mysql
 %defattr(-,root,root,-)
@@ -163,6 +175,9 @@ fi
 /usr/sbin/alternatives --install /usr/sbin/ndo2db ndo2db /usr/sbin/ndo2db.mysql 40
 
 %changelog
+* Fri Jun 27 2014 Simone Caronni <negativo17 at gmail.com> - 1.5.2-2
+- Fix Fedora and RHEL 7 temporary directories (#1113767).
+
 * Mon Feb 24 2014 Simone Caronni <negativo17 at gmail.com> - 1.5.2-1
 - Updated to 1.5.2.
 - Updated SPEC file for current packaging guidelines.


More information about the scm-commits mailing list