#!/usr/bin/make -f

export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk
include /usr/share/mpi-default-dev/debian_defaults

HDF5_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)/$(ARCH_DEFAULT_MPI_IMPL)

# TODO:
# S3 doesn't compile right now : needs updating in Debian

BUILD_FLAGS = \
	-DPLANTUML_JAR_PATH=/usr/share/plantuml \
	-DBACKEND_KDSA_DUMMY=On \
	-DBACKEND_PMEM=On \
	-DBACKEND_S3=Off \
	-DENABLE_HDF5=On \
	-DENABLE_MPI=On \
	-DBACKEND_POSIX=On

%:
	dh $@ --buildsystem=cmake --builddirectory=debian/build

override_dh_auto_configure:
	dh_auto_configure -- ${BUILD_FLAGS} 


override_dh_auto_test:
	dh_auto_test || echo "Ignoring test failures"

override_dh_auto_build:
	dh_auto_build
	cd debian/build && doxygen

override_dh_auto_install:
	dh_auto_install
	chrpath -d debian/tmp/usr/lib/*.so debian/tmp/usr/bin/*
