#!/usr/bin/make -f
-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk

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

ifeq ($(DEB_HOST_ARCH_OS),linux)
ENABLE_SELINUX := -Dselinux=true
else
ENABLE_SELINUX := -Dselinux=false
endif

%:
	dh $@ --with gir,gnome

override_dh_autoreconf:
	dh_autoreconf --as-needed

override_dh_auto_configure:
	dh_auto_configure -- \
		-Ddocs=true \
		-Dextension=true \
		-Dpackagekit=true \
		$(ENABLE_SELINUX)

override_dh_strip:
	dh_strip --dbgsym-migration='nautilus-dbg (<< 3.20.0-1~)'

override_dh_auto_test:
# We (will eventually) run autopkgtest instead

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

override_dh_missing:
	dh_missing --fail-missing

# Needed by Ubuntu
override_dh_translations:
	ninja -C obj-$(DEB_HOST_GNU_TYPE) nautilus-pot
	dh_translations
