Add strip and pie

(cherry picked from commit c411b5c9be752a00811be06ee85e03e216faa612)
This commit is contained in:
jxy_git 2023-03-07 10:30:50 +08:00 committed by openeuler-sync-bot
parent 731a4cc7b8
commit 2c79319c69

View File

@ -2,7 +2,7 @@
Name: alertmanager Name: alertmanager
Version: 0.21.0 Version: 0.21.0
Release: 5 Release: 6
Summary: Prometheus Alertmanager. Summary: Prometheus Alertmanager.
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/prometheus/%{name} URL: https://github.com/prometheus/%{name}
@ -28,8 +28,9 @@ takes care of silencing and inhibition of alerts.
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
%build %build
go build -mod=vendor -o %{_builddir}/%{name}-%{version}/bin/alertmanager ./cmd/alertmanager export GOFLAGS="-mod=vendor -buildmode=pie"
go build -mod=vendor -o %{_builddir}/%{name}-%{version}/bin/amtool ./cmd/amtool 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
%install %install
mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus
@ -65,6 +66,9 @@ exit 0
%dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus %dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus
%changelog %changelog
* Tue Mar 07 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.21.0-6
- Add strip and pie
* Fri Feb 03 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.21.0-5 * Fri Feb 03 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.21.0-5
- Add buildRequires systemd - Add buildRequires systemd
@ -77,4 +81,4 @@ exit 0
- DESC: solve empty postun transaction issue. - DESC: solve empty postun transaction issue.
* Tue Aug 11 2020 houjian <houjian@kylinos.cn> - 0.21.0-2 * Tue Aug 11 2020 houjian <houjian@kylinos.cn> - 0.21.0-2
- Package init - Package init