#!/usr/bin/make -f

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

export PROG_UNZIP = bunzip2

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-Ddocs=$(if $(filter nodoc,$(DEB_BUILD_PROFILES)),false,true) \
		-Dgir=true \
		-Dvapi=true \
		-Ducd_path=/usr/share/unicode/

execute_after_dh_auto_install:
ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
	# Make sure these directories exist even with nodoc, so that we don't
	# need to use dh-exec in d/*-dev.install
	install -d debian/tmp/usr/share/gtk-doc
	install -d debian/tmp/usr/share/help
endif

override_dh_gencontrol:
	dh_gencontrol -- -VBuilt-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W unicode-data)"
