File: rules

package info (click to toggle)
germinate 2.26
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 424 kB
  • ctags: 381
  • sloc: python: 3,794; perl: 47; makefile: 33; sh: 15
file content (44 lines) | stat: -rwxr-xr-x 1,317 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
33
34
35
36
37
38
39
40
41
42
43
44
#! /usr/bin/make -f
%:
	dh $@ --with python2,python3

PY2REQUESTED := $(shell pyversions -r)
PY2DEFAULT := $(shell pyversions -d)
PY3REQUESTED := $(shell py3versions -r)
PY3DEFAULT := $(shell py3versions -d)
# Run setup.py with the default python/python3 last so that the scripts use
# #!/usr/bin/python(3) and not #!/usr/bin/pythonX.Y.
PY2 := $(filter-out $(PY2DEFAULT),$(PY2REQUESTED)) python
PY3 := $(filter-out $(PY3DEFAULT),$(PY3REQUESTED)) python3

override_dh_auto_build:
	dh_auto_build
	set -e; for python in $(PY3); do \
		$$python setup.py build; \
	done

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	set -e; for python in $(PY2) $(PY3); do \
		$$python setup.py test; \
	done
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build

override_dh_auto_install:
	# setuptools likes to leave some debris around, which confuses things.
	find build -name \*.pyc -print0 | xargs -0r rm -f
	find build -name __pycache__ -print0 | xargs -0r rm -rf
	find build -name \*.egg-info -print0 | xargs -0r rm -rf
	dh_auto_install
	# Allow the Python 3 top-level scripts to take priority.
	set -e; for python in $(PY3); do \
		$$python setup.py install --force --root=$(CURDIR)/debian/tmp \
			--no-compile -O0 --install-layout=deb; \
	done

override_dh_python2:
	dh_python2 -ppython-germinate