#!/usr/bin/make -f

%:
	dh $@ --with python2

override_dh_auto_configure:
	mkdir build-python$*
	cp -r build engine utils SConstruct setup.py test_fife.py build-python$*
	touch $@

override_dh_auto_build:
	python$* $(shell which scons) -C build-python$* fife-python $(SCONSOPTS)

override_dh_auto_test:
	#python$* $(shell which scons) -C build-python$* tests $(SCONSOPTS)

override_dh_auto_install:
	python$* $(shell which scons) -C build-python$* DESTDIR=$(CURDIR)/debian/python-fife install-python $(SCONSOPTS)
	find $(CURDIR)/debian/python-fife -name '*.so' -exec chrpath -d {} \;

override_dh_auto_clean:
	rm -fr build-python*
	dh_auto_clean

