#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE = 1

export PYBUILD_NAME = qtawesome

ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
%:
	dh $@ --with sphinxdoc --buildsystem=pybuild

execute_after_dh_auto_build:
	PYTHONPATH=. python3 -m sphinx -N -b html docs/source build/html

execute_after_dh_auto_install:
	# This script only makes sense on Windows
	rm -f debian/python3-qtawesome/usr/bin/qta-install-fonts-all-users

override_dh_installdocs:
	dh_installdocs -ppython-qtawesome-doc --doc-main-package=python3-qtawesome
	dh_installdocs --remaining-packages

override_dh_installexamples:
	dh_installexamples -ppython-qtawesome-doc --doc-main-package=python3-qtawesome
	dh_installexamples --remaining-packages
else
%:
	dh $@ --buildsystem=pybuild
endif

# We only check with PyQt6 and PySide 6 as PyQt5 is end-of-life
# and will soon be dropped from Debian.
override_dh_auto_test:
	QT_API=pyqt6 dh_auto_test --buildsystem=pybuild
	QT_API=pyside6 dh_auto_test --buildsystem=pybuild
