#!/usr/bin/make -f
PYVERS = $(shell py3versions -rv)

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

# test suite is broken.
override_dh_auto_test:
#ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
#	set -e -x;\
#	for py in $(PYVERS); do \
#  TOXPYTHON=python$$py \
#  PYTHONPATH=$(CURDIR)/build/lib.*-$$py  python$$py ./setup.py test ;\
#  done
#endif

override_dh_auto_build:
	set -ex; for py in $(PYVERS); do \
	python$$py setup.py build; \
	done

override_dh_auto_install:
	dh_auto_install
# docs in just one place, /usr/share/doc/duplicity.
	rm -r debian/duplicity/usr/share/doc/duplicity-*

override_dh_clean:
	dh_auto_clean
	dh_clean
# the test suite leaves a mess behind 
	rm -f testing/gnupg/random_seed duplicity/_librsync*.so
	rm -rf .cache .eggs testing/testfiles build
