#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE=1
export DH_OPTIONS

export PYBUILD_NAME=sense-emu

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

override_dh_auto_install:
	dh_auto_install
	# Strip out binaries from the library packages (and move the py3 ones
	# into the sense-emu-tools package)
	rm -fr debian/python-sense-emu/usr/bin
	mkdir -p debian/sense-emu-tools/usr/bin
	mv debian/python3-sense-emu/usr/bin/* debian/sense-emu-tools/usr/bin/
	rmdir debian/python3-sense-emu/usr/bin
	# Strip out compiled gschemas from everything (it's handled by the
	# .install file and is only included in the source distro for
	# development purposes and odd platforms like Windows)
	find debian/ -name "gschemas.compiled" -delete

#override_dh_auto_test:
#	# Don't run the tests!

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. sphinx-build -N -bhtml docs/ build/html
	PYTHONPATH=. sphinx-build -N -bman docs/ build/man
