2020-08-12 09:16:07 +08:00
|
|
|
%define debug_package %{nil}
|
|
|
|
|
|
|
|
|
|
Name: alertmanager
|
|
|
|
|
Version: 0.21.0
|
2023-06-01 11:38:45 +08:00
|
|
|
Release: 7
|
2020-08-12 09:16:07 +08:00
|
|
|
Summary: Prometheus Alertmanager.
|
|
|
|
|
License: ASL 2.0
|
|
|
|
|
URL: https://github.com/prometheus/%{name}
|
|
|
|
|
|
2022-01-29 11:23:08 +08:00
|
|
|
Source0: https://github.com/prometheus/%{name}/archive/refs/tags/v%{version}.tar.gz
|
2020-08-12 09:16:07 +08:00
|
|
|
Source1: %{name}.service
|
|
|
|
|
Source2: %{name}.default
|
2022-01-29 11:23:08 +08:00
|
|
|
Source3: %{name}.yml
|
2023-06-01 11:38:45 +08:00
|
|
|
Patch0: 0001-update-sys-and-net-to-support-loong64.patch
|
2022-01-29 11:23:08 +08:00
|
|
|
|
|
|
|
|
BuildRequires: golang
|
2023-02-03 15:59:18 +08:00
|
|
|
BuildRequires: systemd
|
2020-08-12 09:16:07 +08:00
|
|
|
|
|
|
|
|
%{?systemd_requires}
|
|
|
|
|
Requires(pre): shadow-utils
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
The Alertmanager handles alerts sent by client applications such as the
|
|
|
|
|
Prometheus server. It takes care of deduplicating, grouping, and routing them to
|
|
|
|
|
the correct receiver integration such as email, PagerDuty, or OpsGenie. It also
|
|
|
|
|
takes care of silencing and inhibition of alerts.
|
|
|
|
|
|
|
|
|
|
%prep
|
2022-01-29 11:23:08 +08:00
|
|
|
%setup -q -n %{name}-%{version}
|
2023-06-01 11:38:45 +08:00
|
|
|
%ifarch loongarch64
|
|
|
|
|
%patch0 -p1
|
|
|
|
|
%endif
|
2020-08-12 09:16:07 +08:00
|
|
|
|
|
|
|
|
%build
|
2023-03-07 10:30:50 +08:00
|
|
|
export GOFLAGS="-mod=vendor -buildmode=pie"
|
|
|
|
|
go build -ldflags '-w -s -linkmode=external -extldflags "-Wl,-z,relro -Wl,-z,now -pie"' -mod=vendor -o %{_builddir}/%{name}-%{version}/bin/alertmanager ./cmd/alertmanager
|
|
|
|
|
go build -ldflags '-w -s -linkmode=external -extldflags "-Wl,-z,relro -Wl,-z,now -pie"' -mod=vendor -o %{_builddir}/%{name}-%{version}/bin/amtool ./cmd/amtool
|
2020-08-12 09:16:07 +08:00
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus
|
2022-01-29 11:23:08 +08:00
|
|
|
install -D -m 755 -vd %{buildroot}%{_bindir}
|
|
|
|
|
install -D -m 755 -vp %{_builddir}/%{name}-%{version}/bin/* %{buildroot}%{_bindir}
|
2020-08-12 09:16:07 +08:00
|
|
|
install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
|
install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/%{name}
|
2022-01-29 11:23:08 +08:00
|
|
|
install -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/prometheus/%{name}.yml
|
2020-08-12 09:16:07 +08:00
|
|
|
|
|
|
|
|
%pre
|
|
|
|
|
getent group prometheus >/dev/null || groupadd -r prometheus
|
|
|
|
|
getent passwd prometheus >/dev/null || \
|
|
|
|
|
useradd -r -g prometheus -d %{_sharedstatedir}/prometheus -s /sbin/nologin \
|
|
|
|
|
-c "Prometheus services" prometheus
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
%systemd_post %{name}.service
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
%systemd_preun %{name}.service
|
|
|
|
|
|
|
|
|
|
%postun
|
2021-08-05 17:25:32 +08:00
|
|
|
%systemd_postun_with_restart %{name}.service
|
2020-08-12 09:16:07 +08:00
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/prometheus/%{name}.yml
|
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
|
%{_bindir}/amtool
|
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/default/%{name}
|
|
|
|
|
%dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-06-01 11:38:45 +08:00
|
|
|
* Wed May 31 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 0.21.0-7
|
|
|
|
|
- update sys and net to support loong64
|
|
|
|
|
|
2023-03-07 10:30:50 +08:00
|
|
|
* Tue Mar 07 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.21.0-6
|
|
|
|
|
- Add strip and pie
|
|
|
|
|
|
2023-02-03 15:59:18 +08:00
|
|
|
* Fri Feb 03 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.21.0-5
|
|
|
|
|
- Add buildRequires systemd
|
|
|
|
|
|
2022-01-29 11:23:08 +08:00
|
|
|
* Sat Jan 29 2022 yangzhao <yangzhao1@kylinos.cn> - 0.21.0-4
|
|
|
|
|
- Build from source code
|
|
|
|
|
|
2021-08-05 17:25:32 +08:00
|
|
|
* Thu Aug 05 2021 herengui <herengui@uniontech.com> - 0.21.0-3
|
|
|
|
|
- Type: bugfix
|
|
|
|
|
- ID: #I4431I
|
|
|
|
|
- DESC: solve empty postun transaction issue.
|
|
|
|
|
|
2020-08-12 09:16:07 +08:00
|
|
|
* Tue Aug 11 2020 houjian <houjian@kylinos.cn> - 0.21.0-2
|
2023-03-07 10:30:50 +08:00
|
|
|
- Package init
|