#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

# one ring to rule them all ...
%:
# need to enforce distutils, since we also have a makefile
	dh $@ --buildsystem=python_distutils --builddirectory=build

# enable when we believe that the tests should pass
#override_dh_auto_test:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	for buildver in $(shell pyversions -vr); do \
#		echo "I: Running NiBabel unittests using python$$buildver"; \
#		$(MAKE) unittest PYTHON=python$$buildver || exit 1 ;\
#	done
#endif

## immediately useable documentation
## and exemplar data (they are small excerpts anyway)
override_dh_compress:
	dh_compress -X.py -X.html -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -X.par -X.bin

override_dh_installman:
	PYTHONPATH=build/lib:$(PYTHONPATH) help2man -N \
		-n 'convert PARREC image to NIfTI' bin/parrec2nii > build/parrec2nii.1
	dh_installman build/parrec2nii.1

override_dh_clean:
	-rm -rf build
	dh_clean
