[med-svn] [phipack] 03/05: Add get-orig-source script
Andreas Tille
tille at debian.org
Thu Jun 23 14:06:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository phipack.
commit 0ad53ae6d8d85ce560d609755103359322c5067c
Author: Andreas Tille <tille at debian.org>
Date: Thu Jun 23 16:02:29 2016 +0200
Add get-orig-source script
---
debian/get-orig-source | 42 ++++++++++++++++++++++++++++++++++++++++++
debian/rules | 2 ++
2 files changed, 44 insertions(+)
diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755
index 0000000..95df957
--- /dev/null
+++ b/debian/get-orig-source
@@ -0,0 +1,42 @@
+#!/bin/sh -e
+
+# Its obviously not reliable to do the versioning based on the date given in file
+# http://www.netlib.org/f2c/src/version.c
+#
+# This script downloads the ZIP archive and defines the Version as the time stamp
+# of the youngest file inside the archive
+
+COMPRESS=xz
+
+NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
+OVERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | sed 's/\([0-9\.]\+\)-[0-9]\+$/\1/'`
+
+mkdir -p ../tarballs
+cd ../tarballs
+
+wget --quiet -N http://www.maths.otago.ac.nz/~dbryant/software/PhiPack.tar.gz
+
+tar xaf ../PhiPack.tar.gz
+rm -f ._PhiPack
+mv PhiPack ${NAME}
+cd ${NAME}
+
+find . -name "._*" -delete
+find . -name "*~" -delete
+find . -name ".DS_Store" -delete
+find . -name "_notes" -type d | xargs -r rm -rf
+VERSION=0.0.`ls -lArt --time-style=+"%Y%m%d" | tail -n 1 | cut -f7 -d" "`
+
+if [ "$OVERSION" = "$VERSION" ] ; then
+ echo "No new version of $NAME available."
+ exit 0
+fi
+
+find . -type f -exec chmod -x \{\} \;
+
+cd ..
+
+TARDIR=${NAME}-${VERSION}
+mv ${NAME} ${TARDIR}
+GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.${COMPRESS} "${TARDIR}"
+rm -rf ${TARDIR}
diff --git a/debian/rules b/debian/rules
index 64e8665..d49e89f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,3 +7,5 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@ --sourcedirectory=src
+get-orig-source:
+ . debian/get-orig-source
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/phipack.git
More information about the debian-med-commit
mailing list