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

#
# spec file for package monitoring-plugins-prometheus
#
# Copyright (c) 2024-2025, 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_prometheus
Name:           monitoring-plugins-prometheus
Version:        0.4.0
Release:        0
Summary:        Icinga/Nagios check plugin to check Prometheus
License:        GPL-2.0-or-later
Group:          System/Monitoring
URL:            https://github.com/NETWAYS/check_prometheus
#Git-Clone:     https://github.com/NETWAYS/check_prometheus.git
Source0:        %{realname}-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  go
BuildRequires:  golang-packaging
BuildRequires:  nagios-rpm-macros
%{go_provides}

%description
Icinga/Nagios check plugin to check Prometheus.

%prep
%autosetup -a 1 -n %{realname}-%{version}

%build
go build \
  -mod=vendor \
  -buildmode=pie \
  -o check_prometheus .

%install
install -Dm 0755 check_prometheus %{buildroot}/%{nagios_plugindir}/check_prometheus

%files
%license LICENSE
%doc README.md
%dir %{nagios_libdir}
%dir %{nagios_plugindir}/
%{nagios_plugindir}/check_prometheus

%changelog
openSUSE Build Service is sponsored by