summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoan Touzet <joant@atypical.net>2017-11-07 04:16:27 -0500
committerJan Lehnardt <jan@apache.org>2018-02-13 14:30:50 +0100
commitd35f00aae7f32a97988e5dac4c37de7030c74a0d (patch)
treebbfa5827c8f8b2e2522724f86fd1b6b6a753f007
parent3b53c1c92af6dc774995fd8f1009d1306248477c (diff)
downloadcouchdb-d35f00aae7f32a97988e5dac4c37de7030c74a0d.tar.gz
Simplify make dist approach
-rw-r--r--.gitignore4
-rw-r--r--Makefile13
2 files changed, 14 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 3e2219239..be121600c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,9 @@
*.o
-*.pyc
+*.sha256
+*.sha512
*.snap
*.so
+*.pyc
.DS_Store
.rebar/
.eunit/
diff --git a/Makefile b/Makefile
index bd3b8ac58..ed8fc63fc 100644
--- a/Makefile
+++ b/Makefile
@@ -14,8 +14,17 @@ include version.mk
REBAR?=$(shell echo `pwd`/bin/rebar)
IN_RELEASE = $(shell if [ ! -d .git ]; then echo true; fi)
-COUCHDB_VERSION_SUFFIX = $(shell if [ ! -z "$(COUCH_RC)" ]; then echo '-RC$(COUCH_RC)'; else if [ -d .git ]; then echo '-`git rev-parse --short --verify HEAD`'; fi; fi)
-COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)$(COUCHDB_VERSION_SUFFIX)
+ifeq ($(IN_RELEASE), true)
+COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)
+else
+RELTAG = $(shell git describe | grep -E '^[0-9]+\.[0-9]\.[0-9]+(-RC[0-9]+)?$$')
+ifeq ($(RELTAG),)
+COUCHDB_VERSION_SUFFIX = $(shell git rev-parse --short --verify HEAD)
+COUCHDB_VERSION = $(vsn_major).$(vsn_minor).$(vsn_patch)-$(COUCHDB_VERSION_SUFFIX)
+else
+COUCHDB_VERSION = $(RELTAG)
+endif
+endif
DESTDIR=