From eea5f68ece15e5fbbb83d2ef934b778371ec6944 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 10 Jul 2007 21:34:01 +0000 Subject: [PATCH] Added get-orig-source script and rule to download and combine both upstream tarballs. --- debian/get-orig-source | 39 +++++++++++++++++++++++++++++++++++++++ debian/rules | 7 ++++++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 debian/get-orig-source diff --git a/debian/get-orig-source b/debian/get-orig-source new file mode 100755 index 0000000..35cca88 --- /dev/null +++ b/debian/get-orig-source @@ -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 diff --git a/debian/rules b/debian/rules index deb88ee..99c822c 100755 --- a/debian/rules +++ b/debian/rules @@ -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 -- 2.39.5