Use %gomkdir because it's available in RHEL 9

There's no need to do a build just for this.

Resolves: #2165742
This commit is contained in:
Debarshi Ray 2023-04-03 21:06:01 +02:00
parent 6de1fe7c46
commit ccb07d1722
1 changed files with 2 additions and 16 deletions

View File

@ -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 \