#!/usr/bin/make -f

export PYBUILD_NAME=nbstripout
export PYBUILD_TEST_PYTEST=0

PY3VER_DEFAULT := $(shell py3versions -dv)

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_install:
	dh_auto_install
	mkdir -p debian/nbstripout/usr
	mv $(CURDIR)/debian/python3-nbstripout/usr/bin $(CURDIR)/debian/nbstripout/usr/

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_install:
	PATH=$(CURDIR)/debian/nbstripout/usr/bin:${PATH} PYTHONPATH=$(CURDIR)/debian/python3-nbstripout/usr/lib/python$(PY3VER_DEFAULT)/dist-packages:${PYTHONPATH} python3 -m pytest
endif
