From 85b458d90dd67f75b5d0fad6d50488f1348a3983 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 13 Jun 2013 12:05:10 +0200 Subject: Makefile: source dracut-version.sh and correct dist tarball --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 846c5db7..d383acf7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ -RELEASEDVERSION = -- will be replaced by "make dist" -- -VERSION = $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(RELEASEDVERSION)) -GITVERSION = $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); echo -$${v\#*-}; } ) +-include dracut-version.sh + +VERSION = $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION)) +GITVERSION = $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } ) -include Makefile.inc @@ -158,11 +159,11 @@ clean: dist: dracut-$(VERSION).tar.bz2 dracut-$(VERSION).tar.bz2: doc + @echo "DRACUT_VERSION=$(VERSION)" > dracut-version.sh git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar mkdir -p dracut-$(VERSION) - cp $(manpages) dracut.html dracut-$(VERSION) - git show $(VERSION):Makefile | sed 's/^RELEASEDVERSION =.*/RELEASEDVERSION = $(VERSION)/' > dracut-$(VERSION)/Makefile - tar --owner=root --group=root -rf dracut-$(VERSION).tar dracut-$(VERSION)/*.[0-9] dracut-$(VERSION)/dracut.html dracut-$(VERSION)/Makefile + for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(VERSION)/$${i%/*}"; cp "$$i" "dracut-$(VERSION)/$$i"; done + tar --owner=root --group=root -rf dracut-$(VERSION).tar $$(find dracut-$(VERSION) -type f) rm -fr dracut-$(VERSION).tar.bz2 dracut-$(VERSION) bzip2 -9 dracut-$(VERSION).tar rm -f dracut-$(VERSION).tar -- cgit v1.2.3