#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4

# limit the build on qt6 to arches
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
#ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armhf ppc64el riscv64 s390x))
#        meson_opts += -Dqt6=true -Dqml-bindings=true
#else
#        meson_opts += -Dqt6=false -Dqml-bindings=false
#endif

ifneq (,$(filter $(DEB_HOST_ARCH), i386))
        meson_opts += -Dqt6=false -Dqml-bindings=false
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(meson_opts)

override_dh_auto_test:
	dh_auto_test --no-parallel

execute_before_dh_install:
	mkdir -p debian/tmp/usr/share/doc/libsnapd-glib-dev/
	mv debian/tmp/usr/share/gtk-doc/html/snapd-glib debian/tmp/usr/share/doc/libsnapd-glib-dev/html

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
