#! /usr/bin/make -f

export PYBUILD_NAME=canmatrix
export PYBUILD_BEFORE_TEST=mkdir -p {build_dir}/tests; cp -arv {dir}/tox.ini {dir}/tests {build_dir}/
export PYBUILD_AFTER_TEST=rm -vf {build_dir}/coverage.lcov {build_dir}/tox.ini
export PYBUILD_AFTER_INSTALL=mv {destdir}/usr/bin/ .pybuild/utils/
DH_PYTHON_OPTIONS = \
		--recommends-section=arxml \
		--recommends-section=dbc \
		--recommends-section=dbf \
		--recommends-section=fibex \
		--recommends-section=json \
		--recommends-section=kcd \
		--recommends-section=sym \
		--recommends-section=xls \
		--recommends-section=xlsx \
		--recommends-section=yaml \
		--shebang=/usr/bin/python3 \
		$(empty)

%:
	dh $@ --buildsystem=pybuild

override_dh_python3:
	dh_python3 $(DH_PYTHON_OPTIONS)

DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
        debian/.*|test/reference/from_arxml/test_CAN\.xlsx
# licensecheck v1
.PHONY: licensecheck
licensecheck:
	LANG=C.UTF-8 licensecheck \
		-i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \
		--check '.*' --recursive --deb-machine --lines 0 * \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints