From ccb07d1722083c87e6ae7737c35be28c6fa9a1c4 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Mon, 3 Apr 2023 21:06:01 +0200 Subject: [PATCH] Use %gomkdir because it's available in RHEL 9 There's no need to do a build just for this. Resolves: #2165742 --- toolbox.spec | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/toolbox.spec b/toolbox.spec index c8e4de6..ac2d23c 100644 --- a/toolbox.spec +++ b/toolbox.spec @@ -79,27 +79,13 @@ The %{name}-tests package contains system tests for %{name}. %patch102 -p1 -# %%gomkdir is absent from RHEL 8. -GOBUILDDIR="$(pwd)/_build" -GOSOURCEDIR="$(pwd)" -if [[ ! -e "$GOBUILDDIR/bin" ]] ; then - install -m 0755 -vd "$GOBUILDDIR/bin" -fi -if [[ ! -e "$GOBUILDDIR/src/%{goipath}" ]] ; then - install -m 0755 -vd "$(dirname $GOBUILDDIR/src/%{goipath})" - ln -fs "$GOSOURCEDIR" "$GOBUILDDIR/src/%{goipath}" -fi -cd "$GOBUILDDIR/src/%{goipath}" +%gomkdir -s %{_builddir}/%{extractdir}/src %{?rhel:-k} %build export %{gomodulesmode} -GOBUILDDIR="$(pwd)/_build" -export GOPATH="$GOBUILDDIR:%{gopath}" +export GOPATH=%{gobuilddir}:%{gopath} export CGO_CFLAGS="%{optflags} -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" -ln -s src/cmd cmd -ln -s src/pkg pkg -ln -s src/vendor vendor %meson \ -Dmigration_path_for_coreos_toolbox=true \