#!/usr/bin/make -f
# -*- makefile -*-

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

CHECK_HOME = $(CURDIR)/debian/tmp/home

CONFFLAGS := 	--with-systemduserunitdir=/usr/lib/systemd/user \
		--enable-introspection \
		--enable-appstream-util \
		--enable-applet \
		--enable-vala=no

%:
	dh $@ --with gir

override_dh_autoreconf:
	dh_autoreconf -- ./autogen.sh

override_dh_auto_configure:
ifeq (gnome-shell-extension-gpaste,$(filter gnome-shell-extension-gpaste,$(shell dh_listpackages)))
	dh_auto_configure -- $(CONFFLAGS) \
			     --enable-gnome-shell-extension
else
	dh_auto_configure -- $(CONFFLAGS) \
			     --disable-gnome-shell-extension
endif

override_dh_clean:
	dh_clean
	rm -f po/Makefile.in.in m4/intltool.m4 config.log

override_dh_auto_test:
ifeq (, $(filter nocheck, $(DEB_BUILD_OPTIONS)))
	mkdir -p -m0700 $(CHECK_HOME)
	XDG_RUNTIME_DIR=$(CHECK_HOME) dh_auto_test
endif
