Compare commits
10 Commits
e53889ece9
...
8bcb2bc4f8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bcb2bc4f8 | ||
|
|
b6a61cc0ef | ||
|
|
16accae4b6 | ||
|
|
46d10d878e | ||
|
|
75db7c6255 | ||
|
|
b7fdbf4e73 | ||
|
|
397573a138 | ||
|
|
14704988d4 | ||
|
|
c043801504 | ||
|
|
ccf4ea5e6b |
BIN
prometheus-ha_cluster_exporter-1.3.3.tar.gz
Normal file
BIN
prometheus-ha_cluster_exporter-1.3.3.tar.gz
Normal file
Binary file not shown.
82
prometheus-ha_cluster_exporter.spec
Normal file
82
prometheus-ha_cluster_exporter.spec
Normal file
@ -0,0 +1,82 @@
|
||||
%define debug_package %{nil}
|
||||
|
||||
Name: prometheus-ha_cluster_exporter
|
||||
# Version will be processed via set_version source service
|
||||
Version: 1.3.3
|
||||
Release: 4
|
||||
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
|
||||
# run 'go env -w GOPROXY=https://goproxy.cn'
|
||||
# tar -czvf vendor.tar.gz vendor
|
||||
Source1: vendor.tar.gz
|
||||
|
||||
BuildRequires: golang >= 1.20
|
||||
BuildRequires: systemd
|
||||
|
||||
Provides: ha_cluster_exporter = %{version}-%{release}
|
||||
Provides: prometheus(ha_cluster_exporter) = %{version}-%{release}
|
||||
ExclusiveArch: aarch64 x86_64 loongarch64 riscv64 sw_64
|
||||
|
||||
%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
|
||||
%ifarch sw_64
|
||||
# Replace sys provided by golang
|
||||
cp -af %{_prefix}/lib/golang/src/cmd/vendor/golang.org/x/sys vendor/golang.org/x/
|
||||
%endif
|
||||
|
||||
%build
|
||||
export CGO_ENABLED=0
|
||||
go build -mod=vendor \
|
||||
%ifnarch sw_64
|
||||
-buildmode=pie \
|
||||
%endif
|
||||
-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
|
||||
* Thu Feb 27 2025 zhangshaoning <zhangshaoning@uniontech.com> - 1.3.3-4
|
||||
- Add sw_64 support
|
||||
|
||||
* Mon Apr 22 2024 laokz <zhangkai@iscas.ac.cn> - -1.3.3-3
|
||||
- add riscv64 to ExclusiveArch
|
||||
|
||||
* Thu Feb 29 2024 doupengda <doupengda@loongson.cn> - -1.3.3-2
|
||||
- add loongarch64 to ExclusiveArch
|
||||
|
||||
* Tue Dec 5 2023 <zouzhimin@kylinos.cn> -1.3.3-1
|
||||
- update package to version 1.3.3
|
||||
|
||||
* Mon Nov 27 2023 <zouzhimin@kylinos.cn> -1.3.1-1
|
||||
- init package 1.3.1 release
|
||||
BIN
vendor.tar.gz
Normal file
BIN
vendor.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user