summaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: df1b96a14576517b9ea70fc9eddb09c1434279d5 (plain)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Enable verbose build details.
export V=1

include /usr/share/dpkg/architecture.mk

%:
ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
	dh $@ --with python3
else
	dh $@
endif

ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)

override_dh_auto_install:
	dh_auto_install
	for pyver in `py3versions -s`; do \
		set -e; \
		if python3 -c "pyver=tuple(map(int, '$$pyver'[6:].split('.'))); exit(0 if pyver >= (3,8) else 1)"; then \
			export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__${DEB_HOST_ARCH_OS}_${DEB_HOST_MULTIARCH}'; \
		else \
			export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata_m_${DEB_HOST_ARCH_OS}_${DEB_HOST_MULTIARCH}'; \
		fi; \
		dh_auto_configure -- --enable-python PYTHON=$$pyver; \
		dh_auto_install --sourcedirectory=src/python -- PYTHON=$$pyver; \
	done
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -f regression.out