about summary refs log tree commit diff
path: root/contrib
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2026-02-22 00:40:03 +0100
committerMichael Biebl <biebl@debian.org>2026-02-22 00:40:03 +0100
commitccdb9117cca7141ee709afca8b25c966ff4fa18e (patch)
tree3b7377c95e1d4049c13dd9101ae923fee70ab91d /contrib
parentd0ea10125cc04f55c1864451198d87fb801d1457 (diff)
parent067fb576988f685e83ac8b0ae690334aff547c85 (diff)
Update upstream source from tag 'upstream/1.56.0'
Update to upstream version '1.56.0'
with Debian dir 15fab61a7abf1fd4e2ba46785f96d935e87d32bb
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/alpine/REQUIRED_PACKAGES1
-rwxr-xr-xcontrib/debian/REQUIRED_PACKAGES1
-rwxr-xr-xcontrib/fedora/REQUIRED_PACKAGES1
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec62
-rwxr-xr-xcontrib/fedora/rpm/build.sh14
-rwxr-xr-xcontrib/fedora/rpm/configure-for-system.sh2
-rwxr-xr-xcontrib/fedora/rpm/release.sh253
-rwxr-xr-xcontrib/scripts/nm-ci-run.sh3
8 files changed, 133 insertions, 204 deletions
diff --git a/contrib/alpine/REQUIRED_PACKAGES b/contrib/alpine/REQUIRED_PACKAGES
index 9f1affcb..3a3cc1ab 100755
--- a/contrib/alpine/REQUIRED_PACKAGES
+++ b/contrib/alpine/REQUIRED_PACKAGES
@@ -30,7 +30,6 @@ apk add \
     'libpsl-dev' \
     'libsoup-dev' \
     'libteam-dev' \
-    'libtool' \
     'linux-headers' \
     'meson' \
     'mobile-broadband-provider-info' \
diff --git a/contrib/debian/REQUIRED_PACKAGES b/contrib/debian/REQUIRED_PACKAGES
index d91e54d2..68f62570 100755
--- a/contrib/debian/REQUIRED_PACKAGES
+++ b/contrib/debian/REQUIRED_PACKAGES
@@ -62,7 +62,6 @@ install \
     libreadline-dev \
     libsystemd-dev \
     libteam-dev \
-    libtool \
     libudev-dev \
     locales \
     meson \
diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES
index 38a2cbbf..6f70537d 100755
--- a/contrib/fedora/REQUIRED_PACKAGES
+++ b/contrib/fedora/REQUIRED_PACKAGES
@@ -68,7 +68,6 @@ install \
     libndp-devel \
     libnvme-devel \
     libselinux-devel \
-    libtool \
     libuuid-devel \
     meson \
     mobile-broadband-provider-info-devel \
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index 29bf8050..73ab88f3 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -6,18 +6,23 @@
 #
 # Note that it contains __PLACEHOLDERS__ that will be replaced by the accompanying 'build.sh' script.
 
+Name:    NetworkManager
+Summary: Network connection manager and user applications
+License: GPL-2.0-or-later AND LGPL-2.1-or-later
+URL:     https://networkmanager.dev/
+Group:   System Environment/Base
+
+Epoch:   1
+Version: __VERSION__
+Release: __RELEASE_VERSION__%{?dist}
+
+###############################################################################
 
 %global wpa_supplicant_version 1:1.1
 
 %global ppp_version %(pkg-config --modversion pppd 2>/dev/null || sed -n 's/^#define\\s*VERSION\\s*"\\([^\\s]*\\)"$/\\1/p' %{_includedir}/pppd/patchlevel.h 2>/dev/null | grep . || echo bad)
 %global glib2_version %(pkg-config --modversion glib-2.0 2>/dev/null || echo bad)
 
-%global epoch_version 1
-%global real_version __VERSION__
-%global rpm_version %{real_version}
-%global release_version __RELEASE_VERSION__
-%global snapshot __SNAPSHOT__
-%global git_sha __COMMIT__
 %global bcond_default_debug __BCOND_DEFAULT_DEBUG__
 %global bcond_default_lto __BCOND_DEFAULT_LTO__
 %global bcond_default_test __BCOND_DEFAULT_TEST__
@@ -32,17 +37,6 @@
 
 %global _hardened_build 1
 
-%if "x%{?snapshot}" != "x"
-%global snapshot_dot .%{snapshot}
-%endif
-%if "x%{?git_sha}" != "x"
-%global git_sha_dot .%{git_sha}
-%endif
-
-%global snap %{?snapshot_dot}%{?git_sha_dot}
-
-%global real_version_major %(printf '%s' '%{real_version}' | sed -n 's/^\\([1-9][0-9]*\\.[0-9][0-9]*\\)\\.[0-9][0-9]*$/\\1/p')
-
 %global systemd_units NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service nm-priv-helper.service
 
 %global systemd_units_cloud_setup nm-cloud-setup.service nm-cloud-setup.timer
@@ -153,17 +147,6 @@
 %bcond_with ifcfg_migrate
 %endif
 
-%if 0%{?fedora}
-# Although eBPF would be available on Fedora's kernel, it seems
-# we often get SELinux denials (rh#1651654). But even aside them,
-# bpf(BPF_MAP_CREATE, ...) randomly fails with EPERM. That might
-# be related to `ulimit -l`. Anyway, this is not usable at the
-# moment.
-%global ebpf_enabled "no"
-%else
-%global ebpf_enabled "no"
-%endif
-
 # Fedora 33 enables LTO by default by setting CFLAGS="-flto -ffat-lto-objects".
 # However, we also require "-flto -flto-partition=none", so disable Fedora's
 # default and use our configure option --with-lto instead.
@@ -171,16 +154,7 @@
 
 ###############################################################################
 
-Name: NetworkManager
-Summary: Network connection manager and user applications
-Epoch: %{epoch_version}
-Version: %{rpm_version}
-Release: %{release_version}%{?snap}%{?dist}
-Group: System Environment/Base
-License: GPL-2.0-or-later AND LGPL-2.1-or-later
-URL: https://networkmanager.dev/
-
-#Source: https://download.gnome.org/sources/NetworkManager/%{real_version_major}/%{name}-%{real_version}.tar.xz
+#Source: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/releases/%{version_no_tilde}/downloads/%{name}-%{version_no_tilde}.tar.xz
 Source: __SOURCE1__
 Source1: NetworkManager.conf
 Source2: 00-server.conf
@@ -253,7 +227,6 @@ Conflicts: NetworkManager-dispatcher-routing-rules <= 1:1.47.5-3
 %endif
 
 BuildRequires: gcc
-BuildRequires: libtool
 BuildRequires: pkgconfig
 BuildRequires: meson
 BuildRequires: gettext-devel >= 0.19.8
@@ -586,7 +559,7 @@ Preferably use nmcli instead.
 
 
 %prep
-%autosetup -p1 -n NetworkManager-%{real_version}
+%autosetup -p1 -n NetworkManager-%{version_no_tilde}
 
 
 %build
@@ -683,11 +656,6 @@ Preferably use nmcli instead.
 %else
 	-Dlibpsl=false \
 %endif
-%if %{ebpf_enabled} != "yes"
-	-Debpf=false \
-%else
-	-Debpf=true \
-%endif
 	-Dsession_tracking=systemd \
 	-Dsuspend_resume=systemd \
 	-Dsystemdsystemunitdir=%{_unitdir} \
@@ -771,8 +739,8 @@ rm -f %{buildroot}%{_unitdir}/NetworkManager-wait-online-initrd.service
 find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference meson.build '{}' \+
 
 %if 0%{?__debug_package} && ! 0%{?flatpak}
-mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
-cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{real_version}
+mkdir -p %{buildroot}%{_prefix}/src/debug/NetworkManager-%{version_no_tilde}
+cp valgrind.suppressions %{buildroot}%{_prefix}/src/debug/NetworkManager-%{version_no_tilde}
 %endif
 
 %if %{with ifcfg_rh}
diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh
index 4a89a6b4..10180587 100755
--- a/contrib/fedora/rpm/build.sh
+++ b/contrib/fedora/rpm/build.sh
@@ -110,7 +110,6 @@ exec 2>&1
 
 UUID=`uuidgen`
 RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}"
-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")}"
@@ -206,12 +205,8 @@ cp "$SOURCE_README_IFCFG_MIGRATED" "$TEMP/SOURCES/readme-ifcfg-rh-migrated.txt"
 
 write_changelog
 
-sed -e "s/__VERSION__/$VERSION/g" \
+sed -e "s/__VERSION__/${VERSION/-/\~}/g" \
     -e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
-    -e "s/__SNAPSHOT__/$SNAPSHOT/g" \
-    -e "s/__COMMIT__/$COMMIT/g" \
-    -e "s/__COMMIT_FULL__/$COMMIT_FULL/g" \
-    -e "s/__SNAPSHOT__/$SNAPSHOT/g" \
     -e "s/__SOURCE1__/$(basename "$SOURCE")/g" \
     -e "s/__BCOND_DEFAULT_DEBUG__/$BCOND_DEFAULT_DEBUG/g" \
     -e "s/__BCOND_DEFAULT_LTO__/${BCOND_DEFAULT_LTO:-"%{nil}"}/g" \
@@ -232,7 +227,12 @@ case "$BUILDTYPE" in
         ;;
 esac
 
-rpmbuild --define "_topdir $TEMP" $RPM_BUILD_OPTION "$TEMPSPEC" $NM_RPMBUILD_ARGS || die "ERROR: rpmbuild FAILED"
+DIST=
+[[ "$COMMIT" != "" ]] && DIST=".${COMMIT}${DIST}"
+[[ "$SNAPSHOT" != "" ]] && DIST=".${SNAPSHOT}${DIST}"
+[[ "$DIST" != "" ]] && DIST=("--define" "dist ${DIST}$(rpmbuild --eval '%{dist}')")
+
+rpmbuild --define "_topdir $TEMP" "${DIST[@]}" $RPM_BUILD_OPTION "$TEMPSPEC" $NM_RPMBUILD_ARGS || die "ERROR: rpmbuild FAILED"
 
 LS_EXTRA=()
 
diff --git a/contrib/fedora/rpm/configure-for-system.sh b/contrib/fedora/rpm/configure-for-system.sh
index f0638591..6bdf6682 100755
--- a/contrib/fedora/rpm/configure-for-system.sh
+++ b/contrib/fedora/rpm/configure-for-system.sh
@@ -155,7 +155,6 @@ P_CRYPTO="${CRYPTO-}"
 P_DBUS_SYS_DIR="${DBUS_SYS_DIR-}"
 P_DHCP_DEFAULT="${DHCP_DEFAULT-}"
 P_DNS_RC_MANAGER_DEFAULT="${DNS_RC_MANAGER_DEFAULT-}"
-P_EBPF_ENABLED="${EBPF_ENABLED-no}"
 P_FIREWALLD_ZONE="${FIREWALLD_ZONE-}"
 P_IWD="${IWD-}"
 P_LOGGING_BACKEND_DEFAULT="${LOGGING_BACKEND_DEFAULT-}"
@@ -396,7 +395,6 @@ meson setup\
     -Dmodify_system=true \
     -Dconcheck=true \
     -Dlibpsl="$(bool_true "$P_FEDORA")" \
-    -Debpf="$(bool_true "$P_EBPF_ENABLED")" \
     -Dsession_tracking=systemd \
     -Dsuspend_resume=systemd \
     -Dsystemdsystemunitdir=/usr/lib/systemd/system \
diff --git a/contrib/fedora/rpm/release.sh b/contrib/fedora/rpm/release.sh
index ff18cc5b..6caf1100 100755
--- a/contrib/fedora/rpm/release.sh
+++ b/contrib/fedora/rpm/release.sh
@@ -27,7 +27,7 @@
 #   * Run in a "clean" environment, i.e. no unusual environment variables set, on a recent
 #     Fedora, with suitable dependencies installed.
 #
-#   * First, ensure that you have a valid Gitlab's private token for gitlab.freedestkop.org
+#   * First, ensure that you have a valid Gitlab's private token for gitlab.freedesktop.org
 #     stored in ~/.config/nm-release-token, or pass one with --gitlab-token argument.
 #     Also, ensure you have a GPG key that you want to use for signing. Also, have gpg-agent running
 #     and possibly configure `git config --get user.signingkey` for the proper key.
@@ -102,14 +102,8 @@ do_command() {
 SCRIPTDIR="$(dirname "$(readlink -f "$0")")"
 GITDIR="$(cd "$SCRIPTDIR" && git rev-parse --show-toplevel || die "Could not get GITDIR")"
 
-parse_version() {
-    local VERSION=$(grep -E -m1 '^\s+version:' "$GITDIR/meson.build" \
-                    | cut -d"'" -f2 \
-                    | sed 's/\./ /g')
-
-    re='^(0|[1-9][0-9]*) (0|[1-9][0-9]*) (0|[1-9][0-9]*)$'
-    [[ "$VERSION" =~ $re ]] || return 1
-    echo "$VERSION"
+get_version() {
+    grep -E -m1 '^\s+version:' "$GITDIR/meson.build" | cut -d"'" -f2
 }
 
 number_is_even() {
@@ -155,14 +149,12 @@ check_gitlab_pipeline() {
 
 set_version_number() {
     sed -i \
-        -e '1,20 s/^\( *version: *'\''\)[0-9]\+\.[0-9]\+\.[0-9]\+\('\'',\)$/\1'"$1.$2.$3"'\2/' \
+        -E "1,20 s/^( *version: *')[^']+(',) *\$/\1$1\2/" \
         meson.build
 }
 
 check_news() {
     local mode="$1"
-    shift
-    local ver_arr=("$@")
 
     case "$mode" in
         major|minor)
@@ -259,12 +251,18 @@ done
 
 [ -n "$RELEASE_MODE" ] || die_usage "specify the desired release mode"
 
-VERSION_ARR=( $(parse_version) ) || die "cannot detect NetworkManager version"
-VERSION_STR="$(IFS=.; echo "${VERSION_ARR[*]}")"
+VERSION_STR="$(get_version)"
+VERSION_ARR=( $(echo "$VERSION_STR" | sed 's/[\.\-]/ /g') )
+if [[ ${VERSION_ARR[2]} =~ ^rc ]]; then
+    RC_VERSION=${VERSION_ARR[2]#rc}
+    VERSION_ARR[2]=0
+else
+    RC_VERSION=
+fi
 
 echo "Current version before release: $VERSION_STR (do \"$RELEASE_MODE\" release)"
 
-grep -q "version: '${VERSION_ARR[0]}.${VERSION_ARR[1]}.${VERSION_ARR[2]}'," ./meson.build || die "meson.build does not have expected version"
+grep -q "version: '$VERSION_STR'," ./meson.build || die "meson.build does not have expected version"
 
 TMP="$(git status --porcelain)" || die "git status failed"
 test -z "$TMP" || die "git working directory is not clean (git status --porcelain)"
@@ -280,50 +278,41 @@ if [ "$CUR_BRANCH" = main ]; then
     number_is_odd "${VERSION_ARR[1]}" || die "Unexpected version number on main. Should be an odd development version"
     [ "$RELEASE_MODE" = devel -o "$RELEASE_MODE" = rc1 -o "$RELEASE_MODE" = major-post ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
 else
-    re='^nm-[0-9]+-[0-9]+$'
-    [[ "$CUR_BRANCH" =~ $re ]] || die "Unexpected current branch $CUR_BRANCH. Should be main or nm-?-??"
-    if number_is_odd "${VERSION_ARR[1]}"; then
-        # we are on a release candiate branch.
-        [ "$RELEASE_MODE" = rc -o "$RELEASE_MODE" = major ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
-        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))" ] || die "Unexpected current branch $CUR_BRANCH. Should be nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))"
-    else
-        [ "$RELEASE_MODE" = minor ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
-        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}" ] || die "Unexpected current branch $CUR_BRANCH. Should be nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}"
-    fi
+    [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}" ] || die "Unexpected current branch $CUR_BRANCH. Should be nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}"
+    [ "$RELEASE_MODE" = rc -o "$RELEASE_MODE" = major -o "$RELEASE_MODE" = minor ] || die "Unexpected branch name \"$CUR_BRANCH\" for \"$RELEASE_MODE\""
 fi
 
-RC_VERSION=
 RELEASE_BRANCH=
 case "$RELEASE_MODE" in
     minor)
         number_is_even "${VERSION_ARR[1]}" || die "cannot do minor release on top of version $VERSION_STR"
-        [ "$CUR_BRANCH" != main ] || die "cannot do a minor release on main"
+        [ "$RC_VERSION" = "" ] || die "cannot do a minor release on top of an RC version"
+        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}" ] || die "minor release can only be on \"nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}\" branch"
         ;;
     devel)
         number_is_odd "${VERSION_ARR[1]}" || die "cannot do devel release on top of version $VERSION_STR"
-        [ "$((${VERSION_ARR[2]} + 1))" -lt 90 ] || die "devel release must have a micro version smaller than 90 but current version is $VERSION_STR"
+        [ "$RC_VERSION" = "" ] || die "cannot do a devel release on top of an RC version"
         [ "$CUR_BRANCH" == main ] || die "devel release can only be on main"
         ;;
-    rc)
-        number_is_odd "${VERSION_ARR[1]}" || die "cannot do rc release on top of version $VERSION_STR"
-        [ "${VERSION_ARR[2]}" -ge 90 ] || die "rc release must have a micro version larger than ${VERSION_ARR[0]}.90 but current version is $VERSION_STR"
-        RC_VERSION="$((${VERSION_ARR[2]} - 88))"
-        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))" ] || die "devel release can only be on \"nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))\" branch"
-        ;;
     rc1)
         number_is_odd "${VERSION_ARR[1]}" || die "cannot do rc release on top of version $VERSION_STR"
-        [ "${VERSION_ARR[2]}" -lt 90 ] || die "rc release must have a micro version smaller than ${VERSION_ARR[0]}.${VERSION_ARR[1]}.90 but current version is $VERSION_STR"
+        [ "$RC_VERSION" = "" ] || die "rc1 release cannot be done on top of an RC version"
         [ "$CUR_BRANCH" == main ] || die "rc1 release can only be on main"
         RELEASE_BRANCH="nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))"
         ;;
+    rc)
+        number_is_even "${VERSION_ARR[1]}" || die "cannot do rc release on top of version $VERSION_STR"
+        [ "$RC_VERSION" != "" ] || die "rc release must be done on top of an RC version"
+        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}" ] || die "rc release can only be on \"nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}\" branch"
+        ;;
     major)
-        number_is_odd "${VERSION_ARR[1]}" || die "cannot do major release on top of version $VERSION_STR"
-        [ "${VERSION_ARR[2]}" -ge 90 ] || die "parent version for major release must have a micro version larger than ${VERSION_ARR[0]}.90 but current version is $VERSION_STR"
-        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))" ] || die "major release can only be on \"nm-${VERSION_ARR[0]}-$((${VERSION_ARR[1]} + 1))\" branch"
+        number_is_even "${VERSION_ARR[1]}" || die "cannot do major release on top of version $VERSION_STR"
+        [ "$RC_VERSION" != "" ] || die "major release must be done on top of an RC version"
+        [ "$CUR_BRANCH" == "nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}" ] || die "major release can only be on \"nm-${VERSION_ARR[0]}-${VERSION_ARR[1]}\" branch"
         ;;
     major-post)
         number_is_odd "${VERSION_ARR[1]}" || die "cannot do major-post release on top of version $VERSION_STR"
-        [ "$((${VERSION_ARR[2]} + 1))" -lt 90 ] || die "major-post release must have a micro version smaller than 90 but current version is $VERSION_STR"
+        [ "$RC_VERSION" = "" ] || die "major-post release cannot be done on top of an RC version"
         [ "$CUR_BRANCH" == main ] || die "major-post release can only be on main"
         ;;
     *)
@@ -370,7 +359,7 @@ if [ "$ALLOW_LOCAL_BRANCHES" != 1 ]; then
     cmp <(git show "$ORIGIN/main:contrib/fedora/rpm/release.sh") "$BASH_SOURCE_ABSOLUTE" || die "$BASH_SOURCE is not identical to \`git show \"$ORIGIN/main:contrib/fedora/rpm/release.sh\"\`"
 fi
 
-if ! check_news "$RELEASE_MODE" "@{VERSION_ARR[@]}" ; then
+if ! check_news "$RELEASE_MODE"; then
     if [ "$CHECK_NEWS" == 1 ]; then
         die "NEWS file needs update to mention stable release (skip check with --no-check-news)"
     fi
@@ -389,7 +378,7 @@ if [ "$RELEASE_MODE" = major -o "$RELEASE_MODE" = minor ]; then
     fi
     echo "$(echo_color 36 -n "https://gitlab.freedesktop.org/NetworkManager/networkmanager.pages.freedesktop.org.git") by running"
     if [ "$RELEASE_MODE" = major ]; then
-        v="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).0"
+        v="${VERSION_ARR[0]}.${VERSION_ARR[1]}.0"
     else
         v="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$((${VERSION_ARR[2]} + 1))"
     fi
@@ -418,71 +407,36 @@ if [ $CHECK_GITLAB = 1 ]; then
     fi
 fi
 
-BRANCHES=()
-BUILD_TAG=
-
+# Work on a temporary branch
 CLEANUP_CHECKOUT_BRANCH="$CUR_BRANCH"
-
 git checkout -B "$TMP_BRANCH"
 CLEANUP_REFS+=("refs/heads/$TMP_BRANCH")
 
 case "$RELEASE_MODE" in
     minor)
-        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
-        git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))" -a || die "failed to commit release"
-
-        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
-        git tag -s -a -m "Tag $b" "$b" HEAD || die "failed to tag release"
-        BRANCHES+=("$b")
-        CLEANUP_REFS+=("refs/tags/$b")
-        BUILD_TAG="$b"
-        TAR_VERSION="$b"
+        # Version is already correct in meson.build
+        BUILD_VERSION="$VERSION_STR"
+        NEXT_VERSION="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$((${VERSION_ARR[2]} + 1))"
         ;;
     devel)
-        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
-        git commit -m "release: bump version to ${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1)) (development)" -a || die "failed to commit devel version bump"
-
-        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
-        git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag release"
-        BRANCHES+=("$b-dev")
-        CLEANUP_REFS+=("refs/tags/$b-dev")
-        BUILD_TAG="$b-dev"
-        TAR_VERSION="$b"
+        # Version is already correct in meson.build
+        BUILD_VERSION="$VERSION_STR"
+        NEXT_VERSION="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$((${VERSION_ARR[2]} + 1))-dev"
         ;;
     rc)
-        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$(("${VERSION_ARR[2]}" + 1))"
-        t="${VERSION_ARR[0]}.$(("${VERSION_ARR[1]}" + 1))-rc$RC_VERSION"
-        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" $(("${VERSION_ARR[2]}" + 1))
-        git commit -m "release: bump version to $b ($t) (development)" -a || die "failed to commit rc version bump"
-
-        git tag -s -a -m "Tag $b ($t) (development)" "$t" HEAD || die "failed to tag release"
-        BRANCHES+=("$t")
-        CLEANUP_REFS+=("refs/tags/$t")
-        BUILD_TAG="$t"
-        TAR_VERSION="$b"
+        # Version is already correct in meson.build
+        BUILD_VERSION="$VERSION_STR"
+        NEXT_VERSION="${VERSION_ARR[0]}.${VERSION_ARR[1]}-rc$((RC_VERSION + 1))"
         ;;
     rc1)
-        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" 90
-        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.90"
-        t="${VERSION_ARR[0]}.$(("${VERSION_ARR[1]}" + 1))-rc1"
-        git commit -m "release: bump version to $b ($t)" -a || die "failed to commit rc1 version bump"
-
-        git tag -s -a -m "Tag $b ($t) (development)" "$t" HEAD || die "failed to tag release $t"
-        BRANCHES+=("$t")
-        CLEANUP_REFS+=("refs/tags/$t")
-        BUILD_TAG="$t"
-        TAR_VERSION="$b"
+        # Current version is wrong (dev version), need to set rc1 version
+        BUILD_VERSION="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1))-rc1"
+        NEXT_VERSION="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1))-rc2"
         ;;
     major)
-        b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 1)).0"
-        set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 1))" 0
-        git commit -m "release: bump version to $b" -a || die "failed to commit major version bump"
-
-        git tag -s -a -m "Tag $b" "$b" HEAD || die "failed to tag release"
-        BRANCHES+=("$b")
-        CLEANUP_REFS+=("refs/tags/$b")
-        BUILD_TAG="$b"
-        TAR_VERSION="$b"
+        # Current version is wrong (rc version), need to set major version
+        BUILD_VERSION="${VERSION_ARR[0]}.${VERSION_ARR[1]}.0"
+        NEXT_VERSION="${VERSION_ARR[0]}.${VERSION_ARR[1]}.1"
         ;;
     major-post)
         # We create a merge commit with the content of current "main", with two
@@ -494,65 +448,77 @@ case "$RELEASE_MODE" in
         git merge -Xours --commit -m tmp main || die "merge1"
         git rm --cached -r . || die "merge2"
         git checkout main -- . || die "merge3"
-        b="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$((${VERSION_ARR[2]} + 1))"
         git commit --amend -m tmp -a || die "failed to commit major version bump"
         test x = "x$(git diff main HEAD)" || die "there is a diff after merge!"
 
-        set_version_number "${VERSION_ARR[0]}" "${VERSION_ARR[1]}" "$((${VERSION_ARR[2]} + 1))"
-        git commit --amend -m "release: bump version to $b (development)" -a || die "failed to commit major version bump"
-        git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag release"
-        BRANCHES+=("$b-dev")
-        CLEANUP_REFS+=("refs/tags/$b-dev")
-        BUILD_TAG="$b-dev"
-        TAR_VERSION="$b"
+        # Version is already correct in meson.build
+        BUILD_VERSION="$VERSION_STR"
+        NEXT_VERSION="${VERSION_ARR[0]}.${VERSION_ARR[1]}.$((${VERSION_ARR[2]} + 1))-dev"
         ;;
     *)
         die "Release mode $RELEASE_MODE not yet implemented"
         ;;
 esac
 
-build_tag() {
-    local BUILD_TAG="$1"
-    local TAR_FILE="NetworkManager-$2.tar.xz"
+build_version() {
+    local CURR_VERSION="$(get_version)"
+    local BUILD_VERSION="$1"
+    local NEXT_VERSION="$2"
+    local BUILD_VERSION_DESCR="${BUILD_VERSION/-dev/ (development)}"
+    local NEXT_VERSION_DESCR="${NEXT_VERSION/-dev/ (development)}"
+    local TAR_FILE="NetworkManager-$BUILD_VERSION.tar.xz"
     local SUM_FILE="$TAR_FILE.sha256sum"
 
-    git checkout "$BUILD_TAG" || die "failed to checkout $BUILD_TAG"
+    # The current version is usually already correct, except for rc1 and major. Bump version in those cases.
+    if [[ "$BUILD_VERSION" != "$CURR_VERSION" ]]; then
+        set_version_number "$BUILD_VERSION"
+        git commit -m "release: bump version to $BUILD_VERSION_DESCR" -a || die "failed to commit release"
+    fi
+
+    # Tag the release
+    git tag -s -a -m "Release $BUILD_VERSION_DESCR" "$BUILD_VERSION" HEAD || die "failed to tag release"
+    PUSH_REFS+=("$BUILD_VERSION")
+    CLEANUP_REFS+=("refs/tags/$BUILD_VERSION")
+
+    # Build to get the tarball for the release
     ./contrib/fedora/rpm/build_clean.sh -r || die "build release failed"
     cp "./build/meson-dist/$TAR_FILE" /tmp/ || die "failed to copy $TAR_FILE to /tmp"
     cp "./build/meson-dist/$SUM_FILE" /tmp/ || die "failed to copy $SUM_FILE to /tmp"
     git clean -fdx
-}
 
-RELEASE_TAR_VERSIONS=()
-RELEASE_TAGS=()
-if [ -n "$BUILD_TAG" ]; then
-    build_tag "$BUILD_TAG" "$TAR_VERSION"
-    RELEASE_TAR_VERSIONS+=("$TAR_VERSION")
-    RELEASE_TAGS+=("$BUILD_TAG")
-fi
-git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
+    # Store the release version for later use
+    RELEASE_VERSIONS+=("$BUILD_VERSION")
 
-BRANCHES+=( "$CUR_BRANCH" )
+    # Bump to next version, so that build between now and the next release has the next version already.
+    # Otherwise the macros in nm_version.h don't work correctly.
+    set_version_number "$NEXT_VERSION"
+    git commit -m "release: bump version to $NEXT_VERSION_DESCR" -a || die "failed to commit version bump"
+}
+
+# Build and create tarball. Bump version as needed.
+PUSH_REFS=()
+RELEASE_VERSIONS=()
+build_version "$BUILD_VERSION" "$NEXT_VERSION"
 
 if [ "$RELEASE_MODE" = rc1 ]; then
-    git branch "$RELEASE_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
-    BRANCHES+=( "$RELEASE_BRANCH" )
+    # Create the release branch (nm-1-xx)
+    git branch "$RELEASE_BRANCH" "$TMP_BRANCH" || die "cannot checkout $RELEASE_BRANCH"
+    PUSH_REFS+=( "$RELEASE_BRANCH" )
     CLEANUP_REFS+=( "refs/heads/$RELEASE_BRANCH" )
-    git checkout "$TMP_BRANCH"
-    b="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 2)).0"
-    set_version_number "${VERSION_ARR[0]}" "$((${VERSION_ARR[1]} + 2))" 0
-    git commit -m "release: bump version to $b (development)" -a || die "failed to commit devel version bump"
-    git tag -s -a -m "Tag $b (development)" "$b-dev" HEAD || die "failed to tag release"
-    BRANCHES+=("$b-dev")
-    CLEANUP_REFS+=("refs/tags/$b-dev")
-    BUILD_TAG="$b-dev"
-    TAR_VERSION="$b"
-    build_tag "$BUILD_TAG" "$TAR_VERSION"
-    RELEASE_TAR_VERSIONS+=("$TAR_VERSION")
-    RELEASE_TAGS+=("$BUILD_TAG")
-    git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
+
+    # Go back to the commit of the rc1 release, nm-1-xx is one commit further now.
+    git checkout -B "$TMP_BRANCH" "$BUILD_VERSION" || die "cannot checkout $TMP_BRANCH"
+
+    # Second release for rc1: create new dev version on main
+    BUILD_VERSION="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 2)).0-dev"
+    NEXT_VERSION="${VERSION_ARR[0]}.$((${VERSION_ARR[1]} + 2)).1-dev"
+    build_version "$BUILD_VERSION" "$NEXT_VERSION"
 fi
 
+# Work was done on the temporary branch, advance the real branch
+git checkout -B "$CUR_BRANCH" "$TMP_BRANCH" || die "cannot checkout $CUR_BRANCH"
+PUSH_REFS+=( "$CUR_BRANCH" )
+
 if [[ $GITLAB_TOKEN == "" ]]; then
     [[ -r ~/.config/nm-release-token ]] || die "cannot read ~/.config/nm-release-token"
     GITLAB_TOKEN=$(< ~/.config/nm-release-token)
@@ -565,20 +531,21 @@ if [ -z "$GITLAB_USER_ID" ] || [ "$GITLAB_USER_ID" = "null" ]; then
     die "failed to authenticate to gitlab.freedesktop.org with the private token"
 fi
 
-do_command git push "$ORIGIN" "${BRANCHES[@]}" || die "failed to to push branches ${BRANCHES[@]} to $ORIGIN"
+# Push the modified branches and tags to the origin repository
+do_command git push "$ORIGIN" "${PUSH_REFS[@]}" || die "failed to to push branches ${PUSH_REFS[@]} to $ORIGIN"
 
+# Create the releases
 CREATE_RELEASE_FAIL=0
-for I in "${!RELEASE_TAR_VERSIONS[@]}"; do
-    TAR_FILE="NetworkManager-${RELEASE_TAR_VERSIONS[$I]}.tar.xz"
+for BUILD_VERSION in "${RELEASE_VERSIONS[@]}"; do
+    TAR_FILE="NetworkManager-$BUILD_VERSION.tar.xz"
     SUM_FILE="$TAR_FILE.sha256sum"
-    BUILD_TAG="${RELEASE_TAGS["$I"]}"
     FAIL=0
 
     # upload tarball and checksum file as generic packages
     for F in "$TAR_FILE" "$SUM_FILE"; do
         do_command curl --location --fail-with-body --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
             --upload-file "/tmp/$F" \
-            "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$F" \
+            "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_VERSION/$F" \
             || FAIL=1
 
         if [[ $FAIL = 1 ]]; then
@@ -595,25 +562,25 @@ for I in "${!RELEASE_TAR_VERSIONS[@]}"; do
          --request POST "https://gitlab.freedesktop.org/api/v4/projects/411/releases" \
          --data "$(cat <<END
             {
-                "name": "NetworkManager $BUILD_TAG",
-                "tag_name": "$BUILD_TAG", 
+                "name": "NetworkManager $BUILD_VERSION",
+                "tag_name": "$BUILD_VERSION", 
                 "assets": {
                     "links": [
                         {
-                            "name": "NetworkManager $BUILD_TAG tarball with docs",
-                            "url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$TAR_FILE",
+                            "name": "NetworkManager $BUILD_VERSION tarball with docs",
+                            "url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_VERSION/$TAR_FILE",
                             "direct_asset_path": "/$TAR_FILE",
                             "link_type":"package"
                         },
                         {
-                            "name": "NetworkManager $BUILD_TAG tarball sha256sum",
-                            "url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_TAG/$SUM_FILE",
+                            "name": "NetworkManager $BUILD_VERSION tarball sha256sum",
+                            "url": "https://gitlab.freedesktop.org/api/v4/projects/411/packages/generic/NetworkManager/$BUILD_VERSION/$SUM_FILE",
                             "direct_asset_path": "/$SUM_FILE",
                             "link_type":"package"
                         },
                         {
                             "name": "NEWS",
-                            "url": "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/$BUILD_TAG/NEWS?ref_type=tags",
+                            "url": "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/$BUILD_VERSION/NEWS?ref_type=tags",
                             "direct_asset_path": "/NEWS",
                             "link_type":"other"
                         }
@@ -623,8 +590,8 @@ for I in "${!RELEASE_TAR_VERSIONS[@]}"; do
 END
             )" || FAIL=1
 
-    if [[ $? != 0 ]]; then
-        fail_msg "failed to create NetworkManager $BUILD_TAG release"
+    if [[ $FAIL = 1 ]]; then
+        fail_msg "failed to create NetworkManager $BUILD_VERSION release"
         CREATE_RELEASE_FAIL=1
         continue
     fi
diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh
index 2ae96a7c..57b867c5 100755
--- a/contrib/scripts/nm-ci-run.sh
+++ b/contrib/scripts/nm-ci-run.sh
@@ -175,12 +175,11 @@ meson setup build \
     -D libpsl=false \
     -D vapi=false \
     -D introspection=$_WITH_DOCS \
+    -D man=$_WITH_DOCS \
     -D qt=false \
     -D crypto=$_WITH_CRYPTO \
     -D docs=$_WITH_DOCS \
     \
-    -D ebpf=false \
-    \
     -D iwd=true \
     -D ofono=true \
     -D teamdctl=$_WITH_LIBTEAM \