File: repack.sh

package info (click to toggle)
minetest 0.4.15%2Brepack2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,732 kB
  • ctags: 13,048
  • sloc: cpp: 110,598; xml: 77,537; ansic: 4,149; sh: 853; makefile: 788; python: 659; java: 484
file content (68 lines) | stat: -rwxr-xr-x 1,723 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
# Repack an upstream tarball, unpacking waf files inside it.
#
# Meant to be run by uscan(1) as the "command param", after repacking
# (if any) by mk-origtargz. So you shouldn't give "repacksuffix" to
# debian/watch; instead you should set it below; however this should
# still match the dversionmangle in that file.

repacksuffix="+repack"
dfsgremovals="Makefile.bak \
     .gitattributes \
     .gitignore \
     .hg_archival \
     .hg_archival.txt \
     .hgignore \
     .hgtags \
     fontlucida.png \
     sqlite \
     json \
     lua \
     liberationmono.ttf \
     liberationsans.ttf"
#jthread # upstream patched that lib, which seem dead upstream itself, so use minetest's version even if I don't like it.

included_games="minetest_game"

# You shouldn't need to change anything below here.

USAGE="Usage: $0 --upstream-version version filename"

test "$1" = "--upstream-version" || { echo >&2 "$USAGE"; exit 2; }
upstream="$2"
filename="$3"

source="$(dpkg-parsechangelog -SSource)"
newups="${upstream}${repacksuffix}"
basedir="$(dirname "$filename")"

set -e

mkdir temp
cd temp
tar -xf "../$filename"

cd "${source}-${upstream}"

# Remove non-free content
set +ex
for file in $dfsgremovals ; do
  filelist="$filelist "`find . -name $file`
done
set -ex
rm -rf $filelist

# Add the basic game
for game in $included_games ; do 
  wget --no-verbose https://github.com/minetest/${game}/archive/${upstream}.tar.gz -O - | tar xfz - 
  mv ${game}-${upstream} games/${game}
done

# Repack everything
cd ..
mv "${source}-${upstream}" "${source}-${newups}"
GZIP="-9fn" tar -czf "../$basedir/${source}_${newups}.orig.tar.gz" "${source}-${newups}"
rm -rf "${source}-${newups}"

cd ../ # out of temp
rm -rf temp