Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
:
icinga
:
production
>
icinga-mod_gearman
> icinga-mod_gearman.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File icinga-mod_gearman.spec of Package icinga-mod_gearman
## %define monitor nagios %define monitor icinga %define pkgname mod_gearman Name: %{monitor}-%{pkgname} Version: 1.4.14 Release: 1 Group: Application/System License: GPLv3 Url: http://labs.consol.de/lang/de/nagios/mod-gearman/ Summary: Distributed active Icinga/Nagios checks Source0: %{pkgname}-%{version}.tar.bz2 Source1: mod_gearman-worker-suse.init Source2: mod_gearman_worker.sysconfig Patch0: mod_gearman-init-worker.patch Patch1: mod_gearman-worker-config.patch Patch2: mod_gearman-logrotate-1.4.14.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: gcc-c++ gearmand-devel >= 0.14 ncurses-devel sed BuildRequires: autoconf automake BuildRequires: %{monitor} # for make check BuildRequires: gearmand BuildRequires: nagios-plugins %description Mod Gearman is a new way of distributing active Nagios checks across your network. It consists of two parts: There is a NEB module which resides in the Nagios core and adds servicechecks, hostchecks and eventhandler to a Gearman queue. There can be multiple equal gearman servers. The counterpart is one or more worker clients for the checks itself. They can be bound to host and servicegroups. %package server Group: Application/System Summary: The server part of mod_gearman Requires: %{monitor}-%{pkgname} Requires: %{monitor} Requires: %{monitor}-%{pkgname}-plugins = %{version} %description server This package includes reuired files to run a mod_gearman server. %package worker Group: Application/System Summary: The worker part of mod_gearman Requires: %{monitor}-%{pkgname} Requires(pre): pwdutils Requires: %{monitor}-%{pkgname}-plugins = %{version} Requires: logrotate %description worker This package includes only the files needed for a mod_gearman worker. %package plugins Group: Application/System Summary: Plugins to check mod_gearman functionality %description plugins This package includes all checkplugins for mod_gearman. %prep %setup -n %{pkgname}-%{version} %patch0 %patch1 %patch2 %build [ ! -f ./configure ] && ./autogen.sh %configure \ --enable-debug \ --with-user=%{monitor} \ --with-init-dir=%{_sysconfdir}/init.d %__make %install %__make DESTDIR=%{buildroot} install %if 0%{?suse_version} %__install -D -m0755 %{S:1} %{buildroot}/etc/init.d/mod_gearman_worker %__install -D -m0644 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.mod_gearman_worker sed -i s@"%USERID%"@"%{monitor}"@ %{buildroot}/var/adm/fillup-templates/sysconfig.mod_gearman_worker %__install -d -m0755 %{buildroot}%{_sbindir} ln -sf ../../etc/init.d/mod_gearman_worker %{buildroot}%{_sbindir}/rcmod_gearman_worker %endif %__install -D -m0644 %{buildroot}%{_datadir}/mod_gearman/standalone_worker.conf %{buildroot}%{_sysconfdir}/%{pkgname}/mod_gearman_worker.conf %__install -D -m0644 etc/mod_gearman_logrotate %{buildroot}%{_sysconfdir}/logrotate.d/mod_gearman %__install -D -m0644 etc/mod_gearman_logrotate %{buildroot}%{_sysconfdir}/logrotate.d/mod_gearman_server %__install -d %{buildroot}/var/log/mod_gearman_worker %__install -d %{buildroot}/var/log/mod_gearman %__install -d %{buildroot}/var/run/mod_gearman # use nagios as plugindir not icinga, because all plugins are there %__install -d %{buildroot}%{_prefix}/lib/nagios/plugins mv %{buildroot}%{_bindir}/check_gearman %{buildroot}%{_bindir}/send_gearman %{buildroot}%{_bindir}/send_multi %{buildroot}%{_prefix}/lib/nagios/plugins/ rm -rf %{buildroot}%{_sysconfdir}/init.d/gearmand %check export PATH=/usr/sbin:/sbin:/usr/bin:/bin ## __make test %clean rm -rf %{buildroot} %preun worker if [ $1 == 0 ] ; then %if 0%{?suse_version} %stop_on_removal %else /sbin/service mod_gearman_worker stop || : %endif fi %postun worker if [ $1 == 1 ] ; then %if 0%{?suse_version} %restart_on_update mod_gearman_worker %else /sbin/service mod_gearman_worker restart || : %endif elif [ $1 == 0 ] ; then %if 0%{?suse_version} %insserv_cleanup %else /sbin/chkconfig --del mod_gearman_worker || : %endif fi %post worker if [ $1 == 1 ] ; then %if 0%{?suse_version} %fillup_and_insserv -y -n mod_gearman_worker %else /sbin/chkconfig --add mod_gearman_worker || : %endif elif [ $1 == 2 ] ; then /sbin/service mod_gearman_worker restart || : fi %pre worker %if 0%{?suse_version} getent group %{monitor} >/dev/null || groupadd -r %{monitor} getent passwd %{monitor} >/dev/null || useradd -r -g %{monitor} -d %{_datadir}/mod_gearman -s /sbin/nologin -c "mod_gearman_worker" %{monitor} exit 0 %endif %files %defattr(-,root,root) %doc Changes COPYING README THANKS TODO docs/README.html %dir %{_libdir}/mod_gearman %{_libdir}/mod_gearman/mod_gearman.o %files worker %defattr(-,root,root) %dir %{_sysconfdir}/%{pkgname} %config(noreplace) %{_sysconfdir}/%{pkgname}/mod_gearman_worker.conf %config %{_sysconfdir}/logrotate.d/mod_gearman %{_sysconfdir}/init.d/mod_gearman_worker %{_sbindir}/rcmod_gearman_worker %{_bindir}/mod_gearman_worker %dir %{_datadir}/mod_gearman %{_datadir}/mod_gearman/standalone_worker.conf %{_datadir}/mod_gearman/gearman_proxy.pl %dir %attr(-,%{monitor},%{monitor}) /var/log/mod_gearman_worker %dir %attr(-,%{monitor},%{monitor}) /var/run/mod_gearman %if 0%{?suse_version} /var/adm/fillup-templates/sysconfig.mod_gearman_worker %endif %files server %defattr(-,root,root) %dir %{_sysconfdir}/%{pkgname} %config(noreplace) %{_sysconfdir}/%{pkgname}/mod_gearman_neb.conf %config %{_sysconfdir}/logrotate.d/mod_gearman_server %dir %{_libdir}/mod_gearman %{_libdir}/mod_gearman/mod_gearman.o %{_bindir}/gearman_top %dir %{_datadir}/mod_gearman %{_datadir}/mod_gearman/shared.conf %dir %attr(-,%{monitor},%{monitor}) /var/log/mod_gearman %files plugins %defattr(-,root,root) # use nagios as plugindir not icinga, because all plugins are there %dir %{_prefix}/lib/nagios %dir %{_prefix}/lib/nagios/plugins %{_prefix}/lib/nagios/plugins/check_gearman %{_prefix}/lib/nagios/plugins/send_gearman %{_prefix}/lib/nagios/plugins/send_multi %changelog