The following commit has been merged in the master branch:
commit c47dc4b76ded743e4c101cee0691877021c804d4
Author: Goswin von Brederlow <goswin-...@web.de>
Date:   Sat Mar 10 16:23:59 2012 +0100

    Add release target.

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..6da3e3d
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+debian export-ignore
diff --git a/debian/rules b/debian/rules
index 431b2a2..e9496ba 100755
--- a/debian/rules
+++ b/debian/rules
@@ -32,3 +32,38 @@ override_dh_auto_install:
 .PHONY: override_dh_install
 override_dh_install:
        dh_install --fail-missing
+
+# Make a release
+release: SOURCE=$(shell dpkg-parsechangelog | awk '/^Source:/ { print $$2 }')
+release: VERSION=$(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }')
+release: UPSTREAM_VERSION=$(shell VERSION="$(VERSION)"; echo $${VERSION%-*})
+release: DIR=$(shell basename "$$(pwd)")
+release: ORIG_NAME=../$(SOURCE)_$(UPSTREAM_VERSION).orig.tar.gz
+release:
+       @if [ "$(VERSION)" = $(UPSTREAM_VERSION) ]; then                \
+         echo "Error: Missing debian revision in $(VERSION).";         \
+         exit 1;                                                       \
+       fi
+       @if [ -n "$(shell git status --porcelain)" ]; then              \
+         echo "Error: Uncommited changed.";                            \
+         exit 1;                                                       \
+       fi
+       @if [ ! "$(shell git branch)" = "* master" ]; then              \
+         echo "Error: Not in master branch.";                          \
+         exit 1;                                                       \
+       fi
+       @if git tag | grep "^debian/$(VERSION)$$"; then                 \
+         echo "Error: Release $(VERSION) already exists.";             \
+         exit 1;                                                       \
+       fi
+       @if git tag | grep "^upsteam/$(UPSTREAM_VERSION)$$"; then       \
+         echo "Upstream $(UPSTREAM_VERSION) already exists.";          \
+       else                                                            \
+         echo "Creating $(ORIG_NAME) ...";                             \
+         git archive --format=tar.gz --output=$(ORIG_NAME)             \
+                     --prefix=$(SOURCE)-$(UPSTREAM_VERSION)/           \
+                     --worktree-attributes HEAD;                       \
+         git-import-orig --no-merge --pristine-tar $(ORIG_NAME);       \
+       fi
+       @echo "Tagging release debian/$(VERSION)"
+       @git tag "debian/$(VERSION)"

-- 
libaio-ocaml packaging

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to