forked from mutability/dump1090
-
Notifications
You must be signed in to change notification settings - Fork 237
/
prepare-build.sh
executable file
·59 lines (47 loc) · 1.53 KB
/
prepare-build.sh
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
#!/bin/sh
# This script prepares a package tree for building on different target
# distributions
if [ $# -lt 1 ]
then
echo "Syntax: $0 <distribution> [target]" >&2
echo "" >&2
echo "Prepares a package tree in <target> (default package-<distribution>) ready for building" >&2
exit 1
fi
export DEBFULLNAME="${DEBFULLNAME:-FlightAware build automation}"
export DEBEMAIL="${DEBEMAIL:[email protected]}"
TOP=`dirname $0`
DIST=$1
OUT=$2
if [ -n "$OUT" ]
then
OUT=$(realpath $OUT)
else
OUT=$(realpath package-$DIST)
fi
if [ -e $OUT ]
then
echo "$OUT already exists, refusing to overwrite it" >&2
exit 1
fi
FILES=$(find $TOP -mindepth 1 -maxdepth 1 -name .git -prune -o -name 'debian*' -prune -o -name 'package-*' -prune -o -print)
mkdir -p $OUT
cp -a $FILES $OUT
cp -a $TOP/debian $OUT
[ -d $TOP/debian-$DIST ] && cp -a $TOP/debian-$DIST/* $OUT/debian/
case "$DIST" in
buster)
echo "Updating changelog for buster backport build" >&2
dch --changelog $OUT/debian/changelog --local ~bpo10+ --force-distribution --distribution buster-backports "Automated backport build for buster"
;;
bullseye)
echo "Updating changelog for bullseye backport build" >&2
dch --changelog $OUT/debian/changelog --local ~bpo11+ --force-distribution --distribution bullseye-backports "Automated backport build for bullseye"
;;
bookworm)
;;
*)
echo "Don't know how to build for a distribution named $DIST" >&2
exit 1
esac
echo "Package tree prepared in $OUT" >&2