#!/usr/bin/make -f
DH_VERBOSE = 1
export PYBUILD_DESTDIR = debian/weresync
export PYBUILD_INSTALL_ARGS = --install-lib=/usr/share/weresync/

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

execute_after_dh_auto_install:
	mv debian/weresync/usr/bin/weresync debian/weresync/usr/share/weresync/run
	mv debian/weresync/usr/bin/weresync-gui debian/weresync/usr/share/weresync/run-gui
	find debian/weresync/usr/share/ -type f -not -name "run*" -exec chmod -x {} \; # Temporary fix to remove uneeded executable files. Next upstream version will have only properly executable files marked that way.

execute_after_dh_auto_build:
		https_proxy=127.0.0.1:9 http_proxy=127.0.0.1:9 PYTHONPATH=. python3 `which sphinx-build` -N -bhtml docs/source build/html # HTML generator
