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

git at icinga.org git at icinga.org
Tue Jul 5 21:38:06 CEST 2011


Module: icinga-core
Branch: rbartels/cgi-current
Commit: dab63b9bf2d386aaee4afdc232fe2132c10c9eae
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=dab63b9bf2d386aaee4afdc232fe2132c10c9eae

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

partly taken from https://bugzilla.redhat.com/show_bug.cgi?id=693608

refs #1666
refs #1685

---

 icinga.spec |   68 +++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/icinga.spec b/icinga.spec
index 768d385..55b8bc1 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}
 
@@ -127,6 +122,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|;
@@ -136,8 +135,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}/gui/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
@@ -146,6 +166,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 || :
@@ -184,9 +206,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
@@ -199,10 +220,11 @@ fi
 %{_bindir}/icinga
 %{_bindir}/icingastats
 %{_libdir}/icinga/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,-)
@@ -211,8 +233,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
@@ -224,7 +250,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,-)
@@ -239,13 +268,20 @@ 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
-* Wed May 18 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.5.0-1
+* Wed June 29 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.5.0-1
 - set to 1.5.0 target, remove provides nagios version, set 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
 
 * Wed May 11 2011 Michael Friedrich <michael.friedrich at univie.ac.at> - 1.4.0-2
 - undo changes on icinga-cmd group, use icingacmd like before





More information about the icinga-checkins mailing list