]> git.decadent.org.uk Git - ion3.git/commitdiff
Added get-orig-source script and rule to download and combine both upstream tarballs.
authorBen Hutchings <ben@decadent.org.uk>
Tue, 10 Jul 2007 21:34:01 +0000 (21:34 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 12:39:54 +0000 (12:39 +0000)
debian/get-orig-source [new file with mode: 0755]
debian/rules

diff --git a/debian/get-orig-source b/debian/get-orig-source
new file mode 100755 (executable)
index 0000000..35cca88
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -e
+
+# Get the main upstream tarball URL and version via uscan.
+while read line; do
+    if [ "${line#http://}" != "$line" -a "${line#* }" = "$line" ]; then
+       main_url="${line}"
+    fi
+    if [ "${line#Newest version }" != "$line" ]; then
+       version="${line#Newest version on remote site is }"
+       version="${version%, local version is *}"
+    fi
+done < <(LANG=C uscan --report --verbose)
+test -n "$main_url" -a -n "$version"
+
+# Get the document tarball URL and the filenames of the tarballs.
+# Download them.
+main_file=${main_url##*/}
+doc_url=${main_url/ion/ion-doc}
+doc_file=${doc_url##*/}
+wget -O $main_file $main_url
+wget -O $doc_file $doc_url
+
+# Work out what directories we expect to be in them, and check this.
+main_dir=${main_file%.tar.gz}
+doc_dir=${doc_file%.tar.gz}
+test -z "$(tar tzf $main_file | grep -v "^$main_dir/")"
+test -z "$(tar tzf $doc_file | grep -v "^$doc_dir/")"
+
+# Unpack, combine and repack.
+tar xzf $main_file
+tar xzf $doc_file
+mv $main_dir ion3-$version.orig
+mv $doc_dir ion3-$version.orig/doc
+tar cf - ion3-$version.orig | gzip -c9 > ion3_$version.orig.tar.gz
+
+# Clean up.
+rm -rf $main_file $doc_file ion3-$version.orig
index deb88ee784e6b4727cf286c2efe66d219096d885..99c822ce18909bf84a7d59443cfb8add5d872366 100755 (executable)
@@ -169,5 +169,10 @@ binary-arch: build-arch install-arch
        dh_builddeb -a
 
 binary: binary-indep binary-arch
+
+get-orig-source:
+       chmod +x debian/get-orig-source
+       debian/get-orig-source
+
 .PHONY: build-indep build-arch build clean binary-indep binary-arch binary \
-       install-indep install-arch unpatch
+       install-indep install-arch unpatch get-orig-source