[Pkg-ocaml-maint-commits] [SCM] libaio-ocaml packaging branch, master, updated. 8171635097ecb5ce0fbc33ec2b5f8a5b3d969e43

Goswin von Brederlow goswin-v-b at web.de
Sat Mar 10 15:35:54 UTC 2012


The following commit has been merged in the master branch:
commit c47dc4b76ded743e4c101cee0691877021c804d4
Author: Goswin von Brederlow <goswin-v-b at 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



More information about the Pkg-ocaml-maint-commits mailing list