Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # debian/rules file for libcap-ng
4 # Written by Pierre Chifflier <[email protected]>
5
6 # Uncomment this to turn on verbose mode.
7 #export DH_VERBOSE=1
8
9 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
10 export DEB_PYTHON_INSTALL_LAYOUT = deb
11
12
13 ifneq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
14 PY3VERS = dummy
15 CONFIGURE_FLAGS = --without-python3
16 else
17 PY3VERS = $(shell py3versions --supported --version)
18 CONFIGURE_FLAGS = --with-python3 PYTHON=/usr/bin/python$$V
19
20 endif
21
22 %:
23 dh $@
24
25 execute_before_dh_autoreconf:
26 touch NEWS
27
28 override_dh_auto_configure:
29 for V in $(PY3VERS); do \
30 dh_auto_configure --builddir=build-py$$V -- \
31 $(CONFIGURE_FLAGS); \
32 done
33
34 override_dh_auto_build:
35 for V in $(PY3VERS); do \
36 dh_auto_build --builddir=build-py$$V; \
37 done
38
39 override_dh_auto_install:
40 # Move Python files to separate folders so they don't overwrite
41 # each other at install time.
42 for V in $(PY3VERS); do \
43 dh_auto_install --builddir=build-py$$V; \
44 if test "$$V" != dummy; then \
45 mv ${CURDIR}/debian/tmp/usr/lib/python3 ${CURDIR}/debian/tmp/usr/lib/python$$V; \
46 fi; \
47 done
48
49 find $(CURDIR)/debian/tmp -name *.la -delete
50
51 override_dh_auto_test:
52 for V in $(PY3VERS); do \
53 dh_auto_test --builddir=build-py$$V; \
54 done
55
56 ifeq ($(filter nopython,$(DEB_BUILD_PROFILES)),)
57 execute_after_dh_python3:
58 rm -rf debian/python3-cap-ng/usr/lib/python3.*
59 endif
60
61 override_dh_auto_clean:
62 for V in $(PY3VERS); do \
63 dh_auto_clean --builddir=build-py$$V; \
64 done