From 9c533a517f06ef61a77b95cfc4abbc644e91e897 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Thu, 2 Dec 2010 13:36:22 +0100 Subject: [PATCH] Update Makefile --- Makefile | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index eab25a91..e5402904 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,35 @@ PYTHON ?= /usr/bin/env python +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: - $(PYTHON) setup.py install +install: all + $(PYTHON) setup.py install --root=$(DESTDIR) clean: -rm -rf build -testlocal: - /usr/bin/lorax -p FEDORA -v RAWHIDE -r 2010 -s /rawrepo /root/rawhide +tag: + git tag -f $(TAG) -test: - /usr/bin/lorax -p FEDORA -v RAWHIDE -r 2010 -s http://download.englab.brq.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/ /root/rawhide +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) /tmp/$(PKGNAME) + @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"