From c71c4e86f67d639eed68e563d61db9878d500e90 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2013 23:52:13 +0200 Subject: [PATCH] Fix: watch file for debian package. --- build/debian/get-orig-source.sh | 40 +++++++++++++++++++++++++++++++++ build/debian/wash | 4 ---- build/debian/watch | 4 ++++ 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100755 build/debian/get-orig-source.sh delete mode 100644 build/debian/wash create mode 100644 build/debian/watch diff --git a/build/debian/get-orig-source.sh b/build/debian/get-orig-source.sh new file mode 100755 index 00000000000..e3d201d672f --- /dev/null +++ b/build/debian/get-orig-source.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# run with +# debian/get-orig-source.sh [x.y.z] + +tmpdir=$(mktemp -d) +echo "tmpdir = $tmpdir" + +if [ -n "$1" ]; then + uscan_opts="--download-version=$1" +fi +uscan --noconf --force-download --no-symlink --verbose --destdir=$tmpdir $uscan_opts + +cd $tmpdir + +tgzfile=$(echo *.tar.gz) +version=$(echo "$tgzfile" | perl -pi -e 's/^dolibarr_//; s/\.zip$//; s/_/./g; s/\+nmu1//; s/$/+dfsg/;') + +# Extract the zip file +tar -xvf $tgzfile +srcdir=$(find . -maxdepth 1 -mindepth 1 -type d | sed -e 's/\.\///') + +if [ ! -d "$srcdir" ]; then + echo "ERROR: Failed to identify the extracted directory in $tmpdir (got $srcdir)" >&2 + rm -rf $tmpdir + exit 1 +fi + +# Repack as tar.xz +tar Jcf dolibarr_${version}.orig.tar.xz $srcdir + +cd - >/dev/null + +if [ -e ../dolibarr_${version}.orig.tar.xz ]; then + echo "Not overwriting ../dolibarr_${version}.orig.tar.xz"; +else + echo "Created ../dolibarr_${version}.orig.tar.xz" + mv $tmpdir/dolibarr_${version}.orig.tar.xz ../ +fi + +#rm -rf $tmpdir diff --git a/build/debian/wash b/build/debian/wash deleted file mode 100644 index d755cf4b112..00000000000 --- a/build/debian/wash +++ /dev/null @@ -1,4 +0,0 @@ -# watch control file for uscan -version=3 -#http://sourceforge.net/projects/dolibarr/files/Dolibarr%20installer%20for%20Debian-Ubuntu%20%28DoliDeb%29/ debian uupdate -http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_(.+)\.tar\.gz \ No newline at end of file diff --git a/build/debian/watch b/build/debian/watch new file mode 100644 index 00000000000..0f84815a48e --- /dev/null +++ b/build/debian/watch @@ -0,0 +1,4 @@ +# watch control file for uscan +version=3 +#http://sf.net/dolibarr/dolibarr-(.+)\.tgz +http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_(.+)\.tar\.gz