#!/usr/bin/make -f
# -*- makefile -*-

export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)

LDFLAGS+=-Wl,--as-needed

%:
	dh $@ --buildsystem=meson --with=gir,translations

override_dh_makeshlibs:
	dh_makeshlibs -V -- -c4

override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=/usr/lib/accountsservice \
		-Dgtk_doc=true \
		-Dsystemd=true \
		-Dsystemdsystemunitdir=/lib/systemd/system \
		-Dgdmconffile=/etc/gdm3/custom.conf

# Disabled to avoid FTBFS
override_dh_auto_test:

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_strip:
	dh_strip -plibaccountsservice0 --dbgsym-migration='libaccountsservice-dbg (<< 0.6.40-4~)'
	dh_strip --remaining-packages
