# shellcheck shell=bash# Shared by build-*.sh: runs in a Fedora container with the app's repo at# /src, a cache that outlives the job at /cache, and RPMs going to /out.set -euo pipefail# The checkout and caches belong to other users than the container's root.git_safe() { git config --global --add safe.directory '*'; }# Packages the app with packaging/$NAME.spec. The spec gets version_,# release_ and srcdir (/src), plus any extra --define pairs passed here.package_rpm() {local version=$1; shiftlocal releaserelease=.gitrpmbuild -bb "/src/packaging/$NAME.spec" \--define "_topdir /tmp/rpmbuild" \--define "version_ $version" --define "release_ $release" --define "srcdir /src" \"$@"cp -v /tmp/rpmbuild/RPMS/*/*.rpm /out/}