mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-04 12:07:56 +00:00
0eed22a866
Source RPM output does not vary by binary target architecture, so source-only mode builds the first target instead of overwriting the same SRPM for every architecture.
57 lines
1.1 KiB
Bash
57 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
# Shared source-only build decisions used by makerpm and buildcore.sh.
|
|
|
|
function xcat_source_only {
|
|
[ "$SRCONLY" = "1" -o "$SRCONLY" = "yes" -o "$SRCONLY" = "true" ]
|
|
}
|
|
|
|
function xcat_rpm_build_arches {
|
|
if xcat_source_only; then
|
|
printf '%s\n' "$1"
|
|
else
|
|
printf '%s\n' "$@"
|
|
fi
|
|
}
|
|
|
|
function xcat_configure_rpm_build_mode {
|
|
local osname="$1"
|
|
|
|
if xcat_source_only; then
|
|
if [ "$osname" = "AIX" ]; then
|
|
echo "Error: SRCONLY is not supported on AIX."
|
|
return 1
|
|
fi
|
|
SPECBUILD="-bs"
|
|
TARBUILD="-ts"
|
|
else
|
|
SPECBUILD="-ba"
|
|
TARBUILD="-ta"
|
|
fi
|
|
}
|
|
|
|
function xcat_announce_build {
|
|
if [ "$SPECBUILD" = "-bs" ]; then
|
|
echo "Building $RPMROOT/SRPMS/$1-snap*.src.rpm $EMBEDTXT..."
|
|
else
|
|
echo "Building $2 $EMBEDTXT..."
|
|
fi
|
|
}
|
|
|
|
function xcat_rpmbuild_spec {
|
|
rpmbuild $QUIET "$SPECBUILD" "$@"
|
|
}
|
|
|
|
function xcat_rpmbuild_tar {
|
|
rpmbuild $QUIET "$TARBUILD" "$@"
|
|
}
|
|
|
|
function xcat_require_binary_build {
|
|
local package="$1"
|
|
|
|
if xcat_source_only; then
|
|
echo "Error: SRCONLY is not supported for $package."
|
|
return 1
|
|
fi
|
|
}
|