From f140f8c18e282047690e374f6f97ded59553263a5124a9ce86c26c70ee5076c3 Mon Sep 17 00:00:00 2001 From: Witek Bedyk Date: Fri, 6 Dec 2024 09:47:32 +0000 Subject: [PATCH] - Fix build error on Red Hat Enterprise Linux OBS-URL: https://build.opensuse.org/package/show/server:monitoring/golang-github-prometheus-promu?expand=0&rev=42 --- .gitattributes | 23 +++ .gitignore | 1 + _service | 22 +++ _servicedata | 4 + extldflags-no-static.patch | 13 ++ golang-github-prometheus-promu.changes | 195 +++++++++++++++++++++++++ golang-github-prometheus-promu.spec | 73 +++++++++ promu-0.17.0.obscpio | 3 + promu.obsinfo | 4 + vendor.tar.gz | 3 + 10 files changed, 341 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _service create mode 100644 _servicedata create mode 100644 extldflags-no-static.patch create mode 100644 golang-github-prometheus-promu.changes create mode 100644 golang-github-prometheus-promu.spec create mode 100644 promu-0.17.0.obscpio create mode 100644 promu.obsinfo create mode 100644 vendor.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_service b/_service new file mode 100644 index 0000000..80bcee2 --- /dev/null +++ b/_service @@ -0,0 +1,22 @@ + + + https://github.com/prometheus/promu.git + git + .git + @PARENT_TAG@ + v0.17.0 + v(.*) + enable + + + + *.tar + gz + + + promu + + + promu-0.17.0.obscpio + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..ba1dad1 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/prometheus/promu.git + 3912dec4ab83971903015cc7b2a8d8ff93b73910 \ No newline at end of file diff --git a/extldflags-no-static.patch b/extldflags-no-static.patch new file mode 100644 index 0000000..a469a7b --- /dev/null +++ b/extldflags-no-static.patch @@ -0,0 +1,13 @@ +Index: promu-0.15.0/cmd/promu.go +=================================================================== +--- promu-0.15.0.orig/cmd/promu.go ++++ promu-0.15.0/cmd/promu.go +@@ -73,7 +73,7 @@ func NewConfig() *Config { + config := &Config{} + config.Build.Binaries = []Binary{{Name: projInfo.Name, Path: "."}} + config.Build.Prefix = "." +- config.Build.Static = true ++ config.Build.Static = false + config.Crossbuild.Platforms = defaultPlatforms + config.Tarball.Prefix = "." + config.Go.Version = "1.12" diff --git a/golang-github-prometheus-promu.changes b/golang-github-prometheus-promu.changes new file mode 100644 index 0000000..a132054 --- /dev/null +++ b/golang-github-prometheus-promu.changes @@ -0,0 +1,195 @@ +------------------------------------------------------------------- +Wed Dec 4 11:32:05 UTC 2024 - Witek Bedyk + +- Fix build error on Red Hat Enterprise Linux + +------------------------------------------------------------------- +Sat Apr 20 11:43:43 UTC 2024 - opensuse_buildservice@ojkastl.de + +- Update to version 0.17.0: + * [FEATURE] Add codesign utility function #284 + +------------------------------------------------------------------- +Sat Apr 20 11:41:19 UTC 2024 - opensuse_buildservice@ojkastl.de + +- drop patch + 0001-do_not_discover_user_host_for_reproducible_builds.patch that + was merged upstream + (https://github.com/prometheus/promu/pull/267) +- BuildRequire go1.21 as upstream does +- Update to version 0.16.0: + * [FEATURE] Do not discover user/host for reproducible builds + #267 + * [BUGFIX] Fix example/prometheus build error #274 + +------------------------------------------------------------------- +Sat Feb 10 04:51:27 UTC 2024 - Jeff Kowalczyk + +- Packaging improvements: + * _service change disabled to manual per osc deprecation warning: + WARNING: Command 'disabledrun/dr' is obsolete, please convert + your _service to use 'manual' and then 'manualrun/mr' instead. + * Define shortname corresponding to binary name when different + from package name. Use shortname where applicable to normalize + common lines across Go app packages, similar to name macro. + * Drop BuildRequires: golang-packaging. The original macros for + file movements into GOPATH are obsolete with Go modules. Macro + go_nostrip is no longer needed with current binutils and Go. + * Drop export CGO_ENABLED="0". Use the default unless there is a + defined requirement or benefit. + * Build PIE with pattern that may become recommended procedure: + %%ifnarch ppc64 GOFLAGS="-buildmode=pie" %%endif go build + A go toolchain buildmode default config would be preferable + but none exist at this time. + * Drop mod=vendor, go1.14+ will detect vendor dir and auto-enable + * Remove ldflags -X entries for upstream import path and version. + This information is embedded in binaries with go1.18+ and + available via go version -m or runtime/debug.ReadBuildInfo(). + * Remove ldflags -s (Omit symbol table and debug info) and -w + (Omit DWARF symbol table). This information is used to produce + separate debuginfo packages and binaries are stripped for + reduced size by GNU strip during RPM build. + * Drop go build -o arg, default binary name is pkg of main() + * Add basic %check to execute binary --help + +------------------------------------------------------------------- +Thu Dec 14 11:51:49 UTC 2023 - Andreas Schwab + +- extldflags-no-static.patch: Don't pass -extldflags -static by default + +------------------------------------------------------------------- +Tue Aug 8 11:53:00 UTC 2023 - Witek Bedyk + +- Always set user and host build metadata to constant string to + achieve reproducible builds (compare reproducible-builds.org) +- Add 0001-do_not_discover_user_host_for_reproducible_builds.patch +- Require Go >= 1.19 for building +- Require Go >= 1.18 for building Red Hat packages + +------------------------------------------------------------------- +Tue Jul 04 10:41:07 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.15.0: + * Release v0.15.0 + * Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 + * Update common Prometheus files + * Bump go.uber.org/atomic from 1.10.0 to 1.11.0 + * Update build + * Add linux/riscv64 to default platforms + * Bump github.com/prometheus/common from 0.39.0 to 0.42.0 + * Bump golang.org/x/oauth2 from 0.5.0 to 0.6.0 + * Bump github.com/prometheus/common from 0.37.0 to 0.39.0 + * Bump golang.org/x/oauth2 from 0.2.0 to 0.5.0 + * Bump golang.org/x/net from 0.2.0 to 0.7.0 + * Use unmarshalstrict + +------------------------------------------------------------------- +Wed Mar 22 10:28:44 UTC 2023 - Johannes Kastl + +- rework spec file to use obscpio + - run tar and recompresss services at buildtime + +------------------------------------------------------------------- +Tue Jan 10 16:18:52 UTC 2023 - kastl@b1-systems.de + +- Update to version 0.14.0: + * Add the ability to override tags per GOOS + * Remove ioutil + * Update common Prometheus files (#232) (#224) + * Validate environment variable value + * Set build date from SOURCE_DATE_EPOCH +- drop patch 0001-Set-build-date-from-SOURCE_DATE_EPOCH.patch that is + included upstream now + +------------------------------------------------------------------- +Mon Oct 31 14:17:46 UTC 2022 - Witek Bedyk + +- Do not include source code +- Update to Go 1.18 + +------------------------------------------------------------------- +Tue Sep 27 12:37:42 UTC 2022 - Dirk Müller + +- switch to go1.17 as upstream does (see https://github.com/prometheus/promu/blob/v0.13.0/.promu.yml) +- remove go_nostrip as it isn't necessary with 1.17 anymore + +------------------------------------------------------------------- +Tue May 10 15:22:43 UTC 2022 - Jordi Massaguer + +- Exclude s390 architecture. + +------------------------------------------------------------------- +Tue Apr 26 17:13:58 UTC 2022 - Witek Bedyk + +- Set build date from last changelog modification (boo#1047218) +- Add 0001-Set-build-date-from-SOURCE_DATE_EPOCH.patch + +------------------------------------------------------------------- +Fri Apr 1 13:56:36 UTC 2022 - Stefan Bluhm + +- Adapted for Enterprise Linux build. + +------------------------------------------------------------------- +Thu Mar 03 21:07:04 UTC 2022 - ecsos@opensuse.org + +- Update to version 0.13.0: + * Release 0.13.0 (jsc#SLE-24138, jsc#SLE-24139) + * Add deprecation note to pkg directory + * Add windows/arm64 + * Update common Prometheus files + * Fix typo + * Release 0.12.0 + * Simplify CGO crossbuilds + * Update common Prometheus files + * Release 0.11.1 + * Fix build with "linux" platform + +------------------------------------------------------------------- +Mon Mar 8 11:03:45 UTC 2021 - Witek Bedyk + +- Build requires Go 1.15 + +------------------------------------------------------------------- +Fri Feb 7 17:13:26 UTC 2020 - Witek Bedyk + +- Update to 0.5.0 + + Features: + * Add support for aix/ppc64. #151 + * Fallback to git describe output if no VERSION. #130 + * Make extldflags extensible by configuration. #125 + + Enhancements: + * cmd/release: add --timeout option. #142 + * cmd/release: create release in GitHub if none exists. #148 + * Avoid bind-mounting to allow building with a remote docker engine #95 + + Bug Fixes: + * cmd/tarball: restore --prefix flag. #133 + * cmd/release: don't leak credentials in case of error. #136 + +- Use obs-service-go_modules + +------------------------------------------------------------------- +Fri Feb 8 11:05:48 UTC 2019 - Jan Fajerski + +- Update to 0.2.0 + + Features: + * Adding changes to support s390x + * Add option to disable static linking + * Add support for 32bit MIPS. + * Added check_licenses Command to Promu + + Enhancements: + * Allow to customize nested options via env variables + * Bump Go version to 1.11 + * Add warning if promu info is unable to determine repo info + + Bug Fixes: + * Fix build on SmartOS by not setting gcc's -static flag + * Fix git repository url parsing + +------------------------------------------------------------------- +Thu Jan 25 10:13:29 UTC 2018 - kkaempf@suse.com + +- Update to 0.1.0 + +------------------------------------------------------------------- +Wed Mar 29 09:16:48 UTC 2017 - moio@suse.com + +- Initial version diff --git a/golang-github-prometheus-promu.spec b/golang-github-prometheus-promu.spec new file mode 100644 index 0000000..0c9cfce --- /dev/null +++ b/golang-github-prometheus-promu.spec @@ -0,0 +1,73 @@ +# +# spec file for package golang-github-prometheus-promu +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%if 0%{?rhel} +%global debug_package %{nil} +# Fix ERROR: No build ID note found in +%undefine _missing_build_ids_terminate_build +%endif + +%define shortname promu + +Name: golang-github-prometheus-promu +Version: 0.17.0 +Release: 0 +Summary: Prometheus Utility Tool +License: Apache-2.0 +Group: System/Management +URL: https://github.com/prometheus/promu +Source: %{shortname}-%{version}.tar.gz +Source1: vendor.tar.gz +# PATCH-FIX-OPENSUSE Do not pass -static to external linker by default +Patch2: extldflags-no-static.patch +ExcludeArch: s390 +%if 0%{?rhel} +BuildRequires: golang >= 1.20 +%else +BuildRequires: golang(API) >= 1.21 +%endif + +%description +The Prometheus Utility Tool is used by the Prometheus project to build other components. + +%prep +%autosetup -a1 -p1 -n %{shortname}-%{version} + +%build +%ifnarch ppc64 +export GOFLAGS="-buildmode=pie" +%endif +go build + +%check +# execute the binary as a basic check +./%{shortname} --help +%if 0%{?rhel} +rm -f %{buildroot}/usr/lib/debug%{_bindir}/%{shortname}*.debug +rm -rf %{buildroot}/usr/lib/debug/.build-id/* +%endif + +%install +install -D -m 0755 %{shortname} "%{buildroot}/%{_bindir}/%{shortname}" + +%files +%doc README.md +%license LICENSE +%{_bindir}/%{shortname} + +%changelog diff --git a/promu-0.17.0.obscpio b/promu-0.17.0.obscpio new file mode 100644 index 0000000..8247cdd --- /dev/null +++ b/promu-0.17.0.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35738387735146d914e4a8f64a81162af8d011cc02201cac0cc52b3c45469b96 +size 125963 diff --git a/promu.obsinfo b/promu.obsinfo new file mode 100644 index 0000000..34d6418 --- /dev/null +++ b/promu.obsinfo @@ -0,0 +1,4 @@ +name: promu +version: 0.17.0 +mtime: 1713609107 +commit: 3912dec4ab83971903015cc7b2a8d8ff93b73910 diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..77971e6 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7e538af72ac2a90d672b0e825ea2fd77a4670a1c8c5088f3c641e0dca25f4d8 +size 283679