#!/usr/bin/make -f

NULL =

include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

%:
	dh $@ --with gir

override_dh_auto_configure:
	dh_auto_configure -- \
	        -DENABLE_TESTS=ON \
	        $(NULL)

override_dh_auto_test:
	mkdir -p $(CURDIR)/debian/tmphome/.local/share
	mkdir -p $(CURDIR)/debian/tmphome/.cache
	export HOME=$(CURDIR)/debian/tmphome \
	    && export XDG_DATA_HOME=$(CURDIR)/debian/tmphome/.local/share \
	    && export XDG_CACHE_HOME=$(CURDIR)/debian/tmphome/.cache \
	    && unset DBUS_SESSION_BUS_ADDRESS \
	    && dh_auto_test --no-parallel
	rm -Rf $(CURDIR)/debian/tmphome

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
