Files
scikit-image/debian/rules
T
Julian Taylor 7e13028ca0 update packaging to use dh_sphinxdoc and dh_python2
requires search-html.patch to fix file so dh_sphinxdoc recognises it
2013-06-10 21:21:21 +02:00

70 lines
2.1 KiB
Makefile
Executable File

#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
PACKAGE_NAME = python-skimage
PACKAGE_ROOT_DIR = $(CURDIR)/debian/${PACKAGE_NAME}
PYVERS = $(shell pyversions -vr)
PYVER = $(shell pyversions -vd)
export MPLCONFIGDIR=$(CURDIR)/build
export HOME=$(CURDIR)/build
# Mega rule
%:
dh $@ --with python2,sphinxdoc --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
# Assure Agg backend for matplotlib to avoid any possible complication
override_dh_auto_configure:
mkdir -p $(MPLCONFIGDIR)
echo "backend : Agg" >| $(MPLCONFIGDIR)/matplotlibrc
dh_auto_configure
# 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; \
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$*/*-packages/skimage
else
: # Skip unittests due to nocheck
endif
: # Move platform-specific libraries into -lib
set -e; 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
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.md DEVELOPMENT.txt TASKS.txt