From fea303393ed7ebb0b2d3c2bc029b87a9c8f858ca Mon Sep 17 00:00:00 2001 From: Andreas Gerstmayr Date: Thu, 30 Sep 2021 18:08:19 +0200 Subject: [PATCH] define gobuild and gotest macros in case they are not available --- grafana.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/grafana.spec b/grafana.spec index 9328f56..9bd8702 100644 --- a/grafana.spec +++ b/grafana.spec @@ -1,3 +1,13 @@ +# gobuild and gotest macros are not available on CentOS Stream +# remove once BZ 1965292 is resolved +# definitions lifted from Fedora 34 podman.spec +%if ! 0%{?gobuild:1} +%define gobuild(o:) GO111MODULE=off go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**}; +%endif +%if ! 0%{?gotest:1} +%define gotest() GO111MODULE=off go test -buildmode pie -compiler gc -ldflags "${LDFLAGS:-} -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" %{?**}; +%endif + %global grafana_arches %{lua: go_arches = {} for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do go_arches[arch] = 1