File nrpe.spec of Package nrpe

%define icinga_prefix /usr/lib/icinga
%define plugins_dir plugins
%define bin_dir /usr/bin
%define sbin_dir /usr/sbin
%define etc_dir /etc/icinga

Summary: Icinga monitoring (nrpe client)
Name: nrpe
Version: 2.12
Release: 10
License: GPL
Group: Applications
Source: %{name}-%{version}.tar.gz 
URL: http://nagiosplugins.org/download
Packager: Matt Delves <m.delves@ballarat.edu.au>
Requires: icinga-plugins
BuildRequires: openssl-devel, openssl
BuildRoot: %{_tmppath}/%{name}-root

%description
Icinga is a fork of the Nagios monitoring solution. This package contains the plugins required to get icinga working. This is the linux client package

%prep
%setup

%pre
/usr/sbin/groupadd -r icinga 2>/dev/null || :
/usr/sbin/useradd -g icinga -c "Icinga" \
    -s /sbin/nologin -r -d /var/lib/icinga icinga 2>/dev/null || :

%build
./configure --prefix=%{icinga_prefix} --bindir=%{bin_dir} --sbindir=%{sbin_dir} --sysconfdir=%{etc_dir} --libexecdir=%{icinga_prefix}/%{plugins_dir} --with-nagios-user=icinga --with-nagios-group=icinga --with-nrpe-user=icinga --with-nrpe-group=icinga --enable-command-args

make all

%install
install -d -m 0775 ${RPM_BUILD_ROOT}/usr/lib/icinga
install -d -m 0775 ${RPM_BUILD_ROOT}/usr/lib/icinga/plugins
install -d -m 0775 ${RPM_BUILD_ROOT}/etc/xinetd.d
install -d -m 0775 ${RPM_BUILD_ROOT}/etc/icinga

make DESTDIR=${RPM_BUILD_ROOT} INSTALL=install NAGIOS_INSTALL_OPTS="" NRPE_INSTALL_OPTS="" install
#make INSTALL=install NAGIOS_INSTALL_OPTS="" NRPE_INSTALL_OPTS="" install-plugin
#make INSTALL=install NAGIOS_INSTALL_OPTS="" NRPE_INSTALL_OPTS="" install-daemon
make DESTDIR=${RPM_BUILD_ROOT} INSTALL=install NAGIOS_INSTALL_OPTS="" NRPE_INSTALL_OPTS="" install-daemon-config
#make DESTDIR=${RPM_BUILD_ROOT} INSTALL=install NAGIOS_INSTALL_OPTS="" NRPE_INSTALL_OPTS="" install-xinetd
#cp ${STAGING}/sample-config/nrpe.xinetd ${RPM_BUILD_ROOT}/etc/xinetd.d/nrpe
install -m 644  sample-config/nrpe.xinetd ${RPM_BUILD_ROOT}/etc/xinetd.d/nrpe


%files
%defattr(-,icinga,icinga)
/usr/bin/nrpe
/usr/lib/icinga/plugins/check_nrpe
/etc/icinga/nrpe.cfg
/etc/xinetd.d/nrpe
openSUSE Build Service is sponsored by