#!/usr/bin/make -f

VERSION=$(shell debian/vercheck)

# Work around to latex2html bug #368693
export RGBDEF=/usr/share/latex2html/styles/rgb.txt

%:
	dh --with python2 $@


# DEB_PYTHON2_MODULE_PACKAGES := provami
# 
# #DEB_MAKE_CHECK_TARGET := check
# 
# # From http://wiki.debian.org/DebianPython/NewPolicy
# binary-install/python-dballe::
# 	rm -f $(CURDIR)/debian/python-dballe/usr/share/pyshared/_dballe.la
# 	rm -f $(CURDIR)/debian/python-dballe/usr/lib/python?.?/dist-packages/_dballe.la

# Temporarily disabled, I'm afraid of #620104
#override_dh_fixperms:
#	dh_fixperms
#	test -e /usr/bin/dh_buildinfo && dh_buildinfo

override_dh_auto_install:
	dh_auto_install
	# Build and install the python bindings for each different python version
	for ver in `pyversions -vr`; do \
		dh_auto_configure -- PYTHON=/usr/bin/python$$ver ; \
		make clean -C swig ; \
		make install -C swig DESTDIR=`pwd`/debian/tmp ; \
	done
	# Remove python modules .la files
	rm -f debian/tmp/usr/lib/python*/dist-packages/*.la

vercheck:
	debian/vercheck > /dev/null

debsrc: vercheck
	git-buildpackage -S -us -uc
