Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
pnp4icinga
> pnp4icinga.spec
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File pnp4icinga.spec of Package pnp4icinga (Revision 7)
Currently displaying revision
7
,
show latest
# # spec file for package pnp4nagios # # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # %define _default_patch_fuzz 3 Name: pnp4icinga %define realname pnp4nagios Summary: Tool for producing graphs from Nagios perfdata Version: 0.6.24 Release: 1 Url: http://www.ederdrom.de/pnp/start License: GPL v2 or later Group: System/Monitoring BuildRequires: apache2-devel BuildRequires: icinga-www BuildRequires: kohana Requires: kohana Requires: icinga-www Requires: rrdtool Requires: syslog Requires: perl Recommends: dejavu # %if 0%{?mandriva_version} # break the "have choice for" cycle BuildRequires: apache-mpm-prefork BuildRequires: mailx %endif # %if 0%{?suse_version} Requires: php-zlib Requires: php-gd %endif %if 0%{suse_version} > 1020 BuildRequires: fdupes BuildRequires: rrdtool-devel %else BuildRequires: rrdtool %endif Source0: %realname-%version.tar.bz2 Source1: %name-httpd.conf Source2: %name.quick-start.txt Source3: %name-init Source4: pnp4icinga-rpmlintrc Source5: pnp4icinga-nagios-pnp.cfg Source6: pnp4icinga-check_nrpe.cfg Patch1: pnp4icinga-0.6.13-check_pnp_rrds.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %define nsusr icinga %define nsgrp icinga %define apxs2 /usr/sbin/apxs2-prefork %define apache2_sysconfdir %(%{apxs2} -q SYSCONFDIR) %define libexecdir %_prefix/lib/nagios/plugins %define perfdata_spooldir /var/spool/icinga-pnp %description PNP is a tool that produces graphs from performance data from Nagios plugins. Authors: -------- Jörg Linge Hendrik Bäcker %prep %setup -q -n %realname-%version %patch1 -p0 %build %configure \ --mandir=%{_mandir} \ --datadir=%_datadir/pnp \ --datarootdir=%_datadir/pnp/html \ --localstatedir=/var/log/icinga/pnp \ --sysconfdir=%_sysconfdir/icinga/pnp \ --libexecdir=%libexecdir \ --datarootdir=%_datadir/pnp \ --with-perfdata-logfile=/var/log/icinga/pnp/perfdata.log \ --with-perfdata-dir=/var/lib/icinga/pnp \ --with-perfdata-spool-dir=%{perfdata_spooldir} \ --with-init-dir=%_sysconfdir/init.d \ --with-nagios-user=%nsusr \ --with-nagios-group=%nsgrp \ --without-kohana \ --with-kohana_system=/usr/share/kohana/system make %{?jobs:-j%jobs} all %install mkdir -p %buildroot/var/lib/icinga/pnp %buildroot/var/log/icinga/pnp make install install-config \ DESTDIR="%buildroot" \ LIBEXEC_DIR="%libexecdir" \ INSTALL_OPTS="" # move samples to the docudir mkdir -p %buildroot/%_defaultdocdir/%name/sample-config find sample-config/ -name "*-sample*" -exec cp -v {} %buildroot/%_defaultdocdir/%name/sample-config/ \; # install config files not installed via Makefile sed -e 's@/usr/local/nagios/var/npcd.log@/var/log/icinga/pnp/npcd.log@' \ -e 's@/usr/var/perfspool/@%{perfdata_spooldir}@' \ -e 's@/usr/local/nagios/libexec/process_perfdata.pl@%libexecdir/process_perfdata.pl@' \ -e 's@/usr/libexec@%libexecdir@' \ %buildroot/%_defaultdocdir/%name/sample-config/npcd.cfg-sample > %buildroot/%_sysconfdir/icinga/pnp/npcd.cfg cp %buildroot/%_defaultdocdir/%name/sample-config/process_perfdata.cfg-sample %buildroot/%_sysconfdir/icinga/pnp/process_perfdata.cfg cp %buildroot/%_defaultdocdir/%name/sample-config/rra.cfg-sample %buildroot/%_sysconfdir/icinga/pnp/rra.cfg sed -e 's@\^hna0@localhost@' \ -e 's@\^traffic@traffic@' \ %buildroot/%_sysconfdir/icinga/pnp/pages/web_traffic.cfg-sample > %buildroot/%_sysconfdir/icinga/pnp/pages/web_traffic.cfg mv %buildroot/%_sysconfdir/icinga/pnp/check_commands/check_nwstat.cfg-sample %buildroot/%_sysconfdir/icinga/pnp/check_commands/check_nwstat.cfg install -m644 %{SOURCE6} %buildroot/%_sysconfdir/icinga/pnp/check_commands/check_nrpe.cfg find %buildroot/%_sysconfdir/icinga/pnp -name "*-sample" -exec rm {} \; # fix pathname to the kohana files sed -i "s|^\$kohana_modules.*|\$kohana_modules = '/usr/share/kohana/modules';|" %buildroot/%_datadir/pnp/index.php rm %buildroot/%_datadir/pnp/install.php # install own icinga command file install -m644 %{SOURCE5} %buildroot/%_sysconfdir/icinga/icinga-pnp.cfg # install the documentation mkdir -p %buildroot/%_defaultdocdir/%name install -m0644 AUTHORS ChangeLog COPYING README* THANKS %buildroot/%_defaultdocdir/%name/ install -m0644 %{S:2} %buildroot/%_defaultdocdir/%name/README.SuSE # install contrib scripts into docdir mkdir -p %buildroot/%_defaultdocdir/%name/example # install template placeholder mkdir -p %buildroot/%_datadir/pnp/templates/ touch %buildroot/%_datadir/pnp/templates/PUT-YOUR-TEMPLATES-HERE # install directories install -d -m0775 %buildroot/%{perfdata_spooldir} install -d -m0775 %buildroot/var/log/icinga/pnp/stats # install apache configuration install -d -m 0755 %buildroot/%{apache2_sysconfdir}/conf.d/ install -m0644 %{SOURCE1} %buildroot/%{apache2_sysconfdir}/conf.d/icinga-pnp.conf # install init-script mkdir -p %buildroot/%_sysconfdir/init.d install -m0755 %{SOURCE3} %buildroot/%_sysconfdir/init.d/npcd mkdir -p %buildroot/%_sbindir ln -s %_sysconfdir/init.d/npcd %buildroot/%_sbindir/rcnpcd mkdir -p %{buildroot}%{_mandir} mv %{buildroot}%{_prefix}/man/man8 %{buildroot}%{_mandir}/ rmdir %{buildroot}%{_prefix}/man chmod -x %{buildroot}%{_mandir}/man8/* # save discspace, create links %if 0%{suse_version} > 1020 %fdupes -s %buildroot/%_datadir/pnp %endif %clean rm -rf %buildroot %preun %stop_on_removal npcd %postun %insserv_cleanup npcd %files %defattr(-,root,root) %doc %_defaultdocdir/%name/ %dir %_datadir/pnp %dir %_sysconfdir/icinga/pnp %{_libdir}/npcdmod.o %{_mandir}/man8/npcd.8* %attr(-,%nsusr,%nsgrp) %dir %{perfdata_spooldir} %attr(-,%nsusr,%nsgrp) %dir /var/log/icinga/pnp %attr(-,%nsusr,%nsgrp) %dir /var/log/icinga/pnp/stats %{_bindir}/* %_datadir/pnp/* %dir %_prefix/lib/nagios %dir %_prefix/lib/nagios/plugins %attr(0755,root,root) %libexecdir/* # %{_mandir}/man1/* %_sbindir/rcnpcd %_sysconfdir/init.d/npcd %config(noreplace) %_sysconfdir/icinga/pnp/* %config(noreplace) %apache2_sysconfdir/conf.d/icinga-pnp.conf #%config(noreplace) %_sysconfdir/xinetd.d/icinga-pnp %config(noreplace) %_datadir/pnp/templates/* %config(noreplace) %_sysconfdir/icinga/icinga-pnp.cfg %defattr(775,wwwrun,www) %_datadir/pnp/application/cache #%_datadir/pnp/application/logs %changelog