Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # run setup.py install with --install-layout=deb
4 export SETUP_PY_EXTRA_ARGS=--install-layout=deb
5
6
7 # default Python 3 version
8 PYTHON = $(shell py3versions -dv)
9
10 # Python 3 versions
11 PYTHON3 = $(shell py3versions -s)
12
13 %:
14 dh $@ --buildsystem=cmake
15
16 cmake-configure-%:
17 dh_auto_configure -Bbuild-$* -- \
18 -DBUILD_PYTHON_BINDINGS=1 \
19 -DPYTHON_EXECUTABLE=/usr/bin/python$*
20
21 override_dh_auto_configure: \
22 $(PYTHON3:python%=cmake-configure-%)
23
24 # build targets
25
26 cmake-build-%:
27 dh_auto_build -Bbuild-$*
28
29 override_dh_auto_build: \
30 $(PYTHON3:python%=cmake-build-%)
31
32 # test targets
33
34 cmake-test-%-stamp:
35 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
36 dh_auto_test -Bbuild-$*/python-bindings
37 endif
38 touch $@
39
40 override_dh_auto_test: \
41 $(PYTHON3:python%=cmake-test-%-stamp)
42 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
43 dh_auto_test \
44 -Bbuild-$(PYTHON)
45 endif
46
47 # install targets
48
49 cmake-install-%:
50 dh_auto_install -Bbuild-$*/python-bindings
51
52 override_dh_auto_install: \
53 $(PYTHON3:python%=cmake-install-%)
54 dh_auto_install \
55 -Bbuild-$(PYTHON)
56
57 execute_after_dh_python3:
58 find debian/python3-kdtree -name '*.cpython-*dm-*so' | xargs -r rm -f