File nagios-plugins.spec of Package nagios-plugins

#
# spec file for package nagios-plugins (Version 1.4.13)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           nagios-plugins
Summary:        The Nagios Plug-Ins
Version:        1.4.13
Release:        4
Url:            http://nagiosplug.sourceforge.net/
License:        GPL v2 or later
Group:          System/Monitoring
BuildRequires:  bind-utils dhcp-devel fping iputils libsmbclient-devel
BuildRequires:  mysql-devel net-snmp-devel openldap2-devel openssh perl-Net-SNMP
BuildRequires:  gnutls-devel postfix postgresql-devel procps python-devel samba-client
BuildRequires:  nagios-devel
%if 0%{?suse_version}
%if 0%{?suse_version} > 1020
BuildRequires:  freeradius-client-devel
%else
BuildRequires:  freeradius-devel
%endif
%if 0%{?suse_version} < 1010
BuildRequires:  heimdal-devel
%else
BuildRequires:  krb5-devel syslog-ng
%endif
%else
BuildRequires:  krb5-devel
%endif
Source0:        nagios-plugins-%{version}.tar.bz2
Source10:       nagios-plugins.check_xenvm.sh
Source11:       nagios-plugins-permissions
Source12:       nagios-plugins-README.SuSE
Patch6:         nagios-plugins-1.4.6-no_chown.patch
Patch8:         nagios-plugins.ctypes.patch
Patch9:         nagios-plugins.check_dhcp-char.patch
Patch10:        nagios-plugins.asprintf.patch
Patch11:        nagios-plugins.check_snmp.arrayaddress.patch
Patch12:        nagios-plugins-postgresql.patch
Patch13:        nagios-plugins.negate.validate_arguments.patch
Patch14:        check_ntp_peer-buffer-overflow.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       perl-Net-SNMP
%define         libexecdir %_prefix/lib/nagios/plugins

%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 those plugins.



Authors:
--------
    Karl DeBisschop <kdebisschop@users.sourceforge.net>
    and others

%package  extras
License:        GPL v2 or later
Summary:        Nagios Plug-Ins which depend on additional packages
Group:          System/Monitoring
Requires:       %name net-snmp fping

%description extras
These are additional plug-ins for Nagios.

They depend on other packages which have to be installed.



Authors:
--------
    Karl DeBisschop <kdebisschop@users.sourceforge.net>
    and others

%prep
%setup -q
#%patch2
#%patch3
#%patch4
%patch6
%patch8 -p1
#%patch7
%patch9 -p1
%patch10 -p1
%patch11
%patch12
%patch13 -p1
%patch14

%build
export CFLAGS="%optflags -fno-strict-aliasing -DLDAP_DEPRECATED"
%configure \
	--libexecdir=%libexecdir \
	--with-cgiurl=/nagios/cgi-bin \
	--sysconfdir=%_sysconfdir/nagios \
	--enable-static=no \
	--with-fping-command=%_sbindir/fping \
    --with-apt-get-command=%_bindir/apt-get \
    --with-qstat-command=%_bindir/qstat \
    --with-rpcinfo-command=%_sbindir/rpcinfo \
    --with-ps-command="/bin/ps axwo 'stat uid pid ppid vsz rss pcpu etime comm args'" \
    --with-ps-format='%s %d %d %d %d %d %f %s %s %n' \
    --with-ps-cols=10 \
    --with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos' \
    --with-mysql
	#--enable-perl-modules 
make all %{?jobs:-j%jobs}

%install
sed -i 's,^MKINSTALLDIRS.*,MKINSTALLDIRS = ../mkinstalldirs,' po/Makefile
%makeinstall
install -D -m 664 command.cfg %buildroot/%_sysconfdir/nagios/command.cfg
cp -avL %{S:10} $RPM_BUILD_ROOT%{libexecdir}/check_xenvm
%{__install} -m 0755 contrib/check_linux_raid.pl %{buildroot}%libexecdir/
%{__install} -m 0755 contrib/check_netapp.pl %{buildroot}%libexecdir/
pushd %buildroot/%libexecdir
for file in $(find -maxdepth 1 -type f); do
    sed -i 's|use lib "nagios/plugins".*;|use lib "%libexecdir";|g;
            s|use lib "/usr/local/nagios/libexec".*;|use lib "%libexecdir";|g' $file
done
popd
mkdir -p %buildroot/%_defaultdocdir/%{name}
install -Dm644 %{SOURCE11} %buildroot/%_defaultdocdir/%{name}/example/permissions.d/nagios-plugins
install -m644 ACKNOWLEDGEMENTS AUTHORS BUGS CODING COPYING ChangeLog NEWS README FAQ SUPPORT REQUIREMENTS THANKS LEGAL %buildroot/%_defaultdocdir/%{name}/
install -m644 %{SOURCE12} %buildroot/%_defaultdocdir/%{name}/
%find_lang %name

%clean
rm -rf %buildroot

%files -f %name.lang
%defattr(-,root,root)
%doc %_defaultdocdir/%{name}
%dir %_sysconfdir/nagios
%dir %_prefix/lib/nagios
%dir %libexecdir
%config(missingok,noreplace) %_sysconfdir/nagios/command.cfg
%defattr(0755,root,root)
%libexecdir/check_breeze
%libexecdir/check_by_ssh
%libexecdir/check_clamd
%libexecdir/check_cluster
# FIXME: add to /etc/permissins - check_dhcp seems to need this
# %attr(4755,root,root) %libexecdir/check_dhcp
%libexecdir/check_dhcp
%libexecdir/check_dig
%libexecdir/check_disk
%libexecdir/check_disk_smb
%libexecdir/check_dns
%libexecdir/check_dummy
%libexecdir/check_file_age
%libexecdir/check_flexlm
%libexecdir/check_ftp
%libexecdir/check_http
%libexecdir/check_icmp
%libexecdir/check_ide_smart
%libexecdir/check_ifoperstatus
%libexecdir/check_ifstatus
%libexecdir/check_imap
%libexecdir/check_ircd
%libexecdir/check_linux_raid.pl
%libexecdir/check_load
%libexecdir/check_log
%libexecdir/check_mailq
%libexecdir/check_mrtg
%libexecdir/check_mrtgtraf
%libexecdir/check_nagios
%libexecdir/check_netapp.pl
%libexecdir/check_nntp
%libexecdir/check_nt
%libexecdir/check_ntp
%libexecdir/check_ntp_peer
%libexecdir/check_ntp_time
%libexecdir/check_nwstat
%libexecdir/check_oracle
%libexecdir/check_overcr
%libexecdir/check_ping
%libexecdir/check_pop
%libexecdir/check_procs
%libexecdir/check_real
%libexecdir/check_rpc
%libexecdir/check_sensors
%libexecdir/check_smtp
%libexecdir/check_ssh
%libexecdir/check_swap
%libexecdir/check_tcp
%libexecdir/check_time
%libexecdir/check_udp
%libexecdir/check_ups
%libexecdir/check_users
%libexecdir/check_wave
%attr(0755,root,root) %libexecdir/check_xenvm
%libexecdir/negate
%libexecdir/urlize
%libexecdir/utils.sh
%attr(0644,root,root) %libexecdir/utils.pm

%files extras
%defattr(0755,root,root)
%libexecdir/check_fping
%libexecdir/check_hpjd
%libexecdir/check_ldap
%libexecdir/check_ldaps
%libexecdir/check_mysql
%libexecdir/check_mysql_query
%libexecdir/check_pgsql
#%libexecdir/check_radius
%libexecdir/check_snmp
%libexecdir/check_jabber
%libexecdir/check_nntps
%libexecdir/check_simap
%libexecdir/check_spop
%libexecdir/check_ssmtp
%libexecdir/check_apt
%libexecdir/check_game

%changelog
openSUSE Build Service is sponsored by