From 9764c99dbdd156c2a8a861ca85282c4bb0879b64 Mon Sep 17 00:00:00 2001 From: Lokesh Mandvekar Date: Thu, 23 Jan 2025 17:09:44 +0530 Subject: [PATCH] RPM: cleanup gobuild macro for CentOS Stream The default gobuild macro on CentOS Stream now accounts for `BUILDTAGS`, so we don't need to redefine the macro in rpm spec. The `libtrust_openssl` has been set in the spec for RHEL environments. Signed-off-by: Lokesh Mandvekar --- rpm/skopeo.spec | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/rpm/skopeo.spec b/rpm/skopeo.spec index 24f89899..029143a0 100644 --- a/rpm/skopeo.spec +++ b/rpm/skopeo.spec @@ -7,15 +7,6 @@ %global debug_package %{nil} %endif -# RHEL's default %%gobuild macro doesn't account for the BUILDTAGS variable, so we -# set it separately here and do not depend on RHEL's go-[s]rpm-macros package -# until that's fixed. -# c9s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227328 -# c8s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227331 -%if %{defined rhel} -%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback libtrust_openssl ${BUILDTAGS:-}" -ldflags "-linkmode=external -compressdwarf=false ${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**}; -%endif - %global gomodulesmode GO111MODULE=on # No btrfs on RHEL @@ -23,6 +14,10 @@ %define build_with_btrfs 1 %endif +%if %{defined rhel} +%define fips 1 +%endif + # Only used in official koji builds # Copr builds set a separate epoch for all environments %if %{defined fedora} @@ -127,6 +122,10 @@ export BUILDTAGS="$BASEBUILDTAGS $(hack/btrfs_tag.sh) $(hack/btrfs_installed_tag export BUILDTAGS="$BASEBUILDTAGS btrfs_noversion exclude_graphdriver_btrfs" %endif +%if %{defined fips} +export BUILDTAGS="$BUILDTAGS libtrust_openssl" +%endif + # unset LDFLAGS earlier set from set_build_flags LDFLAGS=''