#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

XPI_MODULE_VERS = $(DEB_VERSION)
%:
	dh $@ --with xul-ext,autoreconf

override_dh_install:
	install-xpi -penigmail build/*.xpi

override_dh_auto_configure:
	dh_auto_configure -- --with-tb-path=/usr/bin/thunderbird --with-tb-args='--profile $(shell pwd)/test-profile'

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	debian/run-tests
endif

override_dh_auto_clean:
	# if config/autoconf.mk is not present, create stub of it, such that make distclean works
	if [ ! -f config/autoconf.mk ]; then \
		echo 'DIST = $$(DEPTH)/build/dist' > config/autoconf.mk; \
		echo 'BUILD = $$(DEPTH)/build' >> config/autoconf.mk; \
	fi

	dh_auto_clean
