From 752bf3e39c0f4d362488d3f9e41bd502350bbe79 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Thu, 11 Jan 2018 10:06:21 -0700 Subject: [PATCH] Makefile: handle "beta" Git tags 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 15befa123..14deda16f 100644 --- 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) -- 2.39.5