2023-12-04 11:32:29 +08:00
|
|
|
%define debug_package %{nil}
|
|
|
|
|
|
|
|
|
|
Name: prometheus-ha_cluster_exporter
|
|
|
|
|
# Version will be processed via set_version source service
|
2023-12-06 16:19:58 +08:00
|
|
|
Version: 1.3.3
|
2024-02-29 09:16:11 +08:00
|
|
|
Release: 2
|
2023-12-04 11:32:29 +08:00
|
|
|
Summary: Prometheus exporter for Pacemaker HA clusters metrics
|
|
|
|
|
License: Apache-2.0
|
|
|
|
|
URL: https://github.com/ClusterLabs/ha_cluster_exporter
|
|
|
|
|
Source: https://github.com/ClusterLabs/ha_cluster_exporter/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
|
|
|
# tar -xvf Source0
|
|
|
|
|
# run 'go mod vendor' in it
|
2023-12-06 16:19:58 +08:00
|
|
|
# run 'go env -w GOPROXY=https://goproxy.cn'
|
|
|
|
|
# tar -czvf vendor.tar.gz vendor
|
2023-12-04 11:32:29 +08:00
|
|
|
Source1: vendor.tar.gz
|
|
|
|
|
|
2023-12-06 16:19:58 +08:00
|
|
|
BuildRequires: golang >= 1.20
|
2023-12-04 11:32:29 +08:00
|
|
|
BuildRequires: systemd
|
|
|
|
|
|
|
|
|
|
Provides: ha_cluster_exporter = %{version}-%{release}
|
|
|
|
|
Provides: prometheus(ha_cluster_exporter) = %{version}-%{release}
|
2024-02-29 09:16:11 +08:00
|
|
|
ExclusiveArch: aarch64 x86_64 loongarch64
|
2023-12-04 11:32:29 +08:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
Prometheus exporter for Pacemaker HA clusters metrics
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -T -n %{name}-%{version} -b 0
|
|
|
|
|
tar -xzvf %{SOURCE1}
|
|
|
|
|
|
|
|
|
|
%define shortname ha_cluster_exporter
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
export CGO_ENABLED=0
|
|
|
|
|
go build -mod=vendor \
|
|
|
|
|
-buildmode=pie \
|
|
|
|
|
-ldflags="-s -w -X github.com/prometheus/common/version.Version=%{version}" \
|
|
|
|
|
-o %{shortname}
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
install -D -m 755 %{shortname} %{buildroot}%{_bindir}/%{shortname}
|
|
|
|
|
install -D -m 644 %{shortname}.service %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
|
install -D -m 644 %{shortname}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig.%{name}
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%systemd_post %{name}.service
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun %{name}.service
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
%systemd_postun %{name}.service
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%doc *.md
|
|
|
|
|
%doc doc/*
|
|
|
|
|
%doc LICENSE
|
|
|
|
|
%{_bindir}/%{shortname}
|
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
|
%{_sysconfdir}/sysconfig.%{name}
|
|
|
|
|
|
|
|
|
|
%changelog
|
2024-02-29 09:16:11 +08:00
|
|
|
* Thu Feb 29 2024 doupengda <doupengda@loongson.cn> - -1.3.3-2
|
|
|
|
|
- add loongarch64 to ExclusiveArch
|
|
|
|
|
|
2023-12-06 16:19:58 +08:00
|
|
|
* Tue Dec 5 2023 <zouzhimin@kylinos.cn> -1.3.3-1
|
|
|
|
|
- update package to version 1.3.3
|
|
|
|
|
|
2023-12-04 11:32:29 +08:00
|
|
|
* Mon Nov 27 2023 <zouzhimin@kylinos.cn> -1.3.1-1
|
|
|
|
|
- init package 1.3.1 release
|