| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
include /usr/share/dpkg/default.mk |
| 4 |
|
| 5 |
VERSIONS := $(shell py3versions --supported -v) |
| 6 |
|
| 7 |
TESTSUITE_FAIL_CMD=exit 1 |
| 8 |
NON_FATAL=( echo "*** test-suite FAILED but continuing anyway ***"; true; ) |
| 9 |
ifneq ($(filter $(DEB_BUILD_ARCH), ),) |
| 10 |
# tests currently fail on these architectures |
| 11 |
TESTSUITE_FAIL_CMD=$(NON_FATAL) |
| 12 |
endif |
| 13 |
|
| 14 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 15 |
|
| 16 |
%: |
| 17 |
dh $@ |
| 18 |
|
| 19 |
override_dh_auto_configure-arch: |
| 20 |
set -e; for v in $(VERSIONS); do \ |
| 21 |
dh_auto_configure \ |
| 22 |
--builddirectory=build-$$v \ |
| 23 |
-- \ |
| 24 |
-Dpython=/usr/bin/python$$v \ |
| 25 |
-Dauto_features=enabled \ |
| 26 |
; \ |
| 27 |
done |
| 28 |
|
| 29 |
override_dh_auto_build-arch: |
| 30 |
set -e; for v in $(VERSIONS); do \ |
| 31 |
PYTHON=/usr/bin/python$$v \ |
| 32 |
dh_auto_build \ |
| 33 |
--arch \ |
| 34 |
--builddirectory=build-$$v \ |
| 35 |
-- \ |
| 36 |
; \ |
| 37 |
done |
| 38 |
|
| 39 |
# don't run the tests under fakeroot, otherwise they will try to connect to |
| 40 |
# root's session D-BUS |
| 41 |
override_dh_auto_test-arch: |
| 42 |
ifeq ($(DEB_HOST_ARCH_OS), linux) |
| 43 |
set -e; for v in $(VERSIONS); do \ |
| 44 |
LC_ALL=C.UTF-8; \ |
| 45 |
PYTHON=/usr/bin/python$$v; \ |
| 46 |
export HOME=$(CURDIR)/debian/tmp/home; \ |
| 47 |
mkdir -p $$HOME/.local/share; \ |
| 48 |
unset LD_PRELOAD; \ |
| 49 |
VERBOSE=1; \ |
| 50 |
xvfb-run dh_auto_test \ |
| 51 |
--arch \ |
| 52 |
--builddirectory=build-$$v \ |
| 53 |
-- \ |
| 54 |
--timeout-multiplier 3 \ |
| 55 |
|| $(TESTSUITE_FAIL_CMD) \ |
| 56 |
; \ |
| 57 |
while [ -e /tmp/.X99-lock ]; do \ |
| 58 |
echo "Waiting for xvfb to finish..."; \ |
| 59 |
sleep 0.5; \ |
| 60 |
done; \ |
| 61 |
done |
| 62 |
endif |
| 63 |
|
| 64 |
override_dh_auto_install-arch: |
| 65 |
set -e; for v in $(VERSIONS); do \ |
| 66 |
PYTHON=/usr/bin/python$$v \ |
| 67 |
VERBOSE=1 \ |
| 68 |
dh_auto_install \ |
| 69 |
--arch \ |
| 70 |
--builddirectory=build-$$v \ |
| 71 |
--destdir=debian/tmp \ |
| 72 |
-- \ |
| 73 |
; \ |
| 74 |
done |