#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

ifeq ($(DEB_BUILD_ARCH), $(filter $(DEB_BUILD_ARCH), armhf))
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
endif

PACKAGE = $(firstword $(shell dh_listpackages))
TMP     = $(CURDIR)/debian/$(PACKAGE)

%:
	dh ${@} --parallel --with python2

override_dh_auto_install:
	dh_auto_install -- DESTDIR="$(CURDIR)/debian/criu" PREFIX="/usr" LIBEXECDIR="/usr/lib"

override_dh_auto_test:
	# disabled: doesn't work yet

override_dh_strip:
	dh_strip --ddeb-migration='criu-dbg (<< 1.8-2~)'
