%undefine _missing_build_ids_terminate_build

Name:           haproxy_exporter
Version:        0.15.0
Release:        1
Summary:        A simple server for prometheus consumption
License:        Apache-2.0 and MIT
URL:            https://github.com/prometheus/haproxy_exporter
Source0:        https://github.com/prometheus/haproxy_exporter/archive/v%{version}/%{name}-%{version}.tar.gz
# tar -xvf Source0
# run 'go mod vendor' in it
# tar -czvf haproxy_exporter-vendor.tar.gz vendor
Source1:        haproxy_exporter-vendor.tar.gz
Patch0:         using-vendor.patch

BuildRequires:  make golang promu

%description
Simple server that scrapes HAProxy stats and exports them
via HTTP for Prometheus consumption

%prep
%autosetup -b0 -a1 -n %{name}-%{version} -p1

%build
promu build

%install
install -d -p %{buildroot}%{_bindir}
install -m 755 %{_builddir}/%{name}-%{version}/%{name}-%{version} %{buildroot}%{_bindir}/haproxy_exporter

%files
%license LICENSE
%doc README.md
%{_bindir}/haproxy_exporter

%changelog
* Thu Dec 28 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.15.0-1
- Update package to version 0.15.0

* Tue Jan 31 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.14.0-1
- Update package to version 0.14.0

* Thu Jun 9 2022 lijian <lijian2@kylinos.cn> - 0.13.0-1
- Package init