[pyevolve] 55/81: Reimplement get-orig-source using SVN helper script
Christian Kastner
chrisk-guest at moszumanska.debian.org
Sun Aug 17 21:12:43 UTC 2014
This is an automated email from the git hooks/post-receive script.
chrisk-guest pushed a commit to branch master
in repository pyevolve.
commit 7499dd905186b8519ab95a05dc77ae8ebd39794f
Author: Christian Kastner <debian at kvr.at>
Date: Wed Jun 1 01:49:49 2011 +0200
Reimplement get-orig-source using SVN helper script
---
debian/rules | 14 +++++++++++++
debian/svn-orig-source.sh | 52 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
diff --git a/debian/rules b/debian/rules
index b069fab..8f76e0f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,17 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+# For svn-orig-source.sh
+PKGDIR = $(dir $(firstword $(MAKEFILE_LIST)))
+UPNAME = $(shell dpkg-parsechangelog -l$(PKGDIR)/changelog | \
+ sed -nre 's,^Source:\s+(.*),\1,p')
+UPVER = $(shell dpkg-parsechangelog -l$(PKGDIR)/changelog | \
+ sed -nre 's,^Version:\s+(.*)\+svn([0-9]+)\+dfsg-.*,\1,p')
+SVNREV = $(shell dpkg-parsechangelog -l$(PKGDIR)/changelog | \
+ sed -nre 's,^Version:\s+(.*)\+svn([0-9]+)\+dfsg-.*,\2,p')
+SVNURL = https://pyevolve.svn.sourceforge.net/svnroot/pyevolve/trunk/
+export UPNAME UPVER SVNURL SVNREV
+
%:
dh $@
@@ -35,3 +46,6 @@ override_dh_auto_install:
# Don't compress sphinx's javascript and Python example files
override_dh_compress:
dh_compress -X.js -X.py
+
+get-orig-source:
+ sh $(PKGDIR)/svn-orig-source.sh
diff --git a/debian/svn-orig-source.sh b/debian/svn-orig-source.sh
new file mode 100755
index 0000000..1bf0e43
--- /dev/null
+++ b/debian/svn-orig-source.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+set -e
+
+# Usage: set the following ENVVARs
+# UPNAME upstream source name
+# UPVER upstream version
+# SVNURL URL to svn repo
+# SVNREV svn revision
+
+workdir=`pwd`
+cleanfile=`dirname $0`/dfsg.remove
+
+if ! which svn >/dev/null
+then
+ echo "Error: subversion must be installed for this to work" >&2
+ exit 1
+fi
+
+for reqvar in UPNAME UPVER SVNURL SVNREV
+do
+ if [ -z "`eval echo '$'$reqvar`" ]
+ then
+ echo "Error: \$$reqvar is not set" >&2
+ exit 1
+ fi
+done
+
+tmpdir=`mktemp -d`
+cd $tmpdir
+
+if ! svn export -q -r $SVNREV $SVNURL $UPNAME-$UPVER.orig
+then
+ rm -rf $tmpdir
+ exit 1
+fi
+
+# Clean up a bit
+while read rmpattern
+do
+ rm -rf $UPNAME-$UPVER.orig/$rmpattern
+done < $cleanfile
+
+if ! GZIP="-9" tar --owner=root --group=root --mode=a+rX \
+ -czf orig.tar.gz $UPNAME-$UPVER.orig
+then
+ rm -rf $tmpdir
+ exit 1
+else
+ mv orig.tar.gz $workdir/${UPNAME}_${UPVER}+svn${SVNREV}.orig.tar.gz
+fi
+
+rm -rf $tmpdir
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyevolve.git
More information about the debian-science-commits
mailing list