#!/usr/bin/make -f

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

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

override_dh_auto_configure:
	dh_auto_configure -- \
		-Dunicode_support=unistring \
		-Dfts=true \
		-Dstemmer=yes \
		-Ddocs=true \
		-Dfunctional_tests=true \
		-Dnetwork_manager=no \
		-Dsystemd_user_services=/usr/lib/systemd/user \
		--libexecdir=/usr/lib/tracker

# These libraries don't have the symlinks with the meson build yet
# override_dh_install:
#	find debian/tmp -name libtracker-common.so -print -delete
#	find debian/tmp -name libtracker-data.so -print -delete
#	dh_install

override_dh_missing:
	dh_missing --fail-missing

# Enforce tight shlibs dependencies
override_dh_makeshlibs:
	dh_makeshlibs -V -X/usr/lib/$(DEB_HOST_MULTIARCH)/tracker-2.0/ -- -c4

override_dh_strip:
	dh_strip --dbgsym-migration='tracker-dbg (<< 1.7.4-1~)'

override_dh_auto_test:
	dbus-run-session -- dh_auto_test || true
