summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-07-01 16:43:16 +0200
committerLubomir Rintel <lkundrak@v3.sk>2022-07-10 20:49:05 +0200
commit8d12cc8152a83821eabaed86823faea313eb2433 (patch)
tree4181bd7ac4e989ef999fa6767f665d18051189ad
parent880bec0f4f862b713a0b0cad37e31924d54dfb32 (diff)
downloadNetworkManager-8d12cc8152a83821eabaed86823faea313eb2433.tar.gz
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). https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1286
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec14
-rwxr-xr-xcontrib/fedora/rpm/build.sh6
2 files changed, 6 insertions, 14 deletions
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index 44baf09c26..5063a16b99 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -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
diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh
index 6157df44ba..e5a3d84468 100755
--- a/contrib/fedora/rpm/build.sh
+++ b/contrib/fedora/rpm/build.sh
@@ -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"