#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk # DEB_VERSION

# python-prance
export PYBUILD_TEST_ARGS= -k 'not test_validation and not test_validation_failed and not test_openapi_special_yaml_keywords and not test_openapi_parser_parse_remote_ref'

%:
	dh $@ --buildsystem=pybuild

B = $(CURDIR)/debian/tmp/usr/bin
M = $(CURDIR)/debian/tmp/usr/share/man/man1

execute_after_dh_auto_install:
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
	mkdir -pv $(M)
	env PYTHONPATH=$(CURDIR)/src \
		help2man --no-info --version-string="$(DEB_VERSION)" \
		--help-option="--no-color --help" \
		-Idebian/datamodel-codegen.h2m \
		$(B)/datamodel-codegen -o $(M)/datamodel-codegen.1
endif
