mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 22:10:14 +01:00
contrib/rpm: untangle setting of bcond_{test,debug} defaults
Resolve the defaults in build.sh instead of RPM macros. This looks less terrible maintaining the same defaults as well as options to override it upstream. Moving it to the block that downstreams (Fedora, Red Hat) keep customized makes it possible for them to also maintain customized defaults here. In particular, the downstreams should be able to enable bcond_test at least for their production release (otherwise there's little point in actually running tests at package build time).
This commit is contained in:
parent
02685e990e
commit
343fcc6cd6
2 changed files with 6 additions and 14 deletions
|
|
@ -18,6 +18,8 @@
|
|||
%global release_version __RELEASE_VERSION__
|
||||
%global snapshot __SNAPSHOT__
|
||||
%global git_sha __COMMIT__
|
||||
%global bcond_default_debug __BCOND_DEFAULT_DEBUG__
|
||||
%global bcond_default_test __BCOND_DEFAULT_TEST__
|
||||
|
||||
%global obsoletes_device_plugins 1:0.9.9.95-1
|
||||
%global obsoletes_ppp_plugin 1:1.5.3
|
||||
|
|
@ -46,18 +48,6 @@
|
|||
|
||||
###############################################################################
|
||||
|
||||
%if "x__BCOND_DEFAULT_DEBUG__" == "x1" || "x__BCOND_DEFAULT_DEBUG__" == "x0"
|
||||
%global bcond_default_debug __BCOND_DEFAULT_DEBUG__
|
||||
%else
|
||||
%global bcond_default_debug 0
|
||||
%endif
|
||||
|
||||
%if "x__BCOND_DEFAULT_TEST__" == "x1" || "x__BCOND_DEFAULT_TEST__" == "x0"
|
||||
%global bcond_default_test __BCOND_DEFAULT_TEST__
|
||||
%else
|
||||
%global bcond_default_test 0
|
||||
%endif
|
||||
|
||||
%bcond_with meson
|
||||
%bcond_without adsl
|
||||
%bcond_without bluetooth
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@ SNAPSHOT="${SNAPSHOT:-%{nil\}}"
|
|||
VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}"
|
||||
COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading HEAD revision")}"
|
||||
COMMIT="${COMMIT:-$(printf '%s' "$COMMIT_FULL" | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}"
|
||||
BCOND_DEFAULT_DEBUG="${BCOND_DEFAULT_DEBUG:-0}"
|
||||
BCOND_DEFAULT_TEST="${BCOND_DEFAULT_TEST:-0}"
|
||||
USERNAME="${USERNAME:-"$(git config user.name) <$(git config user.email)>"}"
|
||||
SPECFILE="$(abs_path "$SPECFILE" "$SCRIPTDIR/NetworkManager.spec")" || die "invalid \$SPECFILE argument"
|
||||
SOURCE_FROM_GIT="$(coerce_bool "$SOURCE_FROM_GIT" "")"
|
||||
|
|
@ -177,8 +179,8 @@ LOG ""
|
|||
LOG "UUID=$UUID"
|
||||
LOG "BASEDIR=$TEMP"
|
||||
|
||||
in_set "$BCOND_DEFAULT_DEBUG" "" 0 1 || die "Invalid value for \$BCOND_DEFAULT_DEBUG: \"$BCOND_DEFAULT_DEBUG\""
|
||||
in_set "$BCOND_DEFAULT_TEST" "" 0 1 || die "Invalid value for \$BCOND_DEFAULT_TEST: \"$BCOND_DEFAULT_TEST\""
|
||||
in_set "$BCOND_DEFAULT_DEBUG" 0 1 || die "Invalid value for \$BCOND_DEFAULT_DEBUG: \"$BCOND_DEFAULT_DEBUG\""
|
||||
in_set "$BCOND_DEFAULT_TEST" 0 1 || die "Invalid value for \$BCOND_DEFAULT_TEST: \"$BCOND_DEFAULT_TEST\""
|
||||
|
||||
ln -snf "$TEMPBASE" ./latest0
|
||||
ln "$BUILDLOG" "$TEMPBASE/build.log"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue