contrib/rpm: cleanup of NetworkManager.spec by adding %{epoch_version} and %{git_sha_version}
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
# SPEC file to build NetworkManager for testing. It aims for a similar
|
||||
# configuration as rhel-7.0 and Fedora rawhide
|
||||
#
|
||||
# This spec file is not used to create any packages for RHEL, Fedora or any
|
||||
# This spec file is not used as is to create official packages for RHEL, Fedora or any
|
||||
# other distribution.
|
||||
#
|
||||
# Note that it contains __PLACEHOLDERS__ that will be replaced by the accompanying 'build.sh' script.
|
||||
|
||||
|
||||
%define dbus_version 1.1
|
||||
%define dbus_glib_version 0.100
|
||||
@@ -16,6 +19,7 @@
|
||||
%define git_sha __COMMIT__
|
||||
%define realversion __VERSION__
|
||||
%define release_version __RELEASE_VERSION__
|
||||
%define epoch_version 1
|
||||
|
||||
%define obsoletes_nmver 1:0.9.9.95-1
|
||||
|
||||
@@ -62,11 +66,13 @@
|
||||
|
||||
%global _hardened_build 1
|
||||
|
||||
%define git_sha_version %(test -n '%{git_sha}' && echo '.%{git_sha}')
|
||||
|
||||
Name: NetworkManager
|
||||
Summary: Network connection manager and user applications
|
||||
Epoch: 1
|
||||
Epoch: %{epoch_version}
|
||||
Version: %{realversion}
|
||||
Release: %{release_version}%{snapshot}.%{git_sha}%{?dist}
|
||||
Release: %{release_version}%{snapshot}%{git_sha_version}%{?dist}
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://www.gnome.org/projects/NetworkManager/
|
||||
|
@@ -37,8 +37,8 @@ get_version() {
|
||||
write_changelog() {
|
||||
if [[ "x$CHANGELOG" == x ]]; then
|
||||
cat <<- EOF
|
||||
* $(LC_TIME=C date '+%a %b %d %Y') $USERNAME - %{version}-%{release_version}%{snapshot}.%{git_sha}
|
||||
- build of NetworkManager ($DATE, $UUID)
|
||||
* $(LC_TIME=C date '+%a %b %d %Y') $USERNAME - %{epoch_version}:%{version}-%{release_version}%{snapshot}%{git_sha_version}
|
||||
- build of NetworkManager ($DATE, uuid: $UUID, git: $COMMIT_FULL)
|
||||
$(git log -n20 --date=local --format='- %h %s [%an] (%ci)')
|
||||
- ...
|
||||
EOF
|
||||
@@ -64,6 +64,7 @@ exec 2>&1
|
||||
UUID=`uuidgen`
|
||||
RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list --first-parent HEAD | wc -l)}"
|
||||
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:-$(git rev-parse --verify HEAD | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}"
|
||||
USERNAME="${USERNAME:-"$(git config user.name) <$(git config user.email)>"}"
|
||||
SPECFILE="$(abs_path "$SPECFILE" "$SCRIPTDIR/NetworkManager.spec")"
|
||||
@@ -103,6 +104,7 @@ write_changelog
|
||||
sed -e "s/__VERSION__/$VERSION/g" \
|
||||
-e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
|
||||
-e "s/__COMMIT__/$COMMIT/g" \
|
||||
-e "s/__COMMIT_FULL__/$COMMIT_FULL/g" \
|
||||
-e "s/__SOURCE1__/$(basename "$SOURCE")/g" \
|
||||
"$SPECFILE" |
|
||||
sed -e "/^__CHANGELOG__$/ \
|
||||
|
Reference in New Issue
Block a user