Files
scikit-image/debian/rules
T
Yaroslav Halchenko becf1b7ac3 PKG: actually we should only care about "requested" not all "supported" python version
otherwise it will try to build for python2.5 on squeeze
2012-05-03 21:44:51 -04:00

67 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)
# 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)
: # 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
-rm -rf doc/build/html/_sources
-rm -f doc/build/html/.buildinfo
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.rst DEVELOPMENT.txt TASKS.txt