From 0c01e74470a1b467a9814fef979fe77fd3aeb0c4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Dec 2012 10:28:18 -0800 Subject: Add the necessary files to create a package with git archive Change-Id: Ice29268ab455d14deb793440431be94f2a80f187 Reviewed-by: Lars Knoll --- .gitattributes | 3 +++ .tag | 1 + Makefile | 12 +++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 .tag diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..018cf2c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +.tag export-subst +.gitignore export-ignore +.gitattributes export-ignore diff --git a/.tag b/.tag new file mode 100644 index 0000000..6828f88 --- /dev/null +++ b/.tag @@ -0,0 +1 @@ +$Format:%H$ diff --git a/Makefile b/Makefile index 7f8eaf4..1b93597 100644 --- a/Makefile +++ b/Makefile @@ -60,4 +60,14 @@ check: tests/auto/Makefile cd src/qtchooser && $(MAKE) check cd tests/auto && $(MAKE) check -.PHONY: all install uninstall check clean distclean +dist: .git + @ \ + { rev=$$(git describe --tags HEAD 2>/dev/null) && \ + name=qtchooser-$${rev#v}; } || \ + { rev=$$(git rev-parse --short HEAD) && \ + name=qtchooser-$$(git rev-list HEAD | wc -l)-g$$rev; } && \ + echo "Creating package $$name" >&2 && \ + git archive --prefix="$$name/" -9 --format=tar.gz -o $$name.tar.gz $$rev && \ + git archive --prefix="$$name/" -9 --format=zip -v -o $$name.zip $$rev + +.PHONY: all install uninstall check clean distclean dist -- cgit v1.2.3