#!/usr/bin/make -f
#export DH_VERBOSE = 1

export PYBUILD_INSTALL_ARGS=--install-lib=/usr/lib/python3/dist-packages

PKD = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG = $(shell dpkg-parsechangelog -l$(PKD)/changelog --show-field=Source)
VER ?= $(shell (dpkg-parsechangelog -l$(PKD)/changelog | grep Version | sed 's/Version..//' | sed 's/-.\+//'))


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

override_dh_clean:
	dh_clean
	rm -rf aioprocessing.egg-info

override_dh_install:
	dh_install
	rm -rf debian/python3-aioprocessing/usr/lib/python3/dist-packages/aioprocessing/__pycache__


get-orig-source:  $(info I: $(PKG)_$(VER))
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
