#!/usr/bin/make -f

export PYBUILD_NAME = vici
# setup.py only exists once the rule below has run, so pybuild cannot sniff the
# build system during clean -- name it explicitly.
export PYBUILD_SYSTEM = distutils

# Upstream ships setup.py.in and substitutes the version from configure; there
# is no configure run here, so do the one substitution ourselves.
UPSTREAM_VERSION = 6.0.1

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

setup.py: setup.py.in
	sed -e 's:@EGG_VERSION@:$(UPSTREAM_VERSION):' $< > $@

override_dh_auto_configure: setup.py
	dh_auto_configure

# Deliberately does not call dh_auto_clean: that would run pybuild, which needs
# the setup.py this target is removing.
override_dh_auto_clean:
	rm -rf setup.py vici.egg-info .pybuild
