Update to 3.6.0

Resolves: RHEL-14963
This commit is contained in:
Alejandro Sáez 2024-07-24 11:10:07 +02:00
parent 24baf7f751
commit 059580c964
4 changed files with 6 additions and 71 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
/go-rpm-macros-3.0.9.tar.gz
/golist-0.10.1.tar.gz
/go-rpm-macros-3.2.0.tar.gz
/go-rpm-macros-3.6.0.tar.gz
/golist-0.10.4.tar.gz

View File

@ -1,5 +1,5 @@
%global forgeurl https://pagure.io/go-rpm-macros
Version: 3.2.0
Version: 3.6.0
%forgemeta
#https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/51
@ -24,7 +24,7 @@ Version: 3.2.0
%if 0%{?bundle_golist}
# do not create debuginfo packages when we add a build section
%global debug_package %{nil}
%global golist_version 0.10.1
%global golist_version 0.10.4
%global golist_builddir %{_builddir}/golist-%{golist_version}/_build
%global golist_goipath pagure.io/golist
# where to bundle the golist executable
@ -69,7 +69,6 @@ Provides: compiler(go-compiler) = 1
Obsoletes: go-compilers-gcc-go-compiler < %{version}-%{release}
%endif
Patch0: update-default-gobuild-args.patch
# Replace golang-github-urfave-cli with a minimal
# command line parser backend to bootstrap golist
# without dependencies.
@ -127,8 +126,6 @@ macros provided by go-rpm-macros to create Go packages.
%prep
%forgesetup
%patch0 -p1
%writevars -f rpm/macros.d/macros.go-srpm golang_arches golang_arches_future gccgo_arches gopath
for template in templates/rpm/*\.spec ; do
target=$(echo "${template}" | sed "s|^\(.*\)\.spec$|\1-bare.spec|g")

View File

@ -1,2 +1,2 @@
SHA512 (go-rpm-macros-3.2.0.tar.gz) = 5d1a7773c0044b3046d6c0006b8aae441b17a52a79b65b3a704619433b1ed27cd59972703ba4cba17ec3f15755d7d81ae99401a7daac2217c3e58adb360a91c7
SHA512 (golist-0.10.1.tar.gz) = ba4ac34b635399c4234079f05de0c160fdb7144908d2f569ff6426f68ef05fcb3660431681a0d9d327907adedb94e952fb5246d591d39c80f3077a40171ab604
SHA512 (go-rpm-macros-3.6.0.tar.gz) = 904406180a1bedb70dd0bacc3794dee7f1ff8e4329230750ef903338f22c2beb995e23f1d647191a4e094860b31933ae7b3acfa35d6ca67aed8c591bdd45c3bb
SHA512 (golist-0.10.4.tar.gz) = 81fc9cdc4cb0fa1b78ade56c60cb2ac0070dcb11130a333e61053a266e2312b03e64a6705415d6d20883ae4f8cd0be57722c93835c3efffdfaeb9330f4cc12ea

View File

@ -1,64 +0,0 @@
From c05378a9d5d7ceb0fef2a915df9b88750685a3a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= <asm@redhat.com>
Date: Thu, 24 Nov 2022 15:05:06 +0100
Subject: [PATCH] Update default gobuild args
---
rpm/macros.d/macros.go-compilers-golang | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/rpm/macros.d/macros.go-compilers-golang b/rpm/macros.d/macros.go-compilers-golang
index 74428a3..8cee8e2 100644
--- a/rpm/macros.d/macros.go-compilers-golang
+++ b/rpm/macros.d/macros.go-compilers-golang
@@ -20,6 +20,8 @@
#
# SPDX-License-Identifier: GPL-3.0-or-later
+%gocompilerflags -buildmode pie -compiler gc
+
# This *must* be all on one line, as it will be used in shell
# assignments. eg
#
@@ -29,13 +31,16 @@
#
# %make GOBUILDFLAGS="%gobuildflags"
#
-%gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -linkmode=external -extldflags '%{build_ldflags} %{?__golang_extldflags}'" -a -v -x}
+%gobuildflags() %{expand:%{gocompilerflags} -tags=\\"rpm_crashtraceback ${BUILDTAGS:-} libtrust_openssl\\" -ldflags \\"-linkmode=external -compressdwarf=false ${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'\\" -a -v -x}
+%_gobuildflags_internal() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-} libtrust_openssl" -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x}
# Turn off Go modules
%gomodulesmode GO111MODULE=off
# Define commands for building
# BUILD_ID can be generated for golang build no matter of debuginfo
+%_gobuild_cmd CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" go build %{_gobuildflags_internal}
+%gobuild_compat_el8(o:) %{expand:%{_gobuild_cmd} %{?**};}
%gobuild(o:) %{expand:
# https://pagure.io/go-rpm-macros/pull-request/38
# Most of the default LDFLAGS for Fedora are not supported so we don't want
@@ -44,14 +49,16 @@
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
%global _dwz_low_mem_die_limit 0
%{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} %{?gomodulesmode} \\
- go build %{gobuildflags} %{?**};
+ %{_gobuild_cmd} %{?**};
}
${workroot}${GOPATH:+:${GOPATH}}
# Define commands for testing
%gotestflags %{gocompilerflags}
%gotestextldflags %{build_ldflags} %{?__golang_extldflags}
-%gotest() %{expand:
- %undefine _auto_set_build_flags
- %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
+%_gotest_cmd %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'"
+%gotest_compat_el8(o:) %{expand:%{_gotest_cmd} %{?**};}
+%gotest(o:) %{expand:
+ %{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} %{?gomodulesmode} \\
+ %{_gotest_cmd} %{?**};
}
--
2.38.1