From d73db8a7d273d40fefc5e73f5a6af1c240868da2 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 27 Aug 2013 23:07:58 +0000 Subject: [PATCH] provide informations for repackaging --- debian/README.source | 9 +++++++++ debian/source/repack.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 debian/source/repack.sh diff --git a/debian/README.source b/debian/README.source index f0fe49a..ee7018a 100644 --- a/debian/README.source +++ b/debian/README.source @@ -1,3 +1,12 @@ We use dpatch for patch handling inside our package(s). Please see /usr/share/doc/dpatch/README.source.gz (if you have installed dpatch) for documentation about dpatch. + +Since Version 1.5.0 we are repackaging the upstream tarball to stop providing: + + * perlmods/ + * contrib/ + +Therefor you should use the script debian/source/repack.sh: + + repack.sh diff --git a/debian/source/repack.sh b/debian/source/repack.sh new file mode 100755 index 0000000..b9d0937 --- /dev/null +++ b/debian/source/repack.sh @@ -0,0 +1,37 @@ +#!/bin/bash +# Borrowed from Raphael Geissert's Debian PHP repack script. + +set -e + +if [ ! -f "$3" ] && [ ! -f "$1" ]; then + echo "This script must be run via uscan or by manually specifying the tarball" >&2 + exit 1 +fi + +tarball= + +[ -f "$3" ] && tarball="$3" +[ -z "$tarball" -a -f "$1" ] && tarball="$1" + +tarball="$(readlink -f "$tarball")" + +tdir="$(mktemp -d)" +trap '[ ! -d "$tdir" ] || rm -r "$tdir"' EXIT + +tar -xzf $tarball -C $tdir +cp -a "$tarball" "$tarball.orig" +distdir="$(basename $(ls -d $tdir/*))" +srcdir="$tdir/$distdir" + +#echo "Adjusting $srcdir/configure" +sed -i 's/perlmods\/Makefile\ //' $srcdir/configure +sed -i '/perlmods\/Makefile/d' $srcdir/configure +#echo "Adjusting $srcdir/Makefile*" +sed -i 's/\ contrib\ / /' $srcdir/Makefile* +sed -i 's/perlmods\ //' $srcdir/Makefile* +#echo "Removing $srcdir/perlmods/ and $srcdir/contrib/" +rm -rf $srcdir/perlmods/ $srcdir/contrib/ + +#tarball=$(echo $tarball|sed 's/\.orig\.tar\.gz/+dfsg.orig.tar.gz/') +tar -cof "${tarball/.gz}" -C $tdir/ $distdir +gzip -f9 "${tarball/.gz}"