]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Makefile: handle "beta" Git tags
authorKen Dreyer <kdreyer@redhat.com>
Thu, 11 Jan 2018 17:06:21 +0000 (10:06 -0700)
committerSébastien Han <seb@redhat.com>
Fri, 12 Jan 2018 13:45:19 +0000 (14:45 +0100)
With this change, "make srpm" will generate an RPM with "beta" in the
Release value.

For example, "v3.2.0beta1" will create
"ceph-ansible-3.2.0-0.beta1.1.el7.src.rpm"

Makefile

index 15befa12307f8d55393a6826677633a0db1d42d0..14deda16f2494d72b54b66e5b1b6014cc6c5e0e5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,9 @@ NAME = ceph-ansible
 # Set the RPM package NVR from "git describe".
 # Examples:
 #
+#  A "git describe" value of "v2.2.0beta1" would create an NVR
+#  "ceph-ansible-2.2.0-0.beta1.1.el7"
+#
 #  A "git describe" value of "v2.2.0rc1" would create an NVR
 #  "ceph-ansible-2.2.0-0.rc1.1.el7"
 #
@@ -25,6 +28,11 @@ RELEASE := $(shell git describe --tags --match 'v*' \
 ifeq ($(VERSION),$(RELEASE))
   RELEASE = 1
 endif
+ifneq (,$(findstring beta,$(VERSION)))
+    BETA := $(shell echo $(VERSION) | sed 's/.*beta/beta/')
+    RELEASE := 0.$(BETA).$(RELEASE)
+    VERSION := $(subst $(BETA),,$(VERSION))
+endif
 ifneq (,$(findstring rc,$(VERSION)))
     RC := $(shell echo $(VERSION) | sed 's/.*rc/rc/')
     RELEASE := 0.$(RC).$(RELEASE)