#!/usr/bin/make -f
%:
	dh $@

# Which MPI implementation?
# set ARCH_DEFAULT_MPI_IMPL
include /usr/share/mpi-default-dev/debian_defaults

export OMPI_MCA_orte_rsh_agent=/bin/false                #workaround to start MPI-applications in chroot
export DEB_CPPFLAGS_MAINT_APPEND := -I/usr/include/$(ARCH_DEFAULT_MPI_IMPL) -DOMPI_SKIP_MPICXX=1 -DMPICH_SKIP_MPICXX=1
export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed

override_dh_auto_clean:
	[ ! -f doc/html.dox/Makefile ] || make -C doc/html.dox maintainer-clean-local
	dh_auto_clean

override_dh_auto_configure:
	HDF5_VERSION=11000 dh_auto_configure -- --disable-python --with-hdf5=/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL) --with-hdf5-bin=/usr/bin

override_dh_auto_build-indep:
	dh_auto_build --builddirectory=doc/html.dox -- html-local
	dh_auto_build --builddirectory=doc

override_dh_auto_install-arch:
	dh_auto_install
	rm -rf $(CURDIR)/debian/tmp/usr/bin/test* \
         $(CURDIR)/debian/tmp/usr/bin/usescases \
         $(CURDIR)/debian/tmp/usr/bin/unittests

override_dh_auto_install-indep:
	dh_auto_install --builddirectory=doc

override_dh_install:
	dh_install
	rm -f debian/libmedc-dev/usr/include/*import*

override_dh_auto_test-arch:
	MPIEXEC="mpiexec --allow-run-as-root --oversubscribe -np " dh_auto_test --max-parallel=1

override_dh_auto_test-indep:
