%define _requires_exceptions pear(default.php) Name: check-mk Version: 1.2.2 Release: 1%{?dist} Summary: A new general purpose Nagios-plugin for retrieving data Group: Applications/Internet License: GPLv2 and GPLv3 URL: http://mathias-kettner.de/check_mk Source: http://mathias-kettner.de/download/check_mk-%{version}.tar.gz Requires: nagios Source1: First-Installation.txt AutoReq: 0 %description check-mk is a general purpose Nagios-plugin for retrieving data. It adopts a new approach for collecting data from operating systems and network components. It obsoletes NRPE, check_by_ssh, NSClient, and check_snmp and it has many benefits, the most important are a significant reduction of CPU usage on the Nagios host and an automatic inventory of items to be checked on hosts. %package agent Summary: The check-mk's Agent Requires: xinetd Group: Applications/Internet %description agent This package contains the check-mk's agent. Install the following agent on all the machines you plan to monitor with check-mk. %package docs Summary: The check-mk's documentation Group: Applications/Internet BuildArch: noarch AutoReq: 0 %description docs This package contains the check-mk's documentation files. %package livestatus Summary: The check-mk's Livestatus Group: Applications/Internet Requires: check-mk Requires: %{name}%{?_isa} = %{version}-%{release} %description livestatus This package contains livestatus. %package multisite Summary: The check-mk's Multisite Group: Applications/Internet BuildArch: noarch Requires: %{name}% = %{version}-%{release} %description multisite This package contains multisite. %prep %setup -q -n check_mk-%{version} tar xf agents.tar.gz %build %install # Agent's installation install -d -m 755 %{buildroot}%{_sysconfdir}/xinetd.d install -m 644 xinetd.conf %{buildroot}%{_sysconfdir}/xinetd.d/check-mk-agent install -d -m 755 %{buildroot}%{_bindir} install -m 755 check_mk_agent.linux %{buildroot}%{_bindir}/check-mk-agent install -d -m 755 %{buildroot}%{_datadir}/check-mk-agent install -d -m 755 %{buildroot}%{_datadir}/check-mk-agent/plugins install -d -m 755 %{buildroot}%{_datadir}/check-mk-agent/local install -m 644 plugins/mk_logwatch %{buildroot}%{_datadir}/check-mk-agent/plugins install -m 644 plugins/j4p_performance %{buildroot}%{_datadir}/check-mk-agent/plugins install -m 644 plugins/mk_oracle %{buildroot}%{_datadir}/check-mk-agent/plugins install -m 644 plugins/sylo %{buildroot}%{_datadir}/check-mk-agent/plugins install -d -m 755 %{buildroot}%{_sysconfdir}/check-mk-agent install -m 644 logwatch.cfg %{buildroot}%{_sysconfdir}/check-mk-agent perl -pi \ -e 's|LIBDIR="/to/be/changed"|LIBDIR="%{_datadir}/check-mk-agent"|;' \ -e 's|CONFDIR="/to/be/changed"|CONFDIR="%{_sysconfdir}/check-mk-agent"|;' \ %{buildroot}%{_bindir}/check-mk-agent # Server, livestatus and other modules installation DESTDIR=%{buildroot} ./setup.sh --yes # Some needed tweaks to modify setup.sh's defaults. # /etc/apache2/conf.d --> /etc/httpd/conf.d mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d/ mv %{buildroot}%{_sysconfdir}/apache2/conf.d/zzz_check_mk.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/zzz_check_mk.conf rm -rf %{buildroot}%{_sysconfdir}/apache2/ # Install the First-Installation.txt file install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/check_mk # Make sure all the scripts into /usr/share/check_mk/* and /usr/share/check-mk-agent/* are executable. for file in %{buildroot}%{_datadir}/check_mk/checks/* ; do chmod -R a+x $file done for file in %{buildroot}%{_datadir}/check-mk-agent/plugins/* ; do chmod a+x $file done # Fix a few more permissions chmod a+x %{buildroot}%{_datadir}/check_mk/agents/hpux/hpux_statgrab chmod a+x %{buildroot}%{_datadir}/check_mk/agents/hpux/hpux_lunstats chmod a+x %{buildroot}%{_datadir}/check_mk/agents/check_mk_agent.openbsd chmod a+x %{buildroot}%{_datadir}/check_mk/agents/plugins/db2_mem.sh chmod a+x %{buildroot}%{_datadir}/check_mk/modules/snmp.py chmod a+x %{buildroot}%{_datadir}/check_mk/modules/packaging.py chmod a+x %{buildroot}%{_datadir}/check_mk/modules/agent_simulator.py chmod a+x %{buildroot}%{_datadir}/check_mk/modules/notify.py chmod a+x %{buildroot}%{_datadir}/check_mk/modules/automation.py chmod a+x %{buildroot}%{_datadir}/check_mk/notifications/debug # Web app files are not intended to be run, remove the shebang # TODO: ask upstream to do the same for file in `find %{buildroot}%{_datadir}/check_mk/web -name '*.py'`; do sed -i '1{\@^#!/usr/bin/python@d}' $file done # Remove Windows files. rm -rf %{buildroot}%{_docdir}/check_mk/windows/ rm -rf %{buildroot}%{_datadir}/check_mk/agents/windows/ # Remove waitmax and its leftarounds, looks like it's a statically linked binary. rm %{buildroot}%{_datadir}/check_mk/agents/waitmax rm %{buildroot}%{_datadir}/check_mk/agents/waitmax.c # Remove the packages directory. rm -rf %{buildroot}%{_localstatedir}/lib/check_mk/packages/ %ifarch x86_64 mkdir -p %{buildroot}%{_prefix}/lib64/check_mk mv %{buildroot}%{_prefix}/lib/check_mk/livecheck %{buildroot}%{_prefix}/lib64/check_mk/ mv %{buildroot}%{_prefix}/lib/check_mk/livestatus.o %{buildroot}%{_prefix}/lib64/check_mk/ rmdir %{buildroot}%{_prefix}/lib/check_mk %endif %files %{_bindir}/cmk %{_bindir}/mkp %{_bindir}/check_mk %config(noreplace) %{_sysconfdir}/check_mk/main.mk %config(noreplace) %{_sysconfdir}/check_mk/main.mk-1.2.2 %{_sysconfdir}/check_mk/First-Installation.txt %{_sysconfdir}/check_mk/conf.d %{_datadir}/check_mk/agents %{_datadir}/check_mk/modules %{_datadir}/check_mk/checks %{_datadir}/check_mk/pnp-templates %{_datadir}/check_mk/notifications %{_datadir}/check_mk/check_mk_templates.cfg %config(noreplace) %{_sysconfdir}/httpd/conf.d/zzz_check_mk.conf %config(noreplace) %{_sysconfdir}/nagios/objects/check_mk_templates.cfg %attr(755, nagios, nagios) %{_localstatedir}/lib/check_mk/* %doc COPYING ChangeLog AUTHORS %files agent %{_bindir}/check-mk-agent %{_datadir}/check-mk-agent %config(noreplace) %{_sysconfdir}/xinetd.d/check-mk-agent %config(noreplace) %{_sysconfdir}/check-mk-agent %doc COPYING %files docs %doc %{_docdir}/check_mk %files multisite %{_datadir}/check_mk/web %config(noreplace) %{_sysconfdir}/check_mk/multisite.mk %config(noreplace) %{_sysconfdir}/check_mk/multisite.mk-1.2.2 %{_sysconfdir}/check_mk/multisite.d %files livestatus %{_bindir}/unixcat %ifarch i686 %{_prefix}/lib/check_mk %endif %ifarch x86_64 %{_prefix}/lib64/check_mk %endif %changelog * Tue Apr 09 2013 Andrea Veri 1.2.2-1%{?dist} - New upstream release. - Added a depends on Nagios. - Start shipping the docs, multisite, livestatus packages. - Make sure the check_mk_templates.cfg file gets installed on the relevant Nagios directory. - Add the missing licenses. - Switch package name to check-mk. - Livestatus build has been fixed, switch the build/install system to use upstream's setup.sh. - Include an handy First-Installation.txt file with instructions about what steps you should follow right after installing the check-mk's package. * Fri Apr 05 2013 Andrea Veri 1.2.0p4-1%{?dist} - First package release.