#!/usr/bin/make -f

# Get the supported Python versions
PYVERS = $(shell pyversions -r -v)
# Get the default Python version
PYVERSION = $(shell pyversions -d -v)

export INSTALLDIRS=vendor

override_dh_auto_configure:
	[ -f configure ] || autoreconf -fi
	dh_auto_configure

override_dh_auto_clean:
	$(MAKE) distclean || true
	rm -f configure

override_dh_auto_install:
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	find debian/tmp/ -name "*.pyc" | xargs rm -f
	find debian/tmp/ -name "*.pyo" | xargs rm -f
	mkdir debian/tmp/usr/share
	mv debian/tmp/usr/lib/perl5 debian/tmp/usr/share/perl5

%:
	dh $* --with python2
