#! /usr/bin/make -f

export DH_OPTIONS
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

INSTDIR = debian/tmp

%:
	dh $@ -Bbuild -Scmake --with python3

override_dh_auto_configure:
	dh_auto_configure -- \
		-DDOCS=ON \
		-DPYTHON=ON

# https://github.com/AcademySoftwareFoundation/Imath/issues/226
override_dh_auto_test-arch:
	dh_auto_test || true

override_dh_install:
	dh_numpy3 --package=python3-imath
	rm -f $(INSTDIR)/usr/share/doc/Imath/sphinx/_static/doctools.js
	rm -f $(INSTDIR)/usr/share/doc/Imath/sphinx/_static/jquery.js
	rm -f $(INSTDIR)/usr/share/doc/Imath/sphinx/_static/language_data.js
	rm -f $(INSTDIR)/usr/share/doc/Imath/sphinx/_static/searchtools.js
	rm -f $(INSTDIR)/usr/share/doc/Imath/sphinx/_static/underscore.js
	rm -f $(INSTDIR)/usr/share/doc/Imath/sphinx/.buildinfo
	rm -rf $(INSTDIR)/usr/share/doc/Imath/sphinx/.doctrees
	dh_install
