File: rules

package info (click to toggle)
ctdopts 1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 312 kB
  • sloc: python: 940; makefile: 12; sh: 6
file content (32 lines) | stat: -rwxr-xr-x 1,131 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8
export PYBUILD_NAME = CTDopts
export PYBUILD_TEST_ARGS=PYTHONPATH={build_dir} python{version} debian/example.py

#include /usr/share/dpkg/default.mk
# this provides:
# DEB_SOURCE: the source package name
# DEB_VERSION: the full version of the package (epoch + upstream vers. + revision)
# DEB_VERSION_EPOCH_UPSTREAM: the package's version without the Debian revision
# DEB_VERSION_UPSTREAM_REVISION: the package's version without the Debian epoch
# DEB_VERSION_UPSTREAM: the package's upstream version
# DEB_DISTRIBUTION: the distribution(s) listed in the current entry of debian/changelog

# for hardening you might like to uncomment this:
# export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	# an override, not a PYBUILD directive, as we only need to do this once
	# not for every Python version
	2to3 --write --nobackups --no-diffs --output-dir=debian example.py

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	export PYBUILD_SYSTEM=custom; dh_auto_test
endif