Updated make file to automatically detect if commit is tagged

This commit is contained in:
Trial97
2020-02-13 13:48:11 +02:00
committed by Dan Christian Bogos
parent 89371d718b
commit 88b6c38a59

View File

@@ -1,4 +1,12 @@
DISTRIBUTION ?= stable
GIT_TAG_LOG=$(shell git tag -l --points-at HEAD)
DISTRIBUTION ?= nightly
ifneq ($(GIT_TAG_LOG),)
DISTRIBUTION := stable
endif
GIT_COMMIT=$(shell git log -n1 --format=format:%h)
GIT_DATE=$(shell date +%Y%m%d%H%M%S --date="@$(shell git log -n1 --format=format:%ct)")
@@ -19,9 +27,11 @@ ifeq ($(DEBIAN_VERSION),)
exit 1
endif
DEBIAN_PKG_VERSION=$(DEBIAN_VERSION)
DEBIAN_PKG_VERSION=$(DEBIAN_VERSION)+$(GIT_DATE)+$(GIT_COMMIT)
DEBIAN_PKG_VERSION_WITH_HASH=$(DEBIAN_VERSION)+$(GIT_DATE)+$(GIT_COMMIT)
ifneq ($(GIT_TAG_LOG),)
DEBIAN_PKG_VERSION=$(DEBIAN_VERSION)
endif
deb:
cd ..;\
@@ -31,13 +41,4 @@ deb:
rm debian
git checkout debian/changelog
deb_hash:
cd ..;\
ln -sf packages/debian debian ;\
dch -v "$(DEBIAN_PKG_VERSION_WITH_HASH)" -m "Package build for git commit $(GIT_COMMIT) ($(GIT_DATE))." -D "$(DISTRIBUTION)" --force-distribution ;\
dpkg-buildpackage -rfakeroot -tc; \
rm debian
git checkout debian/changelog
.PHONY: deb squeeze
.PHONY: deb