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

#export DH_VERBOSE=1

export PYBUILD_NAME=pycoast
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/pycoast/tests {build_dir}/*.png
export PYBUILD_TEST_ARGS=\
-k "not test_add_shapefiles_from_dict_agg \
and not test_add_shapefiles_from_dict_pil \
and not test_add_one_shapefile_from_cfg_agg \
and not test_add_one_shapefile_from_cfg_pil \
and not test_add_points_pil \
and not test_config_file_points_and_borders_pil \
and not test_add_cities_pil \
and not test_add_cities_cfg_pil \
and not test_add_cities_from_dict_pil \
and not test_add_grid_from_dict_pil \
and not test_eastern_shapes_pil \
and not test_western_shapes_pil \
and not test_no_h_scratch_pil \
and not test_no_v_scratch_pil \
and not test_add_cities_cfg_agg \
and not test_add_cities_from_dict_agg" \
$(CURDIR)/pycoast/tests

%:
	dh $@ --with python3,numpy3,sphinxdoc --buildsystem=pybuild

execute_after_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	env PYTHONPATH={build_dir} \
	http_proxy='http://127.0.0.1:9/' https_proxy='https://127.0.0.1:9/' \
	LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 \
	sphinx-build -N -E -T -b html docs/source $(CURDIR)/.pybuild/docs/html
	$(RM) -r $(CURDIR)/.pybuild/docs/html/.doctrees
	$(RM) -r $(CURDIR)/.pybuild/docs/html/_images
endif
