From d3766b1be75c914e3453e0a3558a8bf968b537ae Mon Sep 17 00:00:00 2001 From: Jeff Moyer Date: Mar 06 2018 22:22:46 +0000 Subject: Makefile: convert tag and archive targets to git In the process, change the tag format to not include the release. The release portion is meant for distributers to bump when packaging changes are made; it shouldn't be used for the upstream sources. There's also no need to convert ',' to '-' in the tag. Signed-off-by: Jeff Moyer --- diff --git a/Makefile b/Makefile index 4cedbc9..e9dbdb0 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ NAME=libaio SPECFILE=$(NAME).spec VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE)) -RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE)) -CVSTAG = $(NAME)_$(subst .,-,$(VERSION))_$(subst .,-,$(RELEASE)) +TAG = $(NAME)-$(VERSION) RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm") prefix=/usr @@ -28,17 +27,10 @@ clean: @$(MAKE) -C harness clean tag-archive: - @cvs -Q tag -F $(CVSTAG) - -create-archive: tag-archive - @rm -rf /tmp/$(NAME) - @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) $(NAME) || echo GRRRrrrrr -- ignore [export aborted] - @mv /tmp/$(NAME) /tmp/$(NAME)-$(VERSION) - @cd /tmp; tar czSpf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) - @rm -rf /tmp/$(NAME)-$(VERSION) - @cp /tmp/$(NAME)-$(VERSION).tar.gz . - @rm -f /tmp/$(NAME)-$(VERSION).tar.gz - @echo " " + @git tag $(TAG) + +create-archive: + @git archive --prefix=$(NAME)-$(VERSION)/ -o $(NAME)-$(VERSION).tar.gz $(TAG) @echo "The final archive is ./$(NAME)-$(VERSION).tar.gz." archive: clean tag-archive create-archive