# # generate rpm package source from current git branch # # location of rpm source files. We use dist automatically # created by python distutils command DISTDIR = ./dist GITVERSION = $(shell git describe --tags --dirty --always) PREFIX = $(shell echo $(GITVERSION) | cut -d '-' -f 1) SPECFILE = $(DISTDIR)/python-$(PREFIX).spec VERSION = $(shell python3 setup.py --version) TARFILE = $(DISTDIR)/$(VERSION).tar.bz2 .PHONY : clean python = /usr/bin/python3 .PHONY: all test clean all: $(SPECFILE) info: echo $(TARFILE) clean: rm -f $(DISTDIR)/*.tar.bz2 rm -f $(SPECFILE) changelog: git log > ChangeLog $(TARFILE): changelog $(python) setup.py sdist --formats=bztar $(SPECFILE): $(TARFILE) cat ./spec/python-obsapi.spec.tmpl | sed "s/__version__/$(VERSION)/g" > $(SPECFILE) install: $(python) setup.py install --verbose uninstall: $(python) setup.py uninstall --verbose test: $(python) setup.py test