Debian Codegraph @

debian/tests/odk-build-examples-java

raw
1 #!/bin/bash
2 # autopkgtest check: Run the odk/build-examples check against an installed
3 # version of the LibreOffice SDK
4 # (c) 2017 Software in the Public Interest, Inc.
5 # Authors: Rene Engelhard <[email protected]>
6
7 set -e
8 set -E
9
10 # skip on Zero using architectures
11 if java -version 2>&1 | grep -q Zero; then
12 echo "Zero-using architecture. Skipping."
13 exit 77
14 fi
15
16 SRCDIR=`pwd`
17 CHECK_PARALLELISM=1
18
19 function unapply() {
20 cd $SRCDIR
21 echo
22 echo "====== Unapplying the patch ======"
23 patch -p1 -R < ./debian/tests/patches/odk-build-examples-standalone.diff
24 }
25
26 trap "unapply" ERR
27
28 # skip if building as root:
29 # unopkg errors out with "ERROR: Cannot run unopkg as root without --shared or --bundled option."
30 # if ran as root
31 if [ `id -u` = "0" ]; then
32 exit 77
33 fi
34
35 echo
36 echo "====== Patching the tree to build the odk build-examples test against an existing installation ======"
37 patch -p1 < ./debian/tests/patches/odk-build-examples-standalone.diff
38
39 if [ ! -f config_host.mk ]; then
40 echo
41 echo "====== Generating configuration ======="
42 rm -f config_host.mk
43 ./debian/rules config_host.mk
44 fi
45
46 echo
47 echo "====== Starting build with ${CHECK_PARALLELISM} job against /usr/lib/libreoffice/sdk ======"
48
49 cd $SRCDIR/odk
50
51 export PARALLELISM=$CHECK_PARALLELISM
52 make -rk \
53 CustomTarget_odk/build-examples_java verbose=t
54
55 unapply
56