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
|