#!/usr/bin/make -f

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

%:
	dh $@ --with gnome

ifeq (linux,$(DEB_HOST_ARCH_OS))
CONFFLAGS = -Dsystemd=true -Dsystemd_journal=true -Dsystemd_session=enable
else
CONFFLAGS = -Dsystemd=false -Dsystemd_journal=false -Dsystemd_session=disable
endif

override_dh_auto_configure:
	dh_auto_configure -- \
		-Dman=true \
		$(CONFFLAGS)

override_dh_auto_install:
	dh_auto_install
	# Remove this when gdm3 and gnome-control-center have caught up
	mkdir -p debian/tmp/usr/lib/gnome-session
	( cd debian/tmp/usr/lib/gnome-session && ln -s ../../libexec/* . )

