lorax/Makefile
Martin Gracik 73fc20b165 Write the lorax verion in the .buildstamp (#689697)
(cherry picked from commit 4271e0fc02)

Conflicts:
	src/pylorax/buildstamp.py

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-10-24 16:07:25 -04:00

38 lines
1.0 KiB
Makefile

PYTHON ?= /usr/bin/env python
DESTDIR ?= /
PKGNAME = lorax
VERSION = $(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec)
RELEASE = $(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g')
TAG = r$(VERSION)-$(RELEASE)
default: all
all:
$(PYTHON) setup.py build
install: all
@echo "num = '$(VERSION)-$(RELEASE)'" > src/pylorax/version.py
$(PYTHON) setup.py install --root=$(DESTDIR)
clean:
-rm -rf build
tag:
git tag -f $(TAG)
archive: tag
@git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ $(TAG) > $(PKGNAME)-$(VERSION).tar
@bzip2 $(PKGNAME)-$(VERSION).tar
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.bz2"
local:
@rm -rf $(PKGNAME)-$(VERSION).tar.bz2
@rm -rf /tmp/$(PKGNAME)-$(VERSION)
@dir=$$PWD; cp -a $$dir /tmp/$(PKGNAME)-$(VERSION)
@rm -rf /tmp/$(PKGNAME)-$(VERSION)/.git
@dir=$$PWD; cd /tmp; tar --bzip2 -cSpf $$dir/$(PKGNAME)-$(VERSION).tar.bz2 $(PKGNAME)-$(VERSION)
@rm -rf /tmp/$(PKGNAME)-$(VERSION)
@echo "The archive is in $(PKGNAME)-$(VERSION).tar.bz2"