File: rules

package info (click to toggle)
python-pygraphviz 1.3.1-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 664 kB
  • sloc: ansic: 4,970; python: 2,523; makefile: 152
file content (58 lines) | stat: -rwxr-xr-x 2,649 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
#!/usr/bin/make -f

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

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

override_dh_install:
	set -e; \
	for python in $(PYTHON2); do \
		$$python setup.py install --install-layout=deb --root=$(CURDIR)/debian/python-pygraphviz; \
		$$python-dbg setup.py install --install-layout=deb --root=$(CURDIR)/debian/python-pygraphviz-dbg; \
	done
	for python in $(PYTHON3); do \
		$$python setup.py install --install-layout=deb --root=$(CURDIR)/debian/python3-pygraphviz; \
		$$python-dbg setup.py install --install-layout=deb --root=$(CURDIR)/debian/python3-pygraphviz-dbg; \
	done

override_dh_auto_build:
	set -e; \
	for python in $(PYTHON2) $(PYTHON3); do \
		$$python setup.py build; \
		$$python-dbg setup.py build; \
	done
	PYTHONPATH=$(CURDIR)/`python -c "from distutils.command.build import build ; from distutils.core import Distribution ; b = build(Distribution()) ; b.finalize_options() ; print (b.build_platlib)"` $(MAKE) -C doc html

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

override_dh_installexamples:
	dh_installexamples -ppython-pygraphviz-doc examples/*

override_dh_installdocs:
	dh_installdocs -ppython-pygraphviz-dbg --link-doc=python-pygraphviz
	dh_installdocs -ppython3-pygraphviz-dbg --link-doc=python3-pygraphviz
	dh_installdocs
	dh_installdocs -ppython-pygraphviz-doc doc/build/html

override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	#set -e; \
	-for python in $(PYTHON2) $(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)") ; \
		touch $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
		cd build ; $$python -c "import sys ; sys.path.insert(0, '$(CURDIR)/$$LIB') ; import pygraphviz as t ; t.test(verbosity=2)" ; cd .. ; \
		rm $(CURDIR)/$$LIB/pygraphviz/tests/__init__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)") ; \
		touch $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
		cd build ; $$python-dbg -c "import sys ; sys.path.insert(0, '$(CURDIR)/$$LIB') ; import pygraphviz as t ; t.test(verbosity=2)" ; cd .. ; \
		rm $(CURDIR)/$$LIB/pygraphviz/tests/__init__py ; \
	done
endif