#!/usr/bin/make -f

export DH_VERBOSE=1

export PYBUILD_NAME=ford
export PYBUILD_SYSTEM=pyproject
export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)

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

# The magic debhelper  rule
%:
	dh $@ --buildsystem=pybuild --with python3,sphinxdoc

execute_after_dh_auto_clean:
	rm -rf FORD.egg-info ford/_version.py ford/js/MathJax-config/.gitignore

execute_after_dh_auto_install:
	find debian -name *.ttf -delete
	(find debian -name __pycache__ -exec rm -rf {} \; || true)
	cp -a ford/favicon.png ford/css ford/js ford/search ford/webfonts ford/templates debian/ford/usr/lib/python*/dist-packages/ford
