[hdf5] 03/11: Update watch file to download the documentation.

Gilles Filippini pini at moszumanska.debian.org
Sun Feb 16 23:11:30 UTC 2014


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

pini pushed a commit to branch master
in repository hdf5.

commit ecfba0fa70f73e32779944d1a2c221fe180f61e0
Author: Gilles Filippini <pini at debian.org>
Date:   Sun Feb 16 02:08:31 2014 +0100

    Update watch file to download the documentation.
---
 debian/orig-tar.exclude | 12 ++++++++++++
 debian/orig-tar.sh      | 39 +++++++++++++++++++++++++++++++++++++++
 debian/pack-hdf5docs.sh | 27 ---------------------------
 debian/watch            |  4 ++--
 4 files changed, 53 insertions(+), 29 deletions(-)

diff --git a/debian/orig-tar.exclude b/debian/orig-tar.exclude
new file mode 100644
index 0000000..a92099f
--- /dev/null
+++ b/debian/orig-tar.exclude
@@ -0,0 +1,12 @@
+html/PSandPDF
+html/Specifications
+html/HL/Examples
+html/Specs.html
+html/Makefile.*
+html/*/Makefile.*
+html/*/*/Makefile.*
+html/*/*/*/Makefile.*
+html/*/*/*/*/Makefile.*
+html/*/*/*/*/*/Makefile.*
+*.pdf
+*.PDF
diff --git a/debian/orig-tar.sh b/debian/orig-tar.sh
new file mode 100755
index 0000000..5802d80
--- /dev/null
+++ b/debian/orig-tar.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+# Called from uscan with parameters:
+# --upstream-version <release> <path-to-upstream.orig.tar.gz>
+#
+# Require svn and php
+set -e
+
+UPSTREAM_VERSION="$2"
+UPSTREAM_VERSION_DOC="$UPSTREAM_VERSION+docs"
+PACKAGE=$(basename "$3" "_$UPSTREAM_VERSION.orig.tar.gz")
+
+SOURCE_DIR="$PACKAGE-$UPSTREAM_VERSION"
+DEBIAN_SOURCE_DIR="$PACKAGE-$UPSTREAM_VERSION_DOC"
+TAR="../${PACKAGE}_$UPSTREAM_VERSION_DOC.orig.tar.gz"
+HTML_DIR="$DEBIAN_SOURCE_DIR/html"
+
+# extract the upstream archive
+tar xf $3
+
+# get docs
+/usr/bin/svn export https://svn.hdfgroup.uiuc.edu/hdf5doc/branches/hdf5_"$(echo "$UPSTREAM_VERSION" | sed 's/\./_/g')"/html "$SOURCE_DIR/html"
+
+# rename upstream source dir
+# excluding files matched by debian/orig-tar.exclude
+tar c -X debian/orig-tar.exclude "$SOURCE_DIR" | tar x --transform "s,^$SOURCE_DIR,$DEBIAN_SOURCE_DIR,"
+
+# remove empty directories
+find "$HTML_DIR" -type d -empty -delete
+# process php in html files
+find "$HTML_DIR"/ -type f -iname '*.html' \
+  -execdir /bin/sh -c "/usr/bin/php -f '{}' > '{}.new'" \; \
+  -exec mv "{}.new" "{}" \;
+
+# repack into orig.tar.gz
+# excluding files matched by debian/orig-tar.exclude
+tar -c -z -f "$TAR" -X debian/orig-tar.exclude "$DEBIAN_SOURCE_DIR/"
+rm -rf "$SOURCE_DIR" "$DEBIAN_SOURCE_DIR"
+
+echo "$PACKAGE: downloaded docs and renamed archive to $(basename "$TAR")"
diff --git a/debian/pack-hdf5docs.sh b/debian/pack-hdf5docs.sh
deleted file mode 100644
index 2c4a4f6..0000000
--- a/debian/pack-hdf5docs.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-# requires svn and php
-
-BRANCH_VERSION=$(dpkg-parsechangelog | sed -rne 's,^Version: (\w)\.(\w)\.(\w)(.+),\1_\2_\3,p')
-BRANCH_VERSION_FORMAT=$(dpkg-parsechangelog | sed -rne 's,^Version: (\w)\.(\w)\.(\w)(.+),\1.\2.\3,p')
-
-svn export https://svn.hdfgroup.uiuc.edu/hdf5doc/branches/hdf5_$BRANCH_VERSION/html
-
-find html -name 'Makefile.*' -delete
-rm -rf html/PSandPDF html/Specifications
-rm -f html/HL/Examples/* html/Specs.html
-#rm -f html/RM/Tools/h5check.htm html/RM/Tools/h5fix_swapped_ids.htm html/RM/CollectiveCalls.html
-
-HTML_FILES=$(find html/ -iname '*.html')
-for f in $HTML_FILES; do
-	echo "processing $f...";\
-	php -f $f > $f.new;\
-	rm $f;\
-	mv $f.new $f;\
-done
-
-#rm -rf html/RM/Tools html/RM/H5 html/RM/H5?
-
-tar czvf ../hdf5_$BRANCH_VERSION_FORMAT.orig-doc.tar.gz html
-rm -rf html
-
diff --git a/debian/watch b/debian/watch
index c68bbf4..7bc75d7 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,4 +1,4 @@
-version=2
+version=3
 ftp://ftp.hdfgroup.org/HDF5/current/src/ \
 	hdf5-(.*)\.tar\.gz \
-	debian uupdate
+	debian debian/orig-tar.sh

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



More information about the Pkg-grass-devel mailing list