-
Notifications
You must be signed in to change notification settings - Fork 43
/
make-all-debs.sh
executable file
·50 lines (41 loc) · 991 Bytes
/
make-all-debs.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
#!/bin/bash
set -e
SOURCES="btsync-common btsync-core btsync-gui btsync-user btsync"
[ -n "$1" ] && SOURCES="$1"
function enter_build() {
pushd $1
trap exit_build INT QUIT TERM EXIT
}
function exit_build() {
trap - INT QUIT TERM EXIT
popd
}
for SRCDIR in ${SOURCES}; do
if [ -d ${SRCDIR} ]; then
enter_build ${SRCDIR}
# make binary targets
if [ "${SRCDIR}" != "btsync-common" -a "${SRCDIR}" != "btsync-core" ]; then
debuild clean
debuild -uc -us -b
rm -f ../*all.build
rm -f ../*all.changes
else
tar xvf ../${SRCDIR}_*.orig.tar.gz -C ../
ARCHS="i386 amd64 armel armhf powerpc"
[ "${SRCDIR}" == "btsync-core" ] && ARCHS="i386 amd64 armel armhf"
for destarch in ${ARCHS}; do
debuild clean
debuild -uc -us -b -a${destarch}
rm -f ../*${destarch}.build
rm -f ../*${destarch}.changes
done
fi
# cleanup garbage
debuild clean
# return
exit_build
else
echo ERROR: source tree ${SRCDIR} not found >&2
fi
done
set +e