#!/usr/bin/make -f

export PYBUILD_NAME=celery

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

override_dh_installman:
	docbook-to-man debian/manpage.celery.sgml > celery.1
	dh_installman

override_dh_auto_test:
	PYTHONPATH=. LC_ALL=C.UTF-8 \
	dh_auto_test -- --system=custom --test-args="{interpreter} setup.py test -a '-k-test_sphinx -k-test_worker -p celery.contrib.pytest'"

execute_after_dh_auto_install:
	rm -rf $(CURDIR)/debian/python3-celery/usr/bin

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