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 4e16360 commit 75a5086
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 8 additions & 6 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 @@ -1347,11 +1348,10 @@ 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
Expand Down Expand Up @@ -1392,7 +1392,9 @@ test "$BUILD_ROOT" != /var/tmp/build-root && validate_param "--root" "$BUILD_ROO
test "$CONFIG_DIR" != "$BUILD_DIR/configs" && validate_param "--configdir" "$CONFIG_DIR" CONFIG_DIR

if test -n "$BUILD_IN_PLACE"; then
# XXX: for build-recipe-spec
definesnstuff+=("--define" "_build_in_place 1")
EXTRA_RPMBOPTS="$EXTRA_RPMBOPTS${EXTRA_RPMBOPTS:+,}build-in-place"
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

0 comments on commit 75a5086

Please sign in to comment.