#!/usr/bin/make -f

DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    PARALLEL := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    PROVEFLAGS += -j$(PARALLEL)
endif

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --enable-dependency-tracking --with-libpath=no V=1 PROVEFLAGS="$(PROVEFLAGS)"

override_dh_auto_install:
	dh_auto_install --parallel
	echo /usr/lib/$(DEB_HOST_MULTIARCH)/fakechroot > debian/libfakechroot/etc/ld.so.conf.d/fakechroot-$(DEB_HOST_MULTIARCH).conf
