commit 78e5b6427f6eaa06ce472a03a62ea2e693453c01c9940b01241fd1d5ee5d7428 Author: Adrian Schröter Date: Fri May 3 13:09:43 2024 +0200 Sync from SUSE:SLFO:Main golang-github-prometheus-promu revision 57d6259a937f2f18077f9500629d5000 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/0001-do_not_discover_user_host_for_reproducible_builds.patch b/0001-do_not_discover_user_host_for_reproducible_builds.patch new file mode 100644 index 0000000..fb57518 --- /dev/null +++ b/0001-do_not_discover_user_host_for_reproducible_builds.patch @@ -0,0 +1,74 @@ +Index: promu-0.15.0/cmd/build.go +=================================================================== +--- promu-0.15.0.orig/cmd/build.go ++++ promu-0.15.0/cmd/build.go +@@ -32,6 +32,10 @@ import ( + "github.com/prometheus/promu/util/sh" + ) + ++const ( ++ sourceDateEpoch = "SOURCE_DATE_EPOCH" ++) ++ + var ( + buildcmd = app.Command("build", "Build a Go project") + buildCgoFlagSet bool +@@ -155,7 +159,7 @@ func getLdflags(info repository.Info) st + tmplOutput = new(bytes.Buffer) + fnMap = template.FuncMap{ + "date": buildDate.UTC().Format, +- "host": os.Hostname, ++ "host": HostFunc, + "repoPath": RepoPathFunc, + "user": UserFunc, + } +@@ -191,13 +195,13 @@ func getLdflags(info repository.Info) st + func getBuildDate() time.Time { + var buildDate time.Time + +- sourceDate := os.Getenv("SOURCE_DATE_EPOCH") ++ sourceDate := os.Getenv(sourceDateEpoch) + if sourceDate == "" { + buildDate = time.Now() + } else { + unixBuildDate, err := strconv.ParseInt(sourceDate, 10, 64) + if err != nil { +- fatal(errors.Wrap(err, "Failed to parse SOURCE_DATE_EPOCH")) ++ fatal(errors.Wrap(err, "Failed to parse "+sourceDateEpoch)) + } else { + buildDate = time.Unix(unixBuildDate, 0) + } +@@ -205,10 +209,31 @@ func getBuildDate() time.Time { + return buildDate + } + ++func HostFunc() string { ++ if isReproducibleBuild() { ++ return "reproducible" ++ } else { ++ hostname, err := os.Hostname() ++ if err != nil { ++ return "unknown-host" ++ } else { ++ return hostname ++ } ++ } ++} ++ + // UserFunc returns the current username. + func UserFunc() (interface{}, error) { +- // os/user.Current() doesn't always work without CGO +- return shellOutput("whoami"), nil ++ if isReproducibleBuild() { ++ return "reproducible", nil ++ } else { ++ // os/user.Current() doesn't always work without CGO ++ return shellOutput("whoami"), nil ++ } ++} ++ ++func isReproducibleBuild() bool { ++ return os.Getenv(sourceDateEpoch) != "" + } + + // RepoPathFunc returns the repository path. diff --git a/_service b/_service new file mode 100644 index 0000000..04c00a2 --- /dev/null +++ b/_service @@ -0,0 +1,22 @@ + + + https://github.com/prometheus/promu.git + git + .git + @PARENT_TAG@ + v0.15.0 + v(.*) + enable + + + + *.tar + gz + + + promu + + + promu-0.15.0.obscpio + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..683f9c2 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/prometheus/promu.git + e1bab893555f728998f2bd404c4b7e66931bc760 \ No newline at end of file diff --git a/golang-github-prometheus-promu.changes b/golang-github-prometheus-promu.changes new file mode 100644 index 0000000..ca05f7e --- /dev/null +++ b/golang-github-prometheus-promu.changes @@ -0,0 +1,136 @@ +------------------------------------------------------------------- +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..5656e26 --- /dev/null +++ b/golang-github-prometheus-promu.spec @@ -0,0 +1,66 @@ +# +# spec file for package golang-github-prometheus-promu +# +# Copyright (c) 2023 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/ +# + + +Name: golang-github-prometheus-promu +Version: 0.15.0 +Release: 0 +Summary: Prometheus Utility Tool +License: Apache-2.0 +Group: System/Management +URL: https://github.com/prometheus/promu +Source: promu-%{version}.tar.gz +Source1: vendor.tar.gz +# PATCH-FIX-UPSTREAM Fix setting reproducible user and host during the build +# https://github.com/prometheus/promu/pull/267 +Patch1: 0001-do_not_discover_user_host_for_reproducible_builds.patch +BuildRequires: golang-packaging +ExcludeArch: s390 +%{go_provides} +%if 0%{?rhel} +# Fix ERROR: No build ID note found in +%undefine _missing_build_ids_terminate_build +BuildRequires: golang >= 1.18 +%else +BuildRequires: golang(API) >= 1.19 +%endif + +%description +The Prometheus Utility Tool is used by the Prometheus project to build other components. + +%prep +%autosetup -a1 -p1 -n promu-%{version} + +%build +%{goprep} github.com/prometheus/promu +export VERSION=%{version} +export CGO_ENABLED=0 +go build \ + -mod=vendor \ + -buildmode=pie \ + -ldflags "-s -w -X main.version=$VERSION" \ + -o promu ; + +%install +install -D -m 0755 promu "%{buildroot}/%{_bindir}/promu" + +%files +%doc README.md +%license LICENSE +%{_bindir}/promu + +%changelog diff --git a/promu-0.15.0.obscpio b/promu-0.15.0.obscpio new file mode 100644 index 0000000..0db0437 --- /dev/null +++ b/promu-0.15.0.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f960311ec016bac6dda7501c5f944449746b36525003ffe0b88213789c4f7d26 +size 125451 diff --git a/promu.obsinfo b/promu.obsinfo new file mode 100644 index 0000000..38c2c01 --- /dev/null +++ b/promu.obsinfo @@ -0,0 +1,4 @@ +name: promu +version: 0.15.0 +mtime: 1688456354 +commit: e1bab893555f728998f2bd404c4b7e66931bc760 diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..183e3c1 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d01b7ba3c525d28e851655e78029a2cd3d89079995765a66ee3a3559c93fa9d4 +size 1961604