#!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- PACKAGE_NAME = python-skimage PACKAGE_ROOT_DIR = $(CURDIR)/debian/${PACKAGE_NAME} PYVERS = $(shell pyversions -vs) PYVER = $(shell pyversions -vd) # Mega rule %: dh $@ --buildsystem python_distutils override_dh_clean: ifeq (,$(filter noclean,$(DEB_BUILD_OPTIONS))) rm -rf build doc/build doc/auto_examples *-stamp skimage.egg-info dh_clean endif # Build docs during install override_dh_auto_install: ${PYVERS:%=python-install%} # Per Python version logic -- install, test, move .so into -lib python-install%: python$* setup.py install --install-layout=deb --root=$(PACKAGE_ROOT_DIR) : # Build Documentation ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) export PYTHONPATH=$(PACKAGE_ROOT_DIR)/usr/lib/python$*/dist-packages MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \ cd doc; test -d build/html || $(MAKE) html python$* setup.py install --install-layout=deb --root=$(PACKAGE_ROOT_DIR) endif ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) : # Run unittests export PYTHONPATH=$(PACKAGE_ROOT_DIR)/usr/lib/python$*/dist-packages; \ python$* /usr/bin/nosetests -s \ $(PACKAGE_ROOT_DIR)/usr/lib/python$*/*/skimage else : # Skip unittests due to nocheck endif : # Move platform-specific libraries into -lib for lib in $$(find $(PACKAGE_ROOT_DIR)/usr -name '*.so'); do \ sdir=$$(dirname $$lib) ; \ tdir=$(PACKAGE_ROOT_DIR)-lib/$${sdir#*$(PACKAGE_NAME)/} ; \ mkdir -p $$tdir ; \ echo "Moving '$$lib' into '$$tdir'." ; \ mv $$lib $$tdir ; \ done : # Use jquery and underscore from Debian package, so prune shipped one -rm -f doc/build/html/_static/jquery.js # Actually due to the problems with underscore pkg across releases just ship one for now #-rm -f doc/build/html/_static/underscore.js -rf -f doc/build/html/_sources -rf -f doc/build/html/.buildinfo : # Move documentation to -doc sdir=$(CURDIR)/doc/build/html ; \ tdir=$(PACKAGE_ROOT_DIR)-doc/usr/share/doc/$(PACKAGE_NAME)-doc ; \ mkdir -p $$tdir ; \ echo "DOCS: Moving '$$sdir' into '$$tdir'." ; \ test -d $$tdir/html || mv $$sdir $$tdir if [ -x /usr/bin/dh_numpy ]; then dh_numpy; fi ## immediately useable documentation and exemplar scripts/data override_dh_compress: dh_compress -X.py -X.html -X.pdf -X.css -X.jpg -X.txt -X.js -X.json -X.rtc override_dh_installdocs: dh_installdocs -A CONTRIBUTORS.txt README.txt DEVELOPMENT.txt TASKS.txt