#!/usr/bin/make -f

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

%:
	dh $@ --without single-binary

override_dh_auto_configure:
	dh_auto_configure -- \
		-Dmanpage=$(if $(filter nodoc,$(DEB_BUILD_OPTIONS)),false,true)

# Fixes blhc failure as seen in Salsa CI
# We already build in the build step so there shouldn't be
# a reason for meson to need to rebuild in the install step
override_dh_auto_install:
	dh_auto_install -- --no-rebuild

execute_after_dh_installdocs:
	appstreamcli metainfo-to-news debian/gnome-contacts/usr/share/metainfo/org.gnome.Contacts.metainfo.xml \
		debian/gnome-contacts/usr/share/doc/gnome-contacts/NEWS
