File monitoring-plugins-systemd.spec of Package monitoring-plugins-systemd
#
# spec file for package monitoring-plugins-systemd
#
# Copyright (c) 2019, Martin Hauke <mardnh@gmx.de>
#
# 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/
#
%define realname check_systemd
Name: monitoring-plugins-systemd
Version: 2.3.1
Release: 0
Summary: This plugin for Nagios/Icinga checks systemd for failed units
License: GPL-2.0-only
Group: System/Monitoring
URL: https://github.com/Josef-Friedrich/check_systemd
Source: https://github.com/Josef-Friedrich/check_systemd/archive/v%{version}.tar.gz#/%{realname}-%{version}.tar.gz
BuildRequires: fdupes
BuildRequires: nagios-rpm-macros
BuildRequires: python3-nagiosplugin
BuildRequires: python3-setuptools
# SECTION test requirements
BuildRequires: python3-jfscripts
BuildRequires: python3-nose
# /SECTION
Requires: python3-nagiosplugin
BuildArch: noarch
%description
This plugin for Nagios/Icinga checks systemd for failed units.
%prep
%setup -q -n %{realname}-%{version}
sed 's|#!%{_bindir}/env python3|#!%{_bindir}/python3|' -i check_systemd.py
%build
%python3_build
%install
%python3_install
install -d %{buildroot}/%{nagios_plugindir}
cp %{buildroot}%{_bindir}/check_systemd.py %{buildroot}/%{nagios_plugindir}/check_systemd
rm %{buildroot}%{_bindir}/check_systemd*
%fdupes %{buildroot}%{python3_sitelib}
%check
export PATH=$PATH:%{buildroot}%{nagios_plugindir}
nosetests -v
%files
%license LICENSE
%doc README.md
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_systemd
%{python3_sitelib}/*
%changelog