#! /usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME=inkcut
export PYBUILD_AFTER_BUILD=/usr/lib/qt5/bin/lrelease {dir}/inkcut/res/translations/*.ts
export PYBUILD_INSTALL_ARGS=--install-lib /usr/share/inkcut
export PYBUILD_TEST_PYTEST=1
ifeq ($(PYBUILD_AUTOPKGTEST),1)
export PYTHONPATH=/usr/share/inkcut
else
export PYBUILD_TEST_ARGS=-k 'not test_app'
endif
export PYBUILD_DESTDIR_python3=debian/inkcut/

export QT_QPA_PLATFORM=offscreen

%:
	dh $@ --with python3 --buildsystem=pybuild

execute_after_dh_auto_build:
	pod2man -c "User Commands" --release "Inkcut $(DEB_VERSION_UPSTREAM)" --section 1 debian/inkcut.pod > debian/inkcut.1

execute_after_dh_auto_install:
	enamlclean debian/inkcut/usr/share/inkcut/inkcut/
	mv debian/inkcut/usr/bin/inkcut debian/inkcut/usr/share/inkcut/run
	rm -r debian/inkcut/usr/share/inkcut/inkcut/res/
