[PATCH 08/13] Add scratch, scratch-bumpver and rc-release targets.

David Lehman dlehman at redhat.com
Wed May 27 18:16:09 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

Use these make targets for creating scratch rc builds that can be used
before an official release. rc-release will run scratch-bumpver to bump
the version and add a rc release with the current date and time to the
specfile.  scratch is then run to create the tar.gz file and then mock
is used to build a rc rpm package.

No changes are committed to git, no zanata account is required and
nothing is pushed to zanata.

(cherry picked from commit a352382e24ff8d3add1ae6c9076ccd12cbf9f7d1)
---
 Makefile | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/Makefile b/Makefile
index f62771d..6d50550 100644
--- a/Makefile
+++ b/Makefile
@@ -2,12 +2,15 @@ PKGNAME=blivet
 SPECFILE=python-blivet.spec
 VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE))
 RELEASE=$(shell awk '/Release:/ { print $$2 }' $(SPECFILE) | sed -e 's|%.*$$||g')
+RC_RELEASE ?= $(shell date -u +0.1.%Y%m%d%H%M%S)
 RELEASE_TAG=$(PKGNAME)-$(VERSION)-$(RELEASE)
 VERSION_TAG=$(PKGNAME)-$(VERSION)
 
 ZANATA_PULL_ARGS = --transdir ./po/
 ZANATA_PUSH_ARGS = --srcdir ./po/ --push-type source --force
 
+MOCKCHROOT ?= fedora-rawhide-x86_64
+
 all:
 	$(MAKE) -C po
 
@@ -101,4 +104,37 @@ bumpver: po-pull
 	make -C po $(PKGNAME).pot ; \
 	zanata push $(ZANATA_PUSH_ARGS)
 
+scratch-bumpver: po-empty
+	@opts="-n $(PKGNAME) -v $(VERSION) -r $(RELEASE) --newrelease $(RC_RELEASE)" ; \
+	if [ ! -z "$(IGNORE)" ]; then \
+		opts="$${opts} -i $(IGNORE)" ; \
+	fi ; \
+	if [ ! -z "$(MAP)" ]; then \
+		opts="$${opts} -m $(MAP)" ; \
+	fi ; \
+	if [ ! -z "$(SKIP_ACKS)" ]; then \
+		opts="$${opts} -s" ; \
+	fi ; \
+	if [ ! -z "$(BZDEBUG)" ]; then \
+		opts="$${opts} -d" ; \
+	fi ; \
+	( scripts/makebumpver $${opts} ) || exit 1 ;
+
+scratch: po-empty
+	@rm -f ChangeLog
+	@make ChangeLog
+	@rm -rf $(PKGNAME)-$(VERSION).tar.gz
+	@rm -rf /tmp/$(PKGNAME)-$(VERSION) /tmp/$(PKGNAME)
+	@dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
+	@cd /tmp/$(PKGNAME)-$(VERSION) ; python setup.py -q sdist
+	@cp /tmp/$(PKGNAME)-$(VERSION)/dist/$(PKGNAME)-$(VERSION).tar.gz .
+	@rm -rf /tmp/$(PKGNAME)-$(VERSION)
+	@echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz"
+
+rc-release: scratch-bumpver scratch
+	mock -r $(MOCKCHROOT) --buildsrpm  --spec ./$(SPECFILE) --sources . || exit 1
+	cp /var/lib/mock/$(MOCKCHROOT)/result/*src.rpm . || exit 1
+	mock -r $(MOCKCHROOT) --rebuild *src.rpm || exit 1
+	cp /var/lib/mock/$(MOCKCHROOT)/result/*.rpm . || exit 1
+
 .PHONY: check clean install tag archive local
-- 
2.1.0



More information about the anaconda-patches mailing list