File monitoring-plugins-sap-ccms.spec of Package monitoring-plugins-sap-ccms

#
# spec file for package monitoring-plugins-sap-ccms
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           monitoring-plugins-sap-ccms
Version:        0.8
Release:        0
Summary:        Nagios/Icinga Plug-In for SAP CCMS Monitoring
License:        BSD-3-Clause AND NonFree
Group:          System/Monitoring
URL:            https://sourceforge.net/projects/nagios-sap-ccms/
Source0:        https://master.dl.sourceforge.net/project/nagios-sap-ccms/nagios-sap-ccms/%{version}/sap-ccms-plugin-%{version}.tar.bz2
Source1:        ccms.pdf
Source2:        ccms_plugin.pdf
BuildRequires:  nagios-rpm-macros
BuildRequires:  fdupes
ExclusiveArch:  %{ix86} x86_64

%description
These Monitoring Plugins provide an interface to the SAP CCMS Infrastructure and
display the results in Nagios/Icinga/...

%prep
%setup -q -n nagios-sap-ccms
install -m 644 %{SOURCE1} .
install -m 644 %{SOURCE2} .

%build
cd src
export CFLAGS="%{optflags} -fcommon"
%make_build

%install
mkdir -p %{buildroot}/%{nagios_plugindir}
mkdir -p %{buildroot}/%{_sbindir}
mkdir -p %{buildroot}/%{_sysconfdir}/sapmon
pushd src
install -m 755 check_sap               %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_cons          %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_cpu_load      %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_instance      %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_instance_cons %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_multiple      %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_mult_no_thr   %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_system        %{buildroot}/%{nagios_plugindir}/
install -m 755 check_sap_system_cons   %{buildroot}/%{nagios_plugindir}/
install -Dm755 sap_moni.so             %{buildroot}/%{_libdir}/sap_moni.so
install -m 755 create_cfg              %{buildroot}/%{_sbindir}/
install -m 755 sap_change_thr          %{buildroot}/%{_sbindir}/
%ifarch %{ix86}
archdir='x86'
%else
archdir='%{_arch}'
%endif
install -m 755 libs/$archdir/librfccm.so %{buildroot}/%{_libdir}/librfccm.so
popd
cp -r config/* %{buildroot}/%{_sysconfdir}/sapmon/

%fdupes %{buildroot}/%{nagios_plugindir}

%files
%license LICENSE
%doc doc/Documentation.pdf ccms.pdf ccms_plugin.pdf
%dir %{_sysconfdir}/sapmon
%dir %{_prefix}/lib/nagios
%dir %{nagios_plugindir}
%config(noreplace) %{_sysconfdir}/sapmon/*
%{_libdir}/sap_moni.so
%{_libdir}/librfccm.so
%{_sbindir}/create_cfg
%{_sbindir}/sap_change_thr
%{nagios_plugindir}/*

%changelog
openSUSE Build Service is sponsored by