#!/usr/bin/make -f

DH_VERBOSE := 1

DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')

export DEB_BUILD_MAINT_OPTIONS=+bindnow
export PYBUILD_NAME=pybedtools
export MATPLOTLIBRC=$(CURDIR)/debian/
export PYBUILD_TEST_ARGS=--attr '!url'
export PYBUILD_BEFORE_TEST=cp {dir}/debian/mpl-expected.png {build_dir}/pybedtools/test/
export HOME=$(shell echo $$PWD"/fakehome")

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

override_dh_auto_build:
	dh_auto_build
	python3 setup.py develop --user
	python3 setup.py build_sphinx

override_dh_auto_install:
	dh_auto_install
	rm debian/python3-pybedtools/usr/lib/python3*/dist-packages/pybedtools/test/prevent_open_file_regression
