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

#
# spec file for monitoring-plugins-network
#
# 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/
#

%global provider        github
%global provider_tld    com
%global project         araujobsd
%global repo            icinga2-network-plugin
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path     %{provider_prefix}
%define realname check_network
Name:           monitoring-plugins-network
Version:        1.0
Release:        0
Summary:        A Nagios/Icinga plugin to monitor network traffic
License:        BSD-2-Clause
Group:          System/Monitoring
URL:            https://github.com/araujobsd/icinga2-network-plugin/
Source:         https://github.com/araujobsd/icinga2-network-plugin/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  golang-packaging
BuildRequires:  nagios-rpm-macros
Requires:       vnstat >= 2.0
%{go_nostrip}
%{go_provides}

%description
A Nagios/Icinga plugin that uses vnstat to monitor network traffic.
You can define warning and critical limits for the Transmit- and
Receive Rate on network interfaces (5 seconds sampling interval).

%prep
%setup -q -n icinga2-network-plugin-%{version}

%build
sed -i 's|%{_prefix}/local/|%{_prefix}/|g' bsd_network.go
%{goprep} %{import_path}
%{gobuild} ...

%install
%{goinstall}
%{gosrc}
install -d %{buildroot}/%{nagios_plugindir}/
mv %{buildroot}%{_bindir}/icinga2-network-plugin %{buildroot}/%{nagios_plugindir}/check_network
%{gofilelist}

%check
%{gotest} %{import_path}...

%files -f file.lst
%license LICENSE
%doc README.md
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_network

%changelog