#!/usr/bin/make -f

DEB_LDFLAGS_MAINT_APPEND := -Wl,-z,defs
DEB_CFLAGS_MAINT_APPEND  := $(shell getconf LFS_CFLAGS)
DEB_BUILD_MAINT_OPTIONS  := hardening=+bindnow
export DEB_LDFLAGS_MAINT_APPEND DEB_CFLAGS_MAINT_APPEND DEB_BUILD_MAINT_OPTIONS
ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH_OS),hurd)
DEB_LDFLAGS_MAINT_APPEND += -lpthread
endif

DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

LC_COLLATE=C
export LC_COLLATE

%:
	dh $@

override_dh_auto_configure:
	# Explicitly set libdir, sbindir to avoid upstream's override logic.
	dh_auto_configure  -- \
--default-library=both \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--sbindir=/usr/sbin \
		-Disadir=/usr/lib/security \
		-Dsystemdunitdir=/usr/lib/systemd/system \
		-Dnis=disabled \
		-Dusergroups=true \
		$(meson_OPTS)
