#!/usr/bin/make -f
# debian/rules file for the Debian GNU/Linux python-rpy2 package
# Copyright 2004 - 2018 by Dirk Eddelbuettel <edd@debian.org>

#buildvers       := $(shell pyversions -sv)
build3vers      := $(shell py3versions -sv)

version         := $(shell head -1 debian/changelog | perl -nle 'm/\((.*)-\d\)/ && print $$1')

showversion:
	@echo "Version is ${version}"

tarball:
	(cd .. && \
		tar czf ../$(project)_${version}.orig.tar.gz ./$(project) \
			--exclude=.svn --exclude=debian/ --exclude=.hg)

%:
	dh $@ --with python3

override_dh_auto_build:

override_dh_auto_install:
#	#dh_install -ppython-rpy2 
#	#set -e && for i in $(buildvers); do \
#	#  python$$i ./setup.py install --install-layout=deb --root $(CURDIR)/debian/python-rpy2; \
#	#done

	dh_install -ppython3-rpy2
	set -e && for i in $(build3vers); do \
	  python$$i ./setup.py install --install-layout=deb --root $(CURDIR)/debian/python3-rpy2; \
	done

override_dh_installdocs:
	dh_installdocs -a NEWS 

#override_dh_clean:
#	dh_clean
#	rm -rf $(CURDIR)/build
