[osmium] 05/09: Add get-orig-source target to create tarball from upstream git repository.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Wed Apr 29 19:56:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository osmium.

commit 19ae70772e314fd5f15a1443eed22c44621e30eb
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Wed Apr 29 21:45:24 2015 +0200

    Add get-orig-source target to create tarball from upstream git repository.
---
 debian/changelog       |  1 +
 debian/get-orig-source | 19 +++++++++++++++++++
 debian/rules           |  3 +++
 3 files changed, 23 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index eeed2b8..5edabaa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ osmium (0.0~20140910-9a069af-2) UNRELEASED; urgency=medium
   * Update Vcs-Browser URL to use cgit instead of gitweb.
   * Bump Standards-Version to 3.9.6, no changes.
   * Update Homepage URL for page move.
+  * Add get-orig-source target to create tarball from upstream git repository.
 
  -- Bas Couwenberg <sebastic at debian.org>  Fri, 28 Nov 2014 21:58:10 +0100
 
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..a6ecd09
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+REMOTE=upstream
+BRANCH=${REMOTE}/master
+
+if [ $(git remote show ${REMOTE} | wc -l) -eq 0 ]; then
+	git remote add ${REMOTE} https://github.com/joto/osmium.git
+fi
+
+git fetch ${REMOTE} --no-tags
+
+PACKAGE=$(dpkg-parsechangelog | grep ^Source: | awk '{print $2}')
+
+COMMIT=$(git log -n1 --format=format:%h ${BRANCH})
+DATE=$(date +%Y%m%d --date="@$(git log -n1 --format=format:%ct ${BRANCH})")
+
+VERSION="0.0~${DATE}-${COMMIT}"
+
+git archive --format=tar.gz --prefix=${PACKAGE}-${VERSION}/ -o ../${PACKAGE}_${VERSION}.orig.tar.gz ${BRANCH}
diff --git a/debian/rules b/debian/rules
index db84138..2b6ed0a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,3 +26,6 @@ override_dh_auto_install:
 override_dh_install:
 	dh_install --list-missing
 
+get-orig-source:
+	. debian/get-orig-source
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmium.git



More information about the Pkg-grass-devel mailing list