3
# Repack upstream source removing generated (.mo) files
4
# and eg/hangman.p6, which has no license and is certainly
7
# To be called via debian/watch (uscan or uscan --force)
9
# sh debian/repack.sh --upstream-version VER FILE
16
Usage: $0 --upstream-version VER FILE
24
[ "${1:-}" = "--upstream-version" ] \
30
TMPDIR=`mktemp -d -p .`
32
trap "rm -rf $TMPDIR" INT QUIT 0
38
UPSTREAM_DIR=Padre-${UP_VER}
39
ORIG="../padre_${DEB_VER}.orig.tar.gz"
40
ORIG_DIR="padre-${DEB_VER}.orig"
42
if [ -e "$ORIG" ]; then
43
echo "$ORIG already exists. Aborting."
47
echo -n "Expanding upstream source tree..."
48
tar xzf $UPSTREAM_TAR -C $TMPDIR
51
# clean generated files
52
echo "Cleaning upstream sources from generated files..."
53
for f in `cd $TMPDIR/$UPSTREAM_DIR/share/locale; ls -1 *.mo` ;
55
echo " share/locale/$f"
56
rm $TMPDIR/$UPSTREAM_DIR/share/locale/$f
59
echo "Remmoving copyrighted files without a license..."
60
for f in eg/hangman.p6 ;
63
rm $TMPDIR/$UPSTREAM_DIR/$f
67
mv $TMPDIR/$UPSTREAM_DIR $TMPDIR/$ORIG_DIR
69
echo -n Repackaging into ${ORIG} ...
70
tar c -C $TMPDIR $ORIG_DIR | gzip -n -9 > "$ORIG"