#!/usr/bin/make -f
export DH_VERBOSE=1
export DEB_BUILD_OPTIONS += noautodbgsym

include /usr/share/dpkg/architecture.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto

include /opt/3rdp4r7yr3p0/qt6.10/env.mk

%:
	dh $@ --buildsystem=cmake+ninja

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_PREFIX=/opt/3rdp4r7yr3p0/qt6.10 \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) \
		-DCMAKE_MESSAGE_LOG_LEVEL=STATUS

override_dh_shlibdeps:
	dh_shlibdeps \
		--dpkg-shlibdeps-params=--ignore-missing-info \
		-l$(CURDIR)/debian/o-qt6.10-networkauth-libs/opt/3rdp4r7yr3p0/qt6.10/lib/$(DEB_HOST_MULTIARCH)

override_dh_auto_build:
	dh_auto_build
	dh_auto_build -- docs

override_dh_auto_install:
	dh_auto_install
	DESTDIR=$(CURDIR)/debian/tmp dh_auto_build -- install_docs
	find $(CURDIR)/debian/tmp/opt/3rdp4r7yr3p0/qt6.10/share/doc -type f -name *.index -exec \
        sed -i 's@$(CURDIR)/@@g' {} \;

override_dh_missing:
	dh_missing -X.tags
