#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# magic debhelper rule
%:
	dh $@ --with python2,python3

override_dh_auto_install:
	python2 setup.py install --install-layout=deb \
	    --root $(CURDIR)/debian/python-fparser
	set -e && for py3vers in $(shell py3versions -sv); do \
	  python$$py3vers setup.py install --install-layout=deb \
	    --root $(CURDIR)/debian/python3-fparser; \
	  done
	-find . -name __pycache__ -exec rm -rf {} \;


override_dh_auto_clean:
	# dh_auto_clean avoid bug where this calls python, not python3
	python3 setup.py clean
	rm -fr build src/fparser.egg-info
