#!/usr/bin/make -f

# Recommendations in https://wiki.debian.org/Hardening, motivated by lintian warnings.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# To run the first test program in `make check', mpirun is called.
# This may fail if run as root, e.g. during automated building in
# a chroot gaol. So for debian builds, running mpirun - on a single
# processor - is allowed.
export MPI_ALLOW_RUN_AS_ROOT = --allow-run-as-root

%:
	dh $@  --with autotools-dev

# https://lintian.debian.org/tags/binary-or-shlib-defines-rpath.html
# https://wiki.debian.org/RpathIssue
# TODO: Where is r(un)path inserted in upstream? [not obvious]
override_dh_install:
	chrpath -d $(CURDIR)/debian/mpgrafic/usr/bin/mpgrafic
	dh_install
