#!/usr/bin/make -f
%:
	dh $@ --with python2 --with quilt

override_dh_auto_build:
	# Building docs
	sh debian/scripts/gendoc.sh

override_dh_install:
	dh_install
	dh_python2
	if [ -d "debian/makehuman-data" ]; then \
	    echo "Deleting files"; \
	    rm -f $(CURDIR)/debian/makehuman-data/usr/share/makehuman/license.txt ; \
	    find  $(CURDIR)/debian/makehuman-data/usr/share/makehuman/ -name \*.pyc -exec rm -rf {} \; ; \
	    find  $(CURDIR)/debian/makehuman-data/usr/share/makehuman/ -name \*.target -exec rm -rf {} \; ; \
	    find  $(CURDIR)/debian/makehuman-data/usr/share/makehuman/ -name \*.obj -exec rm -rf {} \; ; \
	    find  $(CURDIR)/debian/makehuman-data/usr/share/makehuman/ -type d -empty -delete ; \
	fi
	if [ -d "debian/makehuman-doc" ]; then \
	    echo "Deleting files"; \
	    rm -f $(CURDIR)/debian/usr/share/makehuman-doc/html/_static/underscore.js ; \
	    rm -f $(CURDIR)/debian/usr/share/makehuman-doc/html/_static/jquery.js ; \
	fi

override_dh_auto_clean:
	rm -rf $(CURDIR)/docs/sphinx/build/*
	rm -f $(CURDIR)/makehuman/lib/getpath.pyc $(CURDIR)/makehuman/makehuman.pyc
	dh_auto_clean
