File: rules

package info (click to toggle)
python-regex 0.1.20170117-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,092 kB
  • ctags: 5,204
  • sloc: ansic: 50,672; python: 14,670; makefile: 54
file content (68 lines) | stat: -rwxr-xr-x 2,786 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PYTHON2=$(shell pyversions -r)
PYTHON3=$(shell py3versions -r)

%:
	dh $@ --with python2,python3

override_dh_clean:
	dh_clean
	rm -rf Features.html build/ Python?/unicodedata_db.h

override_dh_auto_build:
	dh_auto_build
	set -e; \
	for python in $(PYTHON3); do \
		$$python setup.py build ; \
		$$python-dbg setup.py build ; \
	done
	rst2html docs/Features.rst > Features.html

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	-for python in $(PYTHON2); do \
		echo "-- running tests for "$$python" plain --" ; \
		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib"); \
		PYTHONPATH=$$LIB $$python Python2/test_regex.py; \
		echo "-- running tests for "$$python" debug --" ; \
		LIB=$$($$python-dbg -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print b.build_platlib"); \
		PYTHONPATH=$$LIB $$python-dbg Python2/test_regex.py; \
	done
	-for python in $(PYTHON3); do \
		echo "-- running tests for "$$python" plain --" ; \
		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print(b.build_platlib)"); \
		PYTHONPATH=$$LIB $$python Python3/test_regex.py; \
		echo "-- running tests for "$$python" debug --" ; \
		LIB=$$($$python-dbg -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print(b.build_platlib)"); \
		PYTHONPATH=$$LIB $$python-dbg Python3/test_regex.py; \
	done
endif

override_dh_install:
	set -e; \
	for python in $(PYTHON2); do \
		$$python setup.py install --install-layout=deb --root=$(CURDIR)/debian/python-regex; \
		$$python-dbg setup.py install --install-layout=deb --root=$(CURDIR)/debian/python-regex-dbg; \
	done
	set -e; \
	for python in $(PYTHON3); do \
		$$python setup.py install --install-layout=deb --root=$(CURDIR)/debian/python3-regex; \
		$$python-dbg setup.py install --install-layout=deb --root=$(CURDIR)/debian/python3-regex-dbg; \
	done
	# don't install pure python module in dbg pkgs
	rm -rfv $(CURDIR)/debian/python*-regex-dbg/usr/lib/python*/dist-packages/*.py*
	rm -rfv $(CURDIR)/debian/python*-regex-dbg/usr/lib/python*/dist-packages/*.egg-info

override_dh_installdocs:
	dh_installdocs --link-doc=python-regex

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -ppython-regex --dbg-package=python-regex-dbg
	dh_strip -ppython3-regex --dbg-package=python3-regex-dbg
endif