forked from flightaware/dump1090
-
Notifications
You must be signed in to change notification settings - Fork 1
/
prepare-build.sh
executable file
·62 lines (50 loc) · 1.65 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
60
61
62
#!/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
case "$DIST" in
wheezy)
cp -a $TOP/debian-wheezy/* $OUT/debian/
echo "Updating changelog for wheezy backport build" >&2
dch --changelog $OUT/debian/changelog --local ~bpo7+ --force-distribution --distribution wheezy-backports "Automated backport build for wheezy"
echo "Cloning rtl-sdr source"
git clone git://git.osmocom.org/rtl-sdr.git $OUT/rtl-sdr
;;
jessie)
cp -a $TOP/debian-jessie/* $OUT/debian/
echo "Updating changelog for jessie backport build" >&2
dch --changelog $OUT/debian/changelog --local ~bpo8+ --force-distribution --distribution jessie-backports "Automated backport build for jessie"
;;
stretch)
;;
*)
echo "Don't know how to build for a distribution named $DIST" >&2
exit 1
esac
echo "Package tree prepared in $OUT" >&2