[master 3/3] Add scratch, scratch-bumpver and rc-release targets.
bcl
installerbot-noreply at redhat.com
Fri Mar 6 16:22:20 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.
---
Makefile | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/Makefile b/Makefile
index 86edd5f..8c6f501 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
@@ -103,4 +106,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
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/7d88d158abd337c5303fe024b75c80ed836389e5
More information about the anaconda-patches
mailing list