summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSerge van Ginderachter <serge@vanginderachter.be>2014-08-06 13:00:14 +0200
committerSerge van Ginderachter <serge@vanginderachter.be>2014-08-06 15:08:55 +0200
commitdf8dfdce06f837c49f230d5e27b513f2bfe27cf1 (patch)
treef56033cda023d3ebcda93f3a2bdfaa739662ef33 /Makefile
parentMerge pull request #8455 from nicocesar/version_check (diff)
downloadansible-df8dfdce06f837c49f230d5e27b513f2bfe27cf1.tar.xz
ansible-df8dfdce06f837c49f230d5e27b513f2bfe27cf1.zip
packaging: add short has and branch name in package version for unofficial builds
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index afd7162f96..56c63903b6 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,11 @@ VERSION := $(shell cat VERSION)
# Get the branch information from git
ifneq ($(shell which git),)
GIT_DATE := $(shell git log -n 1 --format="%ai")
+GIT_HASH := $(shell git log -n 1 --format="%h")
+GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/[-_.]//g')
+GITINFO = .$(GIT_HASH).$(GIT_BRANCH)
+else
+GITINFO = ''
endif
ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD'),1)
@@ -60,7 +65,7 @@ ifeq ($(OFFICIAL),yes)
DEBUILD_OPTS += -k$(DEBSIGN_KEYID)
endif
else
- DEB_RELEASE = 0.git$(DATE)
+ DEB_RELEASE = 0.git$(DATE)$(GITINFO)
# Do not sign unofficial builds
DEBUILD_OPTS += -uc -us
DPUT_OPTS += -u
@@ -76,7 +81,7 @@ RPMSPEC = $(RPMSPECDIR)/ansible.spec
RPMDIST = $(shell rpm --eval '%{?dist}')
RPMRELEASE = 1
ifneq ($(OFFICIAL),yes)
- RPMRELEASE = 0.git$(DATE)
+ RPMRELEASE = 0.git$(DATE)$(GITINFO)
endif
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"