From f0540271c4973bd12abbe7675f615ee1c0439121 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Tue, 22 Dec 2020 12:13:26 +0100 Subject: [PATCH] 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 --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 1.7.10.4