Skip to content

Commit

Permalink
Alternative way to have generic rpmbuild options
Browse files Browse the repository at this point in the history
  • Loading branch information
lnussel committed Jan 31, 2022
1 parent d1f33a7 commit 7c901c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
23 changes: 11 additions & 12 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ BUILD_SUCCEEDED=
COPY_SOURCES_ASIS=
NO_SOURCE_COPY=
BUILD_IN_PLACE=
NOPREP=
EXTRA_RPMBOPTS=


RECIPE_BUILD_START_TIME=
CCACHE_SETUP_START_TIME=
Expand Down Expand Up @@ -264,13 +265,10 @@ Known Parameters:
the specified stage and all stages coming after it. With no
suffix, stages up to and included the specified stage are run.
--build-in-place
Passed directly to rpmbuild
--here
Use for for building packages directly from a git
checkout in the current working directory. Shortcut
for --build-in-place --no-source-copy
for --rpmbopts build-in-place --no-source-copy
--target platform
Set target platform for rpmbuild
Expand Down Expand Up @@ -1347,14 +1345,13 @@ while test -n "$1"; do
-no-source-copy)
NO_SOURCE_COPY=true
;;
-noprep)
NOPREP=true
;;
-build-in-place)
BUILD_IN_PLACE=true
-rpmbopts)
needarg
EXTRA_RPMBOPTS="$EXTRA_RPMBOPTS${EXTRA_RPMBOPTS:+,}$ARG"
shift
;;
-here)
BUILD_IN_PLACE=true
EXTRA_RPMBOPTS="$EXTRA_RPMBOPTS${EXTRA_RPMBOPTS:+,}build-in-place"
NO_SOURCE_COPY=true
;;
---noarg)
Expand Down Expand Up @@ -1391,8 +1388,10 @@ test -n "$BUILD_RPM_BUILD_STAGE" && validate_param "--stage" "$BUILD_RPM_BUILD_S
test "$BUILD_ROOT" != /var/tmp/build-root && validate_param "--root" "$BUILD_ROOT" BUILD_ROOT
test "$CONFIG_DIR" != "$BUILD_DIR/configs" && validate_param "--configdir" "$CONFIG_DIR" CONFIG_DIR

if test -n "$BUILD_IN_PLACE"; then
if test "$EXTRA_RPMBOPTS//build-in-place/" != "$EXTRA_RPMBOPTS"; then
# XXX: for build-recipe-spec
definesnstuff+=("--define" "_build_in_place 1")
BUILD_IN_PLACE=true
fi

# validate the buildroot
Expand Down
8 changes: 3 additions & 5 deletions build-recipe-spec
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,9 @@ recipe_build_spec() {
rpmbopts[${#rpmbopts[@]}]='--define'
rpmbopts[${#rpmbopts[@]}]="RSYNCDONE 1"
fi
if test -n "$NOPREP" ; then
rpmbopts[${#rpmbopts[@]}]='--noprep'
fi
if test -n "$BUILD_IN_PLACE" ; then
rpmbopts[${#rpmbopts[@]}]='--build-in-place'
if test -n "$EXTRA_RPMBOPTS" ; then
IFS=, eval set -- '$EXTRA_RPMBOPTS'
rpmbopts+=("${@/#/--}")
fi

buildrootoverride=$(queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" buildflags rpm-buildroot-override)
Expand Down
1 change: 1 addition & 0 deletions build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ vm_first_stage() {
echo "BUILD_RPM_BUILD_STAGE='$BUILD_RPM_BUILD_STAGE'" >> $BUILD_ROOT/.build/build.data
echo "BUILD_IN_PLACE='BUILD_IN_PLACE'" >> $BUILD_ROOT/.build/build.data
echo "NO_SOURCE_COPY='$NO_SOURCE_COPY'" >> $BUILD_ROOT/.build/build.data
echo "EXTRA_RPMBOPTS='$EXTRA_RPMBOPTS'" >> $BUILD_ROOT/.build/build.data
# fallback time for broken hosts
rm -rf $BUILD_ROOT/.build/.date
date '+@%s' > $BUILD_ROOT/.build/.date
Expand Down

0 comments on commit 7c901c2

Please sign in to comment.