--expression "s/^_tag=.*/_tag=$(cat meson.version)/" \
--expression "s/^pkgrel=.*/pkgrel=$(date "+%Y%m%d%H%M%S" --date "@$TS")/"
+# Replace cdrom/dialout/tape groups with optical/uucp/storage. We apply this patch manually because we run
+# with --noprepare.
+patch -Np1 -i pkg/arch/0001-Use-Arch-Linux-device-access-groups.patch
+
# We get around makepkg's root check by setting EUID to something else.
# shellcheck disable=SC2046
env --chdir="pkg/$PKG_SUBDIR" \
EUID=123 \
makepkg \
--noextract \
+ --noprepare \
$( ((WITH_TESTS)) || echo --nocheck) \
--force \
_systemd_UPSTREAM=1 \
MKOSI_MESON_OPTIONS="$MKOSI_MESON_OPTIONS --wipe"
fi
+# Hack to work around https://github.com/rpm-software-management/rpm/issues/3216.
+# TODO: Remove when rpm 4.20 gets into Rawhide.
+mkdir -p "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build"
+mkdir -p "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build/SPECPARTS"
+ln -s /work/src "/var/tmp/BUILD/systemd-${VERSION/\~/_}-build/systemd-$VERSION"
+
IFS=
# TODO: Replace meson_build and meson_install overrides with "--undefine __meson_verbose" once
# https://github.com/mesonbuild/meson/pull/12835 is available.
CXX_LD="$( ((LLVM)) && echo lld)" \
rpmbuild \
-bb \
+ --noprep \
--build-in-place \
--with upstream \
$( ((WITH_TESTS)) || echo "--nocheck") \