#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

DEB_INSTALL_CHANGELOGS_ALL       = docs/CHANGES.txt
DEB_COMPRESS_EXCLUDE		:= .py .pdf
DEB_PYTHON_INSTALL_ARGS_ALL 	+= --single-version-externally-managed
DEB_DESTDIR			 = $(CURDIR)/debian/python-chaco
PYSHARED			 = $(DEB_DESTDIR)/usr/lib/python2.?
EXAMPLES			 = $(DEB_DESTDIR)/usr/share/doc/python-chaco

install/python-chaco::
	find $(DEB_DESTDIR) -name "*LICENSE*" -delete
	dh_numpy

binary-predeb/python-chaco::
	$(RM) $(DEB_DESTDIR)/usr/share/doc/python-chaco/CHANGES.txt.gz
	find $(EXAMPLES) -type f -print0 | xargs -0 sed -i '/^#!/d'
	find $(PYSHARED) -type f -print0 | xargs -0 chmod 644
	find $(EXAMPLES) -type f -print0 | xargs -0 chmod 644
	find $(EXAMPLES) -name "*LICENSE*" -delete

get-orig-source:
	-uscan --force-download --rename
