#!/usr/bin/make -f

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

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

ifeq ($(filter nodoc, $(DEB_BUILD_PROFILES)),)
	ENABLE_DOCS = --enable-docs
else
	ENABLE_DOCS = --disable-docs
endif

%:
	dh $@ --with gir

override_dh_auto_configure:
	dh_auto_configure -- $(ENABLE_DOCS) --enable-openmp

# Tests are known to be flaky on armel, see #1103376
override_dh_auto_test:
ifeq (,$(filter armel, $(DEB_HOST_ARCH)))
	dh_auto_test
endif

execute_before_dh_install:
	find debian/tmp -name '*.la' -print -delete
	find debian/tmp -name jquery.js -print -delete
	find debian/tmp -name underscore.js -print -delete

# Symbols need to be carefully reviewed for this library.
override_dh_makeshlibs:
	dh_makeshlibs -- -c4
