#!/usr/bin/make -f

# Jammy's setuptools (59.6) cannot read PEP 621 metadata from pyproject.toml,
# so this build uses the setup.py shim shipped in this debian directory and
# hides pyproject.toml so pybuild takes the classic distutils/setuptools path.

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

execute_before_dh_auto_clean:
	cp debian/setup.py setup.py
	[ ! -f pyproject.toml ] || mv pyproject.toml pyproject.toml.disabled

execute_before_dh_auto_configure:
	cp debian/setup.py setup.py
	[ ! -f pyproject.toml ] || mv pyproject.toml pyproject.toml.disabled

override_dh_clean:
	dh_clean
	rm -rf dist MANIFEST

override_dh_compress:
	dh_compress -Xexamples
