#!/usr/bin/make -f

export DH_VERBOSE=1

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)

# The magic debhelper  rule
%:
	dh $@ --buildsystem=cmake --no-parallel

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
# DISABLED_TESTS:= "powerpc alpha"

override_dh_auto_configure:
	        CC=mpicc FC=mpifort dh_auto_configure

override_dh_auto_test:
ifneq (,$(findstring  "$(DEB_HOST_ARCH)",$(DISABLED_TESTS)))
	@echo "Tests disabled on this arch: known failures being investigated"
else
	@echo "Tests may hang/timeout due to lack of processors. "
	-dh_auto_test --timeout 30
endif
