Skip to content

Commit

Permalink
Add scratch, scratch-bumpver and rc-release targets.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bcl authored and mulkieran committed Mar 27, 2015
1 parent 7917d7f commit 0daaaf4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Makefile
Expand Up @@ -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

Expand Down Expand Up @@ -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

0 comments on commit 0daaaf4

Please sign in to comment.