diff --git a/add-parameters-to-solve-the-strip.patch b/add-parameters-to-solve-the-strip.patch new file mode 100644 index 0000000000000000000000000000000000000000..6536a52d69c2729920a7b2c5b090540ddd6a13f8 --- /dev/null +++ b/add-parameters-to-solve-the-strip.patch @@ -0,0 +1,20 @@ +--- c/.promu.yml 2023-03-07 11:30:19.037256381 +0800 ++++ a/.promu.yml 2023-03-07 11:32:48.661260604 +0800 +@@ -7,12 +7,11 @@ repository: + build: + flags: -mod=vendor -a -tags 'netgo static_build' + ldflags: | +- -s +- -X github.com/prometheus/common/version.Version={{.Version}} +- -X github.com/prometheus/common/version.Revision={{.Revision}} +- -X github.com/prometheus/common/version.Branch={{.Branch}} +- -X github.com/prometheus/common/version.BuildUser={{user}}@{{host}} +- -X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X github.com/prometheus/common/version.Version={{.Version}} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X github.com/prometheus/common/version.Revision={{.Revision}} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X github.com/prometheus/common/version.Branch={{.Branch}} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X github.com/prometheus/common/version.BuildUser={{user}}@{{host}} ++ -w -s -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now -pie' -X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}} + tarball: + files: + - LICENSE diff --git a/promu.spec b/promu.spec index d8e0ca3be16803c833f02f6007562e6c5cc41b59..4b07de24ae4e9c6aed369b1bf3f947e7f8013db1 100644 --- a/promu.spec +++ b/promu.spec @@ -2,14 +2,17 @@ Name: promu Version: 0.7.0 -Release: 1 +Release: 2 Summary: Prometheus Utility Tool License: ASL 2.0 URL: https://github.com/prometheus/promu Source0: https://github.com/prometheus/promu/archive/v%{version}.tar.gz +Patch0: add-parameters-to-solve-the-strip.patch + BuildRequires: golang >= 1.13 +BuildRequires: gcc Conflicts: promu Provides: %{name} = %{version} @@ -19,9 +22,11 @@ promu is the utility tool for building and releasing Prometheus projects %prep %setup -q -T -n %{name}-%{version} -b 0 +%patch0 -p1 %build -GOFLAGS=-mod=vendor make build +export GOFLAGS="-mod=vendor -buildmode=pie" +make build %install install -D -m 755 %{name}-%{version} %{buildroot}%{_bindir}/promu @@ -31,5 +36,8 @@ install -D -m 755 %{name}-%{version} %{buildroot}%{_bindir}/promu %{_bindir}/promu %changelog +* Fri Mar 03 2023 wangjunqi - 0.7.0-2 +- add strip and pie + * Wed Dec 16 2020 yangzhao - 0.7.0-1 - Init project promu