%define debug_package %{nil}

Name:           promu
Version:        0.15.0
Release:        2
Summary:        Prometheus Utility Tool
License:        Apache-2.0
URL:            https://github.com/prometheus/promu
Source0:        https://github.com/prometheus/promu/archive/refs/tags/v%{version}.tar.gz#/promu-0.15.0.tar.gz
# tar -xvf Source0
# run 'go mod vendor' in it
# tar -czvf promu-vendor.tar.gz vendor
Source1:        promu-vendor.tar.gz
Patch0:         add-parameters-to-solve-the-strip.patch

BuildRequires:  golang >= 1.14
BuildRequires:  gcc

Conflicts:      promu
Provides:       %{name} = %{version}-%{release}

%description
promu is the utility tool for building and releasing Prometheus projects

%prep
%setup -q -T -n %{name}-%{version} -b 0
tar -xzvf %{SOURCE1}
%patch0 -p1

%build
export GOFLAGS="-mod=vendor -buildmode=pie"
make build

%install
install -D -m 0755 %{name}-%{version} %{buildroot}%{_bindir}/promu

%files
%defattr(-,root,root,-)
%{_bindir}/promu

%changelog
* Tue Jan 14 2025 jiangxinyu <jiangxinyu@kylinos.cn> - 0.15.0-2
- Type: CVE
- CVE: CVE-2023-39326 CVE-2024-24789 CVE-2024-24791
- SUG: NA
- DESC: Rebuild to fix CVE-2023-39326 CVE-2024-24789 CVE-2024-24791

* Thu Sep 07 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 0.15.0-1
- Update package to version 0.15.0

* Wed Jun 14 2023 EastDong <xudong23@iscas.ac.cn> - 0.7.0-4
- backport to support riscv

* Fri Mar 10 2023 caodongxia <caodongxia@h-partners.com> - 0.7.0-3
- remove linkmode external

* Fri Mar 03 2023 wangjunqi <wangjunqi@kylinos.cn> - 0.7.0-2
- add strip and pie

* Wed Dec 16 2020 yangzhao <yangzhao1@kylinos.cn> - 0.7.0-1
- Init project promu
