#! /usr/bin/make -f 

export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

DH_VERBOSE := 1

export PYBUILD_NAME=cvxopt

%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/build cvxopt.egg-info

override_dh_install:
	dh_install
	find debian/python*-cvxopt -name cvxopt -type d -empty -delete

override_dh_auto_build-indep:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	# $(pyrun) 'make --directory=doc html latex'
	make --directory=doc html latex
	make --directory=doc/build/latex all-pdf
endif

override_dh_fixperms-indep:
	dh_fixperms -i
	find debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/examples -name "*.py" -exec chmod -x \{\} \;

override_dh_compress:
	dh_compress --exclude=.pdf
