#!/usr/bin/make -f
#PYVERS := $(shell pyversions -i)
#VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-+]+).*,\1,p')

override_dh_auto_install:
	dh_auto_install
	cd debian/pyspread/usr/share/pyspread && mv locale ..
	rm -rf debian/pyspread/usr/share/pyspread/__init__.py
	rm -rf debian/pyspread/usr/share/pyspread-*.egg-info
	rm debian/pyspread/usr/share/pyspread/pyspread
	cp debian/pyspread/usr/share/pyspread/src/pyspread.py debian/pyspread/usr/share/pyspread/pyspread
	chmod 755 debian/pyspread/usr/share/pyspread/pyspread

export PYBUILD_NAME=pyspread
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/ --install-scripts=/usr/share/ --root=debian/pyspread
export PYBUILD_DISABLE_python2=test

override_dh_python:
	dh_python --shebang=/usr/bin/python

%:
	dh $@ --with python2 --buildsystem=pybuild --ext-sub-pattern=__pycache__
