[icinga-checkins] icinga.org: icinga-core/r1.4: icinga.spec: move logging into single location, fix permissions and cfgs

git at icinga.org git at icinga.org
Wed Jun 29 10:53:04 CEST 2011


Module: icinga-core
Branch: r1.4
Commit: 6dae193c06e8952959e98f83c288010e9b128fed
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=6dae193c06e8952959e98f83c288010e9b128fed

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Jun 29 10:48:15 2011 +0200

icinga.spec: move logging into single location, fix permissions and cfgs

---

 icinga.spec |   69 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 53 insertions(+), 16 deletions(-)

diff --git a/icinga.spec b/icinga.spec
index 85b3bd2..1fc48e5 100644
--- a/icinga.spec
+++ b/icinga.spec
@@ -1,9 +1,3 @@
-# $Id$
-# Authority: cmr
-# Upstream: The icinga devel team <icinga-devel at lists.sourceforge.net>
-# Needs libdbi
-# ExcludeDist: el4 el3
-
 %define logdir %{_localstatedir}/log/icinga
 
 %define apacheconfdir  %{_sysconfdir}/httpd/conf.d
@@ -28,6 +22,7 @@ BuildRequires: libpng-devel
 BuildRequires: libjpeg-devel
 BuildRequires: libdbi-devel
 BuildRequires: perl(ExtUtils::Embed)
+#Requires: nagios-plugins
 Provides: nagios
 
 %description
@@ -72,8 +67,8 @@ PHP api for %{name}
 
 %package doc
 Summary: documentation %{name}
-Group: Applications/System
- 
+Group: Documentation
+
 %description doc
 Documentation for %{name}
 
@@ -126,6 +121,10 @@ Documentation for %{name}
     COMMAND_OPTS="" \
     INIT_OPTS=""
 
+### strip binary
+%{__strip} %{buildroot}%{_bindir}/{icinga,icingastats,log2ido,ido2db}
+%{__strip} %{buildroot}%{_libdir}/icinga/cgi/*.cgi
+
 ### FIX log-paths
 %{__perl} -pi -e '
         s|log_file.*|log_file=%{logdir}/icinga.log|;
@@ -135,8 +134,29 @@ Documentation for %{name}
 
 ### make logdirs
 %{__mkdir} -p %{buildroot}%{logdir}/
+%{__mkdir} -p %{buildroot}%{logdir}/api/
+%{__mkdir} -p %{buildroot}%{logdir}/gui/
 %{__mkdir} -p %{buildroot}%{logdir}/archives/
 
+### remove PLACEHOLDER
+rm %{buildroot}%{_datadir}/icinga/icinga-api/log/PLACEHOLDER
+### Move all logging to logdir
+rmdir %{buildroot}%{_datadir}/icinga/icinga-api/log
+%{__perl} -pi -e '
+        s|define\("DEFAULT_API_LOG_FILE",.*|define\("DEFAULT_API_LOG_FILE","%{logdir}/api/icinga-api.log"\);|;
+   ' %{buildroot}%{_datadir}/icinga/icinga-api/objects/debug/debugTargets/icingaApiFileDebugger.php
+mv %{buildroot}%{_datadir}/icinga/log/{.htaccess,index.htm} %{buildroot}%{logdir}/gui
+rmdir %{buildroot}%{_datadir}/icinga/log/
+
+%{__perl} -pi -e '
+        s|cgi_log_file.*|cgi_log_file=%{logdir}/cgi/icinga-cgi.log|;
+        s|cgi_log_archive_path=.*|cgi_log_archive_path=%{logdir}/archives|;
+   ' %{buildroot}%{_sysconfdir}/icinga/cgi.cfg
+%{__perl} -pi -e "
+        s|^use constant\tDEBUG_LOG_PATH.*|use constant\tDEBUG_LOG_PATH\t=> '/var/log/icinga/' ;|
+   " %{buildroot}%{_bindir}/p1.pl
+
+
 ### move idoutils sample configs to final name
 mv %{buildroot}%{_sysconfdir}/icinga/ido2db.cfg-sample %{buildroot}%{_sysconfdir}/icinga/ido2db.cfg
 mv %{buildroot}%{_sysconfdir}/icinga/idomod.cfg-sample %{buildroot}%{_sysconfdir}/icinga/idomod.cfg
@@ -145,6 +165,8 @@ mv %{buildroot}%{_sysconfdir}/icinga/modules/idoutils.cfg-sample %{buildroot}%{_
 ### copy idoutils db-script
 cp -r module/idoutils/db %{buildroot}%{_sysconfdir}/icinga/idoutils
 
+
+
 %pre
 # Add icinga user
 /usr/sbin/groupadd icinga 2> /dev/null || :
@@ -183,9 +205,8 @@ fi
 %attr(755,root,root) %{_initrddir}/icinga
 %dir %{_sysconfdir}/icinga
 %dir %{_sysconfdir}/icinga/modules
-%config(noreplace) %{_sysconfdir}/icinga/cgi.cfg
-%config(noreplace) %{_sysconfdir}/icinga/cgiauth.cfg
 %config(noreplace) %{_sysconfdir}/icinga/icinga.cfg
+%dir %{_sysconfdir}/icinga/objects
 %config(noreplace) %{_sysconfdir}/icinga/objects/commands.cfg
 %config(noreplace) %{_sysconfdir}/icinga/objects/contacts.cfg
 %config(noreplace) %{_sysconfdir}/icinga/objects/localhost.cfg
@@ -198,10 +219,11 @@ fi
 %{_bindir}/icinga
 %{_bindir}/icingastats
 %{_bindir}/p1.pl
-%{logdir}
 %dir %{_localstatedir}/icinga
 %dir %{_localstatedir}/icinga/checkresults
 %attr(2755,icinga,icingacmd) %{_localstatedir}/icinga/rw/
+%{logdir}
+%{logdir}/archives
 
 %files doc
 %defattr(-,icinga,icinga,-)
@@ -210,8 +232,12 @@ fi
 %files gui
 %defattr(-,icinga,icinga,-)
 %config(noreplace) %attr(-,root,root) %{apacheconfdir}/icinga.conf
-%dir %{_datadir}/icinga
+%config(noreplace) %{_sysconfdir}/icinga/cgi.cfg
+%config(noreplace) %{_sysconfdir}/icinga/cgiauth.cfg
+%{_libdir}/icinga
 %{_libdir}/icinga/cgi
+%{_libdir}/icinga/cgi/*.cgi
+%dir %{_datadir}/icinga
 %{_datadir}/icinga/contexthelp
 %{_datadir}/icinga/images
 %{_datadir}/icinga/index.html
@@ -223,7 +249,10 @@ fi
 %{_datadir}/icinga/sidebar.html
 %{_datadir}/icinga/ssi
 %{_datadir}/icinga/stylesheets
-%attr(0755,%{apacheuser},%{apachegroup}) %{_datadir}/icinga/log
+#%attr(0755,%{apacheuser},%{apachegroup}) %{_datadir}/icinga/log
+%attr(2775,icinga,icingacmd) %dir %{logdir}/gui
+%attr(664,icinga,icingacmd) %{logdir}/gui/index.htm
+%attr(664,icinga,icingacmd) %{logdir}/gui/.htaccess
 
 %files idoutils
 %defattr(-,icinga,icinga,-)
@@ -238,13 +267,21 @@ fi
 
 %files api
 %defattr(-,icinga,icinga,-)
-%{_datadir}/icinga/icinga-api
-%attr(-,%{apacheuser},%{apacheuser}) %{_datadir}/icinga/icinga-api/log
+%dir %{_datadir}/icinga/icinga-api
+%{_datadir}/icinga/icinga-api/IcingaApi.php
+%{_datadir}/icinga/icinga-api/contrib
+%{_datadir}/icinga/icinga-api/objects
+%{_datadir}/icinga/icinga-api/tests
+%attr(2775,icinga,icingacmd) %dir %{logdir}/api
 
 
 %changelog
 * Mon Jun 20 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.4.2-1
-- update to 1.4.2, mv idoutils.cfg-sample
+- update to 1.4.2
+- mv idoutils.cfg-sample
+- move all logging to one location https://bugzilla.redhat.com/show_bug.cgi?id=693608
+- fix file perms and locations of cfgs
+- fix group for doc
 
 * Sun Jun 05 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.4.1-1
 - update to 1.4.1





More information about the icinga-checkins mailing list