#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
PYVERS=$(shell pyversions -sv)
PY3VERS=$(shell py3versions -sv)
export PYBUILD_NAME=yapf

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

override_dh_auto_install:
	dh_auto_install

	set -e && for pyvers in $(PYVERS); do \
                python$$pyvers setup.py install --install-layout=deb \
                --root $(CURDIR)/debian/yapf; \
                done

	set -e && for pyvers in $(PY3VERS); do \
                python$$pyvers setup.py install --install-layout=deb \
                --root $(CURDIR)/debian/yapf3; \
                done

	mv $(CURDIR)/debian/yapf3/usr/bin/yapf $(CURDIR)/debian/yapf3/usr/bin/yapf3

