contrib/rpm: refactor specifying package version in spec file
Similar to what we do for RHEL and Fedora's spec file.
This commit is contained in:
@@ -30,7 +30,14 @@
|
|||||||
|
|
||||||
%global _hardened_build 1
|
%global _hardened_build 1
|
||||||
|
|
||||||
%global git_sha_version %{?git_sha:.%{git_sha}}
|
%if x%{?snapshot} != x
|
||||||
|
%global snapshot_dot .%{snapshot}
|
||||||
|
%endif
|
||||||
|
%if x%{?git_sha} != x
|
||||||
|
%global git_sha_dot .%{git_sha}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%global snap %{?git_sha_dot}%{?snapshot_dot}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
@@ -89,7 +96,7 @@ Name: NetworkManager
|
|||||||
Summary: Network connection manager and user applications
|
Summary: Network connection manager and user applications
|
||||||
Epoch: %{epoch_version}
|
Epoch: %{epoch_version}
|
||||||
Version: %{rpm_version}
|
Version: %{rpm_version}
|
||||||
Release: %{release_version}%{snapshot}%{git_sha_version}%{?dist}
|
Release: %{release_version}%{?snap}%{?dist}
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.gnome.org/projects/NetworkManager/
|
URL: http://www.gnome.org/projects/NetworkManager/
|
||||||
|
@@ -70,7 +70,7 @@ get_version() {
|
|||||||
write_changelog() {
|
write_changelog() {
|
||||||
if [[ "x$CHANGELOG" == x ]]; then
|
if [[ "x$CHANGELOG" == x ]]; then
|
||||||
cat <<- EOF
|
cat <<- EOF
|
||||||
* $(LC_TIME=C date '+%a %b %d %Y') $USERNAME - %{epoch_version}:%{version}-%{release_version}%{snapshot}%{git_sha_version}
|
* $(LC_TIME=C date '+%a %b %d %Y') $USERNAME - %{epoch_version}:%{version}-%{release_version}%{?snap}
|
||||||
- build of NetworkManager ($DATE, uuid: $UUID, git: $COMMIT_FULL)
|
- build of NetworkManager ($DATE, uuid: $UUID, git: $COMMIT_FULL)
|
||||||
$(git log -n20 --date=local --format='- %h %s [%an] (%ci)')
|
$(git log -n20 --date=local --format='- %h %s [%an] (%ci)')
|
||||||
- ...
|
- ...
|
||||||
@@ -163,6 +163,7 @@ sed -e "s/__VERSION__/$VERSION/g" \
|
|||||||
-e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
|
-e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
|
||||||
-e "s/__COMMIT__/$COMMIT/g" \
|
-e "s/__COMMIT__/$COMMIT/g" \
|
||||||
-e "s/__COMMIT_FULL__/$COMMIT_FULL/g" \
|
-e "s/__COMMIT_FULL__/$COMMIT_FULL/g" \
|
||||||
|
-e "s/__SNAPSHOT__/$SNAPSHOT/g" \
|
||||||
-e "s/__SOURCE1__/$(basename "$SOURCE")/g" \
|
-e "s/__SOURCE1__/$(basename "$SOURCE")/g" \
|
||||||
"$SPECFILE" |
|
"$SPECFILE" |
|
||||||
sed -e "/^__CHANGELOG__$/ \
|
sed -e "/^__CHANGELOG__$/ \
|
||||||
|
Reference in New Issue
Block a user