summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 61effa1..365ef23 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,13 @@
NAME = targetcli
GIT_BRANCH = $$(git branch | grep \* | tr -d \*)
-VERSION = $$(basename $$(git describe --tags | tr - . | grep -o '[0-9].*$$'))
+GIT_DESC = $$(basename $$(git describe --tags | grep -o '[0-9].*$$'))
+GIT_LAST_TAG = $$(git describe --tags --abbrev=0 | grep -o '[0-9].*$$')
+GIT_PKG_TAG = $$(echo $(GIT_LAST_TAG) | tr - \~)
+VERSION = $$(echo $(GIT_DESC) | sed s/^$(GIT_LAST_TAG)/$(GIT_PKG_TAG)/)
+
+version:
+ @echo $(VERSION)
all:
@echo "Usage:"
@@ -79,7 +85,7 @@ build/release-stamp:
rmdir rpm
@echo "Generating rpm changelog..."
@( \
- version=$$(basename $$(git describe HEAD --tags | tr - . | grep -o '[0-9].*$$')); \
+ version=$(VERSION); \
author=$$(git show HEAD --format="format:%an <%ae>" -s); \
date=$$(git show HEAD --format="format:%ad" -s \
| awk '{print $$1,$$2,$$3,$$5}'); \
@@ -89,7 +95,7 @@ build/release-stamp:
) >> $$(ls build/${NAME}-${VERSION}/*.spec)
@echo "Generating debian changelog..."
@( \
- version=$$(basename $$(git describe HEAD --tags | tr - . | grep -o '[0-9].*$$')); \
+ version=$(VERSION); \
author=$$(git show HEAD --format="format:%an <%ae>" -s); \
date=$$(git show HEAD --format="format:%aD" -s); \
day=$$(git show HEAD --format='format:%ai' -s \