source: debian/repack.sh @ a493a28

Last change on this file since a493a28 was a493a28, checked in by zzz <zzz@…>, 4 years ago

propagate from branch 'i2p.i2p' (head 809274054ef446273ea312a631fe7482fa53c030)

to branch 'i2p.i2p.zzz.debian' (head 437e22ee74e32e103bb8475007b1d1a2f995ef28)

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#!/bin/sh
2
3# Strip out binaries from the official upstream I2P source tarballs that are
4# not required to build the Debian packages.
5
6# Script mostly borrowed from Raphael Geissert's dfsg-repack.sh
7
8
9set -e
10
11if [ ! -f "$3" ] && [ ! -f "$1" ]; then
12    echo "ERROR: This script must be run via uscan or by manually specifying the input tarball." >&2
13    exit 1
14fi
15
16tarball=
17
18[ -f "$3" ] && tarball="$3"
19[ -z "$tarball" -a -f "$1" ] && tarball="$1"
20
21fname=$(basename "$tarball" .bz2)
22tarball=$(readlink -f "$tarball")
23
24tdir=$(mktemp -d)
25trap '[ ! -d "$tdir" ] || rm -r "$tdir"' EXIT
26
27cp -f ${tarball} "$tarball.bkp"
28echo "Filtering tarball contents..."
29bzcat "$tarball" | tar --wildcards --delete '*/installer/lib/*' \
30                        --delete '*/Slackware/*' \
31                        --delete '*/debian-alt/*' \
32                        --delete '*/installer/resources/geoip.txt' \
33                        --delete '*/installer/resources/geoipv6.dat.gz' \
34                        --delete '*/debian/*' > "$tdir/${fname}"
35
36echo "Compressing filtered tarball..."
37bzip2 -9 "$tdir/${fname}"
38
39repackedtarball=$(echo $tarball|sed -e 's/i2psource/i2p/' -e 's/\.orig\.tar\.bz2/+repack.orig.tar.bz2/')
40mv "$tdir/${fname}.bz2" "$repackedtarball"
41echo "Repacked tarball saved to $repackedtarball."
Note: See TracBrowser for help on using the repository browser.