#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=h5py
export PYBUILD_AFTER_INSTALL_python2=dh_numpy
export PYBUILD_AFTER_INSTALL_python3=dh_numpy3

%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bhtml docs/ build/html

override_dh_auto_clean:
	dh_auto_clean
	$(RM) setuptools-0.6c9-py2.5.egg
	$(RM) h5py_config.pickle
	$(RM) h5py/config.pxi
	# Remove the cythonized .c files
	find h5py -iname *.pyx | sed -e 's,\.pyx,\.c,g' | xargs -r $(RM) -f
	$(RM) h5config.pkl
	$(RM) h5py/_hdf5.pxd 
	$(RM) h5py/defs.pxd
	$(RM) h5py/defs.pyx
