#!/usr/bin/make -f
#export DH_VERBOSE=1

%:
	dh $@ --with python2

override_dh_auto_install:
	dh_auto_install
	find debian/*/ -name '_bbox_*.so' -delete
	find debian/*/ -name '*.egg-info' -delete
	cd debian/*/usr/bin/ && \
		rename.ul '.py' '' ocr4gamera.py && \
		sed -i -e '1s,^#!.*,#!/usr/bin/python,' ocr4gamera

override_dh_installdocs:
	rm -rf doc/html/
	cd doc && python gendoc.py
	dh_installdocs
	cd debian/*/usr/share/doc/*/html/ && \
		$(CURDIR)/debian/symlink-helper ../src/ .

override_dh_installman:
	rst2man debian/ocr4gamera.rst > debian/ocr4gamera.1
	dh_installman debian/*.[1-9]

override_dh_compress:
	dh_compress -X.txt # saves doc sources
