Commit b1e26735 authored by Thomas Haller's avatar Thomas Haller

contrib/rpm: add option to only building SRPM

Set environment variable BUILDTYPE=SRPM or call
`build_clean.sh --srpm`.
Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
parent 3e3e54a5
......@@ -116,7 +116,16 @@ sed -e "/^__CHANGELOG__$/ \
d
}" > "$TEMPSPEC" || die "Error reading spec file"
rpmbuild --define "_topdir $TEMP" -ba "$TEMPSPEC" || die "ERROR: rpmbuild FAILED"
case "$BUILDTYPE" in
"SRPM")
RPM_BUILD_OPTION=-bs
;;
*)
RPM_BUILD_OPTION=-ba
;;
esac
rpmbuild --define "_topdir $TEMP" $RPM_BUILD_OPTION "$TEMPSPEC" || die "ERROR: rpmbuild FAILED"
ln -snf "$TEMPBASE" ./latest
TEMP_LATEST="$(readlink -f .)"/latest
......@@ -128,6 +137,6 @@ LOG
LOG "See \"$TEMP_LATEST/\" which symlinks to \"$TEMPBASE\""
LOG
LOG "Result:"
ls -dla "$TEMP_LATEST" "$(dirname "$TEMP_LATEST")/$TEMPBASE/" "$TEMP_LATEST"/RPMS/*/ "$TEMP_LATEST"/RPMS/*/*.rpm "$TEMP_LATEST"/SRPMS/ "$TEMP_LATEST"/SRPMS/*.rpm | sed 's/^/ /'
ls -dla "$TEMP_LATEST" "$(dirname "$TEMP_LATEST")/$TEMPBASE/" "$TEMP_LATEST"/RPMS/*/ "$TEMP_LATEST"/RPMS/*/*.rpm "$TEMP_LATEST"/SRPMS/ "$TEMP_LATEST"/SRPMS/*.rpm 2>/dev/null | sed 's/^/ /'
......@@ -15,6 +15,7 @@ usage() {
echo " --force: force build, even if working directory is not clean and has local modifications"
echo " --clean: run \`git-clean -fdx :/\` before build"
echo " --quick: only run \`make dist\` instead of \`make distcheck\`"
echo " --srpm: only build the SRPM"
}
......@@ -46,6 +47,9 @@ for A; do
-Q|--quick)
QUICK=1
;;
-S|--srpm)
BUILDTYPE=SRPM
;;
*)
usage
die "Unexpected argument \"$A\""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment