From: Frantisek Hrbata Date: Tue, 22 Dec 2020 11:13:26 +0000 (+0100) Subject: make: define RELEASE and VERSION variables X-Git-Tag: v0.2~5 X-Git-Url: http://www.hrbata.com/gitweb/?a=commitdiff_plain;h=f0540271c4973bd12abbe7675f615ee1c0439121;p=gimrr.git make: define RELEASE and VERSION variables Add RELEASE and VERSION so we can use them instead of values hardcoded in gimrr.spec. Signed-off-by: Frantisek Hrbata --- diff --git a/Makefile b/Makefile index d88ce56..1815b3e 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +VERSION = 0.2 +RELEASE = 1 + .PHONY: clean rpm doc man html install uninstall clean_man clean_html help all: help @@ -83,7 +86,9 @@ clean_html: RPM_TOP_DIR = $(CURDIR)/rpmbuild rpm: mkdir -p $(RPM_TOP_DIR)/{BUILD,RPMS,SPECS,SRPMS} - $(RPMBUILD) -bb --build-in-place --define "_topdir $(RPM_TOP_DIR)" gimrr.spec + $(INSTALL) -m 644 gimrr.spec $(RPM_TOP_DIR)/SPECS/gimrr.spec + sed -i s'/%%VERSION%%/$(VERSION)/;s/%%RELEASE%%/$(RELEASE)/' $(RPM_TOP_DIR)/SPECS/gimrr.spec + $(RPMBUILD) -bb --build-in-place --define "_topdir $(RPM_TOP_DIR)" $(RPM_TOP_DIR)/SPECS/gimrr.spec doc: man html