#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/dpkg/architecture.mk
ifneq (,$(filter $(DEB_BUILD_ARCH),s390x))
export PYBUILD_DISABLE=test
endif

export PYBUILD_NAME=zarr
export PYBUILD_TEST_ARGS=\
--hypothesis-profile ci \
-k "not is_empty"

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	cd $(shell pybuild --build -i python3 -s custom --build-args 'echo {build_dir}') && \
	PYTHONPATH=. \
	LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 \
	sphinx-build -N -E -T -b html $(CURDIR)/docs $(CURDIR)/.pybuild/docs/html
	rm -rf $(CURDIR)/.pybuild/docs/html/.doctrees
endif
