1
0
mirror of https://github.com/containers/buildah.git synced 2026-02-05 09:45:38 +01:00

RPM: use default gobuild macro on RHEL

The default gobuild macro on RHEL now includes support for BUILDTAGS. So
we don't need to redefine it here.

`libtrust_openssl` buildtag will be set in the spec file for RHEL environments.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
This commit is contained in:
Lokesh Mandvekar
2025-01-24 16:41:05 +05:30
parent a7fe4793a8
commit 6cee07f52e

View File

@@ -7,21 +7,16 @@
%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
%if 0%{defined fedora}
%if %{defined fedora}
%define build_with_btrfs 1
%endif
%if %{defined rhel}
%define fips 1
%endif
%global git0 https://github.com/containers/%{name}
Name: buildah
@@ -129,6 +124,10 @@ export BUILDTAGS="seccomp $(hack/systemd_tag.sh) $(hack/libsubid_tag.sh)"
export BUILDTAGS+=" btrfs_noversion exclude_graphdriver_btrfs"
%endif
%if %{defined fips}
export BUILDTAGS+=" libtrust_openssl"
%endif
%gobuild -o bin/%{name} ./cmd/%{name}
%gobuild -o bin/imgtype ./tests/imgtype
%gobuild -o bin/copy ./tests/copy