libpsm2/libpsm2-use-exported-variable-for-version-and-release.patch

27 lines
1.4 KiB
Diff

Index: libpsm2-10.3.1/Makefile
===================================================================
--- libpsm2-10.3.1.orig/Makefile
+++ libpsm2-10.3.1/Makefile
@@ -138,7 +138,7 @@ endif
export LIBPSM2_COMPAT_CONF_DIR
# The desired version number comes from the most recent tag starting with "v"
-VERSION := $(shell if [ -e .git ] ; then git describe --tags --abbrev=0 --match='v*' | sed -e 's/^v//' -e 's/-/_/'; else echo "version" ; fi)
+VERSION ?= $(shell if [ -e .git ] ; then git describe --tags --abbrev=0 --match='v*' | sed -e 's/^v//' -e 's/-/_/'; else echo "version" ; fi)
# If we have a file called 'rpm_release_extension' (as on github),
# we take the release extension number from this file
@@ -162,11 +162,7 @@ endif
# The desired release number comes the git describe following the version which
# is the number of commits since the version tag was planted suffixed by the g<commitid>
ifndef RELEASE
-RELEASE := $(shell if [ -f rpm_release_extension ]; then cat rpm_release_extension;\
- elif [ -e .git ] ; then git describe --tags --long --match='v*' | \
- sed -e 's/v[0-9.]*-\(.*\)/\1/' -e 's/-/_/' | \
- sed -e 's/_g.*$$//'; \
- else echo "release" ; fi)
+RELEASE ?= $(shell if [ -e .git ] ; then git describe --tags --long --match='v*' | sed -e 's/v[0-9.]*-\(.*\)/\1/' -e 's/-/_/' | sed -e 's/_g.*$$//'; else echo "release" ; fi)
endif
DIST_SHA := ${shell if [ -e .git ] ; then git log -n1 --pretty=format:%H ; \