From 3cba4f262776aa1d6f243e081c65c03a824da7af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Mon, 7 Jul 2025 09:27:05 +0200 Subject: [PATCH] spec: add git_tag_version The URL to the tarball needs the git tag, that might be 1.54-rc1 instead of 1.53.90. Allow to define it as a separate variable in the spec file. It can be set as `git_tag_version %{real_version}` when they are identical. It is not really needed here in the upstream spec file, as the "Source" line is commented out, but add it as a reference for donwstream spec files. --- contrib/fedora/rpm/NetworkManager.spec | 3 ++- contrib/fedora/rpm/build.sh | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec index 788e9ead5..832515227 100644 --- a/contrib/fedora/rpm/NetworkManager.spec +++ b/contrib/fedora/rpm/NetworkManager.spec @@ -14,6 +14,7 @@ %global epoch_version 1 %global real_version __VERSION__ +%global git_tag_version __GIT_TAG_VERSION__ %global rpm_version %{real_version} %global release_version __RELEASE_VERSION__ %global snapshot __SNAPSHOT__ @@ -180,7 +181,7 @@ 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/%{git_tag_version}/downloads/%{name}-%{real_version}.tar.xz Source: __SOURCE1__ Source1: NetworkManager.conf Source2: 00-server.conf diff --git a/contrib/fedora/rpm/build.sh b/contrib/fedora/rpm/build.sh index 4a89a6b45..1f8188a2f 100755 --- a/contrib/fedora/rpm/build.sh +++ b/contrib/fedora/rpm/build.sh @@ -12,6 +12,7 @@ set -o pipefail # RELEASE_VERSION= # SNAPSHOT= # VERSION= +# GIT_TAG_VERSION= # COMMIT_FULL= # COMMIT= # USERNAME= @@ -112,6 +113,7 @@ UUID=`uuidgen` RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}" SNAPSHOT="${SNAPSHOT:-%{nil\}}" VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}" +GIT_TAG_VERSION="${GIT_TAG_VERSION:-$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}" @@ -155,6 +157,7 @@ if [[ "$SOURCE_FROM_GIT" == "1" ]]; then fi LOG "VERSION=$VERSION" +LOG "GIT_TAG_VERSION=$GIT_TAG_VERSION" LOG "RELEASE_VERSION=$RELEASE_VERSION" LOG "SNAPSHOT=$SNAPSHOT" LOG "COMMIT_FULL=$COMMIT_FULL" @@ -207,6 +210,7 @@ cp "$SOURCE_README_IFCFG_MIGRATED" "$TEMP/SOURCES/readme-ifcfg-rh-migrated.txt" write_changelog sed -e "s/__VERSION__/$VERSION/g" \ + -e "s/__GIT_TAG_VERSION__/$GIT_TAG_VERSION/g" \ -e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \ -e "s/__SNAPSHOT__/$SNAPSHOT/g" \ -e "s/__COMMIT__/$COMMIT/g" \