File monitoring-plugins-snmp.spec of Package monitoring-plugins-snmp

#
# spec file for package nagios-pluings-snmp
#
# Copyright (c) 2012-2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           monitoring-plugins-snmp
Version:        1.1.1
Release:        100
License:        GPL-2.0
%define         realname nagios-snmp-plugins
Summary:        SNMP Plugins for Nagios v3.x in Perl
Url:            http://nagios.manubulon.com/
Group:          System/Monitoring
Source:         %realname.%version.tar.bz2
Source1:        monitoring-plugins-snmp-commands
Source2:        monitoring-plugins-snmp-services
BuildArch:      noarch
BuildRequires:  nagios-rpm-macros
BuildRequires:  net-snmp-devel
Provides:       nagios-plugins-snmp = %{version}-%{release}
Obsoletes:      nagios-plugins-snmp < %{version}-%{release}
Requires:       monitoring-plugins-common
Requires:       perl(Getopt::Long)
Requires:       perl(Net::SNMP)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Nagios is a program that will monitor hosts and services on your
network, and to email or page you when a problem arises or is
resolved. Nagios runs on a unix server as a background or daemon
process, intermittently running checks on various services that you
specify.

The actual service checks are performed by separate "plugin"
programs which return the status of the checks to Nagios. This package
contains additional SNMP check plugins written in Perl from
http://nagios.manubulon.com/

%prep
%setup -q -n nagios_plugins
chmod 644 doc/*

%build

%install
mkdir -p %{buildroot}%{nagios_spooldir}/snmp
mkdir -p %{buildroot}%{nagios_plugindir}
mkdir -p %{buildroot}%{nagios_sysconfdir}/snmp
for i in *.pl; do
    sed -e 's@/usr/local/nagios/libexec@%{nagios_plugindir}@' \
        -e 's@/tmp/tmp_Nagios@%{nagios_spooldir}/snmp@' \
        $i > %{buildroot}%{nagios_plugindir}/$i
	chmod +x %{buildroot}%{nagios_plugindir}/$i
done
install -m0644 %SOURCE1 %{buildroot}%{nagios_sysconfdir}/snmp/commands.cfg
install -m0644 %SOURCE2 %{buildroot}%{nagios_sysconfdir}/snmp/services.cfg

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc Changelog LICENSE README doc/*
%dir %{nagios_sysconfdir}
%dir %{nagios_sysconfdir}/snmp
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%dir %{nagios_spooldir}
%config(noreplace) %{nagios_sysconfdir}/snmp/*
%attr(0775,%nagios_user,%nagios_group) %dir %{nagios_spooldir}/snmp
%{nagios_plugindir}/*

%changelog
openSUSE Build Service is sponsored by