#!/usr/bin/make -f # -*- mode: makefile; coding: utf-8 -*- export DH_VERBOSE=1 debver = $(shell LC_ALL=C dpkg-parsechangelog | grep '^Version:' | cut -d ' ' -f 2,2 ) uver = $(shell echo $(debver) | sed -e 's,-[^-]*$$,,g' ) PYVER = $(shell pyversions -vd) # To fix distutils fragile nature: when seing LDFLAGS=, which is set # by dpkg-buildpackage it stops providing -shared flag, so for the # minimalistic fix (alternative to NMU-ed #535699 with explicit # -shared) we just unexport LDFLAGS unexport LDFLAGS # Mega rule %: dh $@ --buildsystem=python_distutils --with=python2 override_dh_auto_test: : # Do not test just after build, lets install and then test override_dh_auto_build: dh_auto_build echo "backend : Agg" >| build/matplotlibrc manpages: @echo "I: generating manpages" set -e; mkdir -p build/manpages && \ cd scripts && for f in *; do \ descr=$$(grep -h -e "^ *'''" -e 'DESCRIP =' $$f | sed -e "s,.*' *\([^'][^']*\)'.*,\1,g" | head -n 1); \ PYTHONPATH=../ \ help2man -n "$$descr" --no-discard-stderr --no-info --version-string "$(uver)" "python ./$$f" \ >| ../build/manpages/$$f.1; \ done # # Documentation # doc-stamp: : # I: Generate documentation export PYTHONPATH=$$PWD/`/bin/ls -d build/lib.*$(PYVER)` \ PATH=$(CURDIR)/debian/tmp/usr/bin/:$$PATH \ MPLCONFIGDIR=$(CURDIR)/build HOME=$(CURDIR)/build; \ cd doc; $(MAKE) html : # I: Use jquery from Debian package -rm doc/build/html/_static/jquery.js touch $@ #override_dh_auto_install: # dh_auto_install test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) : # I: Unittest only the default python version for now against "installed" materials cd debian; \ PATH=$(CURDIR)/debian/tmp/usr/bin/:$$PATH \ PYTHONPATH=$$(/bin/ls -d $(CURDIR)/debian/tmp/usr/lib/python$(PYVER)/*-packages):$$PYTHONPATH \ MPLCONFIGDIR=$(CURDIR)/build \ ../tools/nipnost nipy else : # Skip unittests due to nocheck endif override_dh_install: test : # I: Move libraries into the python-nipy-lib and -lib-dbg packages find debian/tmp/ -iname *.so | \ while read so; do \ d=$$(dirname $$so); \ if [ $${so%_d.so} = $${so} ]; then suf=""; else suf="-dbg"; fi; \ d=$$(echo $$d | sed -e "s,debian/tmp/,debian/python-nipy-lib$$suf/,g"); \ mkdir -p $$d; echo "Moving $$so under $$d"; mv $$so $$d; \ done : # I: Move leftovers into python-nipy mkdir -p debian/python-nipy mv debian/tmp/* debian/python-nipy/ : # I: Fix up interpreter which might be -dbg one sed -i -e 's,/usr/bin/python-dbg,/usr/bin/python,g' debian/python-nipy/usr/bin/* : # I: Assure versioned dependency on NumPy if [ -x /usr/bin/dh_numpy ]; then dh_numpy; fi dh_install -rm debian/python-nipy-doc/usr/share/javascript/underscore/underscore.js ## immediately useable documentation and exemplar scripts/data override_dh_compress: : # I: Avoiding compression of what should not be compressed dh_compress -X.py -X.html -X.pdf -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -Xobjects.inv override_dh_installman: manpages dh_installman -ppython-nipy build/manpages/*.1 override_dh_clean: : # I: Custom cleaning rm -rf build doc-stamp nipy/neurospin/__config__.py $(MAKE) -C doc clean dh_clean # We build documentation only for -indep binary-indep: doc-stamp binary: binary-arch binary-indep