mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-26 23:40:26 +01:00
spec: remove snapshot and git_sha macros
Snapshot is only used from nm-copr-build.sh script, so not very useful.
Git_sha is used from build.sh. Other than that, downstream is always
nil.
Remove them and modify build.sh to use --define "dist xxx" instead of
them. This change is motivated by Packit not being able to modify the
release number if it has the %{snap} suffix.
(cherry picked from commit 5445ad2287)
This commit is contained in:
parent
d41cc08e78
commit
7372e93044
2 changed files with 7 additions and 18 deletions
|
|
@ -15,8 +15,6 @@
|
|||
%global epoch_version 1
|
||||
%global base_version __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__
|
||||
|
|
@ -31,15 +29,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 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
|
||||
|
|
@ -161,7 +150,7 @@ Name: NetworkManager
|
|||
Summary: Network connection manager and user applications
|
||||
Epoch: %{epoch_version}
|
||||
Version: %{base_version}
|
||||
Release: %{release_version}%{?snap}%{?dist}
|
||||
Release: %{release_version}%{?dist}
|
||||
Group: System Environment/Base
|
||||
License: GPL-2.0-or-later AND LGPL-2.1-or-later
|
||||
URL: https://networkmanager.dev/
|
||||
|
|
|
|||
|
|
@ -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")}"
|
||||
|
|
@ -208,10 +207,6 @@ write_changelog
|
|||
|
||||
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=()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue