#!/usr/bin/make -f
export DH_VERBOSE=1

# Increase dh_auto_test timeout for slow arch
# https://bugs.debian.org/987248
include /usr/share/dpkg/architecture.mk
ifneq (,$(findstring $(DEB_BUILD_ARCH), armhf arm64))
  export MOCHA_TIMEOUT=--timeout 4000
endif

%:
	dh $@

execute_before_dh_auto_build:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	$(MAKE) -C docs/ html
endif

execute_before_dh_auto_clean:
	rm -rf build*
	rm -f node_modules/rollup-plugin-*
	if [ -e package.json.save ]; then \
		mv package.json.save package.json; \
	fi
