#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND = -DSSHD_SERVICE=\"ssh.service\"
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs

DISTRIBUTOR_LOGO := /usr/share/icons/regolith-logo.png
DISTRIBUTOR_LOGO_DARK := /usr/share/icons/regolith-logo.png
ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el s390x hppa powerpc powerpcspe ppc64))
MALCONTENT := -Dmalcontent=true
else
MALCONTENT := -Dmalcontent=false
endif

# KG: enabling snap fails kinetic build due to dep issue at Meson level
#ifeq ($(DEB_HOST_ARCH_OS),linux)
#SNAP := -Dsnap=true
#else
SNAP := -Dsnap=false
#endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
		-Dprivileged_group=sudo \
		-Ddocumentation=true \
		-Ddistributor_logo=$(DISTRIBUTOR_LOGO) \
		-Ddark_mode_distributor_logo=$(DISTRIBUTOR_LOGO) \
		$(MALCONTENT) \
		$(SNAP)

# KG: following causes dh_installation error on kinetic
# Ubuntu-specific
#override_dh_translations:
#	dh_translations --domain=gnome-control-center-2.0
