File: rules

package info (click to toggle)
confget 2.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 552 kB
  • sloc: python: 1,303; ansic: 907; sh: 569; makefile: 142
file content (72 lines) | stat: -rwxr-xr-x 2,069 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/make -f
# -*- makefile -*-
# Debian build rules for confget, the configuration variable extractor

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all future=+lfs
export DEB_BUILD_MAINT_OPTIONS

DEB_CFLAGS_MAINT_APPEND=	-pipe -Wall -W -std=c99 -pedantic -Wbad-function-cast \
		-Wcast-align -Wcast-qual -Wchar-subscripts -Winline \
		-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
		-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings
ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS)))
	DEB_CFLAGS_MAINT_APPEND+=	-Werror
endif
export DEB_CFLAGS_MAINT_APPEND

export PCRE_CPPFLAGS=-DHAVE_PCRE
export PCRE_LIBS=-lpcre

ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
NO_DOC_BUILD=
else
export NO_DOC_BUILD=1
endif

D=	${CURDIR}/debian
DTMP=	$D/tmp
PY=	${CURDIR}/python

export TESTDIR=${CURDIR}/t

export PYBUILD_NAME=confget
export PYBUILD_DIR=${PY}
export PYBUILD_TEST_PYTEST=1

# OK, so this is not the best way to set this, but oh well
export PYTEST_ADDOPTS=${PY}/unit_tests

override_dh_auto_build-arch:
	dh_auto_build -- LFS_CPPFLAGS= LFS_LDFLAGS=

override_dh_auto_build-indep:
	dh_auto_build --buildsystem pybuild

override_dh_auto_install-arch:
	dh_auto_install -- DESTDIR=${CURDIR}/debian/confget PREFIX=/usr \
		MANDIR=/usr/share/man/man BINGRP=root MANGRP=root \
		EXAMPLESDIR=/usr/share/doc/confget/examples \
		INSTALL_PROGRAM='install -m 755' \
		INSTALL_SCRIPT='install -m 755' INSTALL_DATA='install -m 644'

override_dh_auto_install-indep:
	dh_auto_install --buildsystem pybuild

override_dh_auto_test-indep:
	env PYTHONPATH='${PY}/src' '$D/tests/tap-python.sh'
	dh_auto_test --buildsystem pybuild

override_dh_installchangelogs:
	dh_installchangelogs -X CHANGES
	set -e; for pkg in $$(dh_listpackages); do \
		install -m 644 CHANGES "debian/$$pkg/usr/share/doc/$$pkg/NEWS"; \
	done

execute_after_dh_auto_clean-indep:
	if dpkg-query -W -f '$${Package}\n' | fgrep -qxe python3-setuptools; then \
		dh_auto_clean --buildsystem pybuild; \
	fi

%:
	dh '$@'