diff options
Diffstat (limited to 'Makefile')
| -rwxr-xr-x | Makefile | 32 |
1 files changed, 13 insertions, 19 deletions
@@ -4,24 +4,18 @@ # location of rpm source files. We use dist automatically # created by python distutils command DISTDIR = ./dist -# determine current package version -RELEASE = $(shell git describe --tags --dirty --always) -TARFILE = $(DISTDIR)/$(RELEASE).tar.bz2 -PREFIX = $(shell echo $(RELEASE) | cut -d '-' -f 1) -GITVERSION = $(shell echo $(RELEASE) | cut -d '-' -f 2-) +GITVERSION = $(shell git describe --tags --dirty --always) +PREFIX = $(shell echo $(GITVERSION) | cut -d '-' -f 1) SPECFILE = $(DISTDIR)/python-$(PREFIX).spec -# -# Replace '-' with '_' in version to be rpm compatible -# This version is used in the spec file for the rpm -# version. The rpm version string will be different from -# the actual package version string. This will only be the -# case for git snapshot releases. Official releases based -# on git tagged version will have matching program/rpm version -# strings. -VERSION = $(shell echo $(GITVERSION) | tr '-' '_') +VERSION = $(shell python3 setup.py --version) +TARFILE = $(DISTDIR)/$(VERSION).tar.bz2 .PHONY : clean +python = /usr/bin/python3 + +.PHONY: all test clean + all: $(SPECFILE) info: @@ -35,16 +29,16 @@ changelog: git log > ChangeLog $(TARFILE): changelog - python setup.py sdist --formats=bztar + $(python) setup.py sdist --formats=bztar $(SPECFILE): $(TARFILE) - cat ./spec/python-obsapi.spec.tmpl | sed "s/__version__/$(VERSION)/g" | sed "s/__gitversion__/$(GITVERSION)/g" > $(SPECFILE) + cat ./spec/python-obsapi.spec.tmpl | sed "s/__version__/$(VERSION)/g" > $(SPECFILE) install: - python setup.py install --verbose + $(python) setup.py install --verbose uninstall: - python setup.py uninstall --verbose + $(python) setup.py uninstall --verbose test: - python setup.py test + $(python) setup.py test |
