File: rules

package info (click to toggle)
python-graph 1.8.2-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,396 kB
  • ctags: 850
  • sloc: python: 3,483; makefile: 92
file content (49 lines) | stat: -rwxr-xr-x 1,585 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
#!/usr/bin/make -f
# -*- makefile -*-

PY2VERS := $(shell pyversions -s)
PY3VERS := $(shell py3versions -s)

%:
	dh $@ --with=python2,python3

override_dh_auto_build:
	set -e ; \
	for python in $(PY2VERS) $(PY3VERS); do \
		cd core ; $$python setup.py build ; cd .. ; \
	done

	$(MAKE) docs

override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	-for python in $(PY2VERS) $(PY3VERS); do \
		# retrive the lib path \
		LIB=$$($$python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_purelib)") ; \
		$(MAKE) tests PYTHON=$$python PYTHONPATH=../core/$$LIB ; \
	done
endif

override_dh_auto_install:
	set -e ; \
	for python in $(PY2VERS); do \
		cd core ; $$python setup.py install --root=$(CURDIR)/debian/python-pygraph --install-layout=deb ; cd .. ; \
		cd dot  ; $$python setup.py install --root=$(CURDIR)/debian/python-pygraph --install-layout=deb ; cd .. ; \
	done
	set -e ; \
	for python in $(PY3VERS); do \
		cd core ; $$python setup.py install --root=$(CURDIR)/debian/python3-pygraph --install-layout=deb ; cd .. ; \
		cd dot  ; $$python setup.py install --root=$(CURDIR)/debian/python3-pygraph --install-layout=deb ; cd .. ; \
	done

	# clean up __pycache__ dirs, generated when running tests on the build dir
	find $(CURDIR)/debian/python3-pygraph -type d -name "__pycache__" | xargs rm -rf

override_dh_installdocs:
	dh_installdocs		docs

override_dh_installexamples:
	dh_installexamples	tests/*.py

override_dh_python2:
	dh_python2 --no-guessing-deps