#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure --builddirectory=build-qt6 -- \
		-DENABLE_TESTS=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON) \
		-DENABLE_UBUNTU_COMPAT=OFF \
		-DENABLE_QT6=ON \
		-DBUILD_LIBCONNECTIVITY_ONLY=ON
	dh_auto_configure --builddirectory=build-qt5 -- \
		-DENABLE_TESTS=$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),OFF,ON) \
		-DENABLE_UBUNTU_COMPAT=OFF \
		-DENABLE_QT6=OFF \
		-DBUILD_LIBCONNECTIVITY_ONLY=OFF

override_dh_auto_build:
	dh_auto_build --builddirectory=build-qt6
	dh_auto_build --builddirectory=build-qt5

override_dh_auto_test:
	dh_auto_build --no-parallel --builddirectory=build-qt6
	dh_auto_build --no-parallel --builddirectory=build-qt5

override_dh_auto_install:
	dh_auto_install --builddirectory=build-qt6
	dh_auto_install --builddirectory=build-qt5
	rmdir debian/tmp/usr/share/doc/lomiri-indicator-network/qml/html/images/

override_dh_auto_clean:
	dh_auto_clean --builddirectory=build-qt6
	dh_auto_clean --builddirectory=build-qt5

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