summaryrefslogtreecommitdiffstats
path: root/debian/bin/repack.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:48:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:48:23 +0000
commit1996ee29b14379b832b08614ed9a3acef376b6fa (patch)
tree814166bc23fef6ad8ba11da1673018a8e937d3f5 /debian/bin/repack.sh
parentAdding upstream version 2.3.5. (diff)
downloadmonitoring-plugins-1996ee29b14379b832b08614ed9a3acef376b6fa.tar.xz
monitoring-plugins-1996ee29b14379b832b08614ed9a3acef376b6fa.zip
Adding debian version 2.3.5-1.debian/2.3.5-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/bin/repack.sh')
-rwxr-xr-xdebian/bin/repack.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/bin/repack.sh b/debian/bin/repack.sh
new file mode 100755
index 0000000..cc3b78f
--- /dev/null
+++ b/debian/bin/repack.sh
@@ -0,0 +1,39 @@
+#!/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/configure.in"
+[ -f $srcdir/configure.in ] && sed -i '/perlmods\/Makefile/d' $srcdir/configure.in
+#echo "Adjusting $srcdir/configure.am"
+[ -f $srcdir/configure.ac ] && sed -i '/perlmods\/Makefile/d' $srcdir/configure.ac
+#echo "Adjusting $srcdir/Makefile*"
+sed -i 's/perlmods\ //' $srcdir/Makefile*
+#echo "Removing $srcdir/perlmods/
+rm -rf $srcdir/perlmods/
+
+tar -cof "${tarball%.*}" -C $tdir/ $distdir
+gzip -f9 "${tarball%.*}"