Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Debian build rules for confget, the configuration variable extractor
4
5 # Aim for the top, adapt if anything should break on the buildds.
6 DEB_BUILD_MAINT_OPTIONS= hardening=+all future=+lfs
7
8 DEB_CFLAGS_MAINT_APPEND= -pipe -Wall -W -std=c99 -pedantic -Wbad-function-cast \
9 -Wcast-align -Wcast-qual -Wchar-subscripts -Winline \
10 -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
11 -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings
12 ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
13 DEB_CFLAGS_MAINT_APPEND+= -Werror
14 endif
15
16 include /usr/share/dpkg/default.mk
17
18 include /usr/share/debhelper/dh_package_notes/package-notes.mk
19
20 export PCRE_CPPFLAGS=-DHAVE_PCRE2
21 export PCRE_LIBS=-lpcre2-8
22
23 ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
24 NO_DOC_BUILD=
25 else
26 export NO_DOC_BUILD=1
27 endif
28
29 D= ${CURDIR}/debian
30 DTMP= $D/tmp
31 PY= ${CURDIR}/python
32
33 export TESTDIR=${CURDIR}/t
34
35 export PYBUILD_NAME=confget
36 export PYBUILD_DIR=${PY}
37 export PYBUILD_TEST_PYTEST=1
38
39 # OK, so this is not the best way to set this, but oh well
40 export PYTEST_ADDOPTS=${PY}/unit_tests
41
42 override_dh_auto_build-arch:
43 dh_auto_build -- LFS_CPPFLAGS= LFS_LDFLAGS=
44
45 override_dh_auto_build-indep:
46 dh_auto_build --buildsystem pybuild
47
48 override_dh_auto_install-arch:
49 dh_auto_install -- DESTDIR=${CURDIR}/debian/confget PREFIX=/usr \
50 MANDIR=/usr/share/man/man BINGRP=root MANGRP=root \
51 EXAMPLESDIR=/usr/share/doc/confget/examples \
52 INSTALL_PROGRAM='install -m 755' \
53 INSTALL_SCRIPT='install -m 755' INSTALL_DATA='install -m 644'
54
55 override_dh_auto_install-indep:
56 dh_auto_install --buildsystem pybuild
57
58 override_dh_auto_test-indep:
59 env PYTHONPATH='${PY}/src' '$D/tests/tap-python.sh'
60 dh_auto_test --buildsystem pybuild
61
62 override_dh_installchangelogs:
63 dh_installchangelogs -X CHANGES
64 set -e; for pkg in $$(dh_listpackages); do \
65 install -m 644 CHANGES "debian/$$pkg/usr/share/doc/$$pkg/NEWS"; \
66 done
67
68 execute_after_dh_auto_clean-indep:
69 if dpkg-query -W -f '$${Package}\n' | fgrep -qxe python3-setuptools; then \
70 dh_auto_clean --buildsystem pybuild; \
71 fi
72
73 %:
74 dh '$@'