#!/usr/bin/make -f

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

export PYBUILD_NAME=pylibdmtx

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

override_dh_auto_install:
	dh_auto_install
	$(RM) debian/python3-pylibdmtx/usr/bin/read_datamatrix.py
	$(RM) debian/python3-pylibdmtx/usr/bin/write_datamatrix.py

override_dh_installman:
	docbook-to-man debian/manpage.read_datamatrix.sgml > read_datamatrix.1
	docbook-to-man debian/manpage.write_datamatrix.sgml > write_datamatrix.1
	dh_installman

override_dh_gencontrol:
	dh_gencontrol -- \
	  -Vlib:Depends=$(shell dpkg-query -W -f '$${Depends}' libdmtx-dev \
			| sed -E 's/.*(libdmtx[[:alnum:].-]+).*/\1/')
