#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=django-channels

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


override_dh_auto_build:
	dh_auto_build
	browserify-lite ./js_client/src/index.js --outfile channels/static/channels/js/websocketbridge.js

override_dh_auto_test:
	dh_auto_test -- --system=custom --test-args="PYTHONPATH=. {interpreter} /usr/bin/django-admin test --settings tests.settings"

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. sphinx-build -b html -d docs/.build/.doctrees -N docs $(CURDIR)/debian/python-django-channels-doc/usr/share/doc/python-django-channels-doc/html
	dh_sphinxdoc
endif

override_dh_clean:
	rm -rf docs/.build
	dh_clean
