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

export PYBUILD_NAME=scrapy
export PYBUILD_BEFORE_TEST=cd {dir}/tests/keys; cat example-com.key.pem example-com.cert.pem >cert.pem
export DH_ALWAYS_EXCLUDE=license.txt:_sources/:.buildinfo

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

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

override_dh_install:
	dh_install -Xjquery.js

override_dh_clean:
	rm -rf docs/.build
	dh_clean

override_dh_compress:
	dh_compress -X.js -Xobjects.inv

override_dh_installchangelogs:
	dh_installchangelogs docs/news.rst
