#!/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

export CFLAGS=$(shell pkg-config --cflags hdf5)
export LDFLAGS=$(shell pkg-config --libs hdf5)

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

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
