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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

BUILD_DOC:=-Ddocs=false
# only build if the profile nodoc is NOT set
ifeq ($(filter nodoc, $(DEB_BUILD_OPTIONS)),)
# and valadoc is installed
ifneq ($(shell which valadoc),)
  BUILD_DOC:=-Ddocs=true
endif
endif

ifneq ($(filter amd64 arm64 armel armhf i386 mips64el ppc64el riscv64 s390x hppa loong64 powerpc ppc64 sh4,$(DEB_HOST_ARCH)),)
SYSPROF = -Dprofiling=true
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- -Deds_backend=true \
		-Dimport_tool=true -Dinspect_tool=true -Dzeitgeist=false \
		-Dofono_backend=false -Dbluez_backend=false $(SYSPROF) $(BUILD_DOC)

override_dh_makeshlibs:
	dh_makeshlibs -plibfolks26 -X/backends/
	dh_makeshlibs -plibfolks-telepathy26 -X/backends/
	dh_makeshlibs -plibfolks-eds26 -X/backends/
	dh_makeshlibs -plibfolks-dummy26 -X/backends/

# Ignore test failures. See https://launchpad.net/bugs/2060073
override_dh_auto_test:
	dh_auto_test --no-parallel -- --timeout-multiplier 3 || true

override_dh_gnome_clean:
