File: rules

package info (click to toggle)
python-psutil 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,180 kB
  • ctags: 1,814
  • sloc: ansic: 8,748; python: 7,912; makefile: 240
file content (56 lines) | stat: -rwxr-xr-x 1,785 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
#!/usr/bin/make -f

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

export CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
export CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)

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

override_dh_auto_build:
	set -e ; \
	for python in $(PY2VERS) $(PY3VERS); do \
		$$python setup.py build; \
	done
	$(MAKE) -C docs html

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

override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
	# run tests
	-for test in test_memory_leaks.py test_psutil.py ;\
	do \
	    for python in $(PY2VERS) ; do \
  	        echo "running "test/$$test" on "$$python ; \
		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 test/$$test ; \
	    done ; \
	    for python in $(PY3VERS) ; do \
  	        echo "running "test/$$test" on "$$python ; \
		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 test/$$test ; \
	    done ; \
	done
endif

override_dh_installchangelogs:
	dh_installchangelogs HISTORY

override_dh_installdocs:
	dh_installdocs -X.DS_Store
	dh_installdocs docs/_build/html

override_dh_compress:
	dh_compress -X.py