# A "git describe" value of "v2.2.0" creates an NVR
# "ceph-ansible-2.2.0-1.el8"
+DIST ?= "el8"
+MOCK_CONFIG ?= "epel-7-x86_64"
TAG := $(shell git describe --tags --abbrev=0 --match 'v*')
VERSION := $(shell echo $(TAG) | sed 's/^v//')
COMMIT := $(shell git rev-parse HEAD)
$(error cannot translate Git tag version $(VERSION) to an RPM NVR)
endif
-NVR := $(NAME)-$(VERSION)-$(RELEASE).el8
+NVR := $(NAME)-$(VERSION)-$(RELEASE).$(DIST)
all: srpm
--define "_topdir ." \
--define "_sourcedir ." \
--define "_srcrpmdir ." \
- --define "dist .el8"
+ --define "dist .$(DIST)"
rpm: dist srpm
- mock -r epel-7-x86_64 rebuild $(NVR).src.rpm \
+ mock -r $(MOCK_CONFIG) rebuild $(NVR).src.rpm \
--resultdir=. \
- --define "dist .el8"
+ --define "dist .$(DIST)"
tag:
$(eval BRANCH := $(shell git rev-parse --abbrev-ref HEAD))