| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
#export DH_VERBOSE = 1 |
| 5 |
export PYBUILD_NAME=quart |
| 6 |
|
| 7 |
include /usr/share/dpkg/pkg-info.mk |
| 8 |
|
| 9 |
BUILD_DATE = $(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)") |
| 10 |
SPHINXOPTS := -N -D html_last_updated_fmt="$(BUILD_DATE)" |
| 11 |
|
| 12 |
%: |
| 13 |
dh $@ --with sphinxdoc --buildsystem=pybuild |
| 14 |
|
| 15 |
override_dh_sphinxdoc: |
| 16 |
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) |
| 17 |
PYTHONPATH=`dirname $$(find .pybuild/ -type d -name "quart*dist-info" | head -n1)` \ |
| 18 |
python3 -m sphinx -b html $(SPHINXOPTS) docs $(CURDIR)/debian/python-quart-doc/usr/share/doc/python-quart-doc/html |
| 19 |
dh_sphinxdoc |
| 20 |
endif |
| 21 |
|
| 22 |
override_dh_installdocs: |
| 23 |
dh_installdocs -ppython-$(PYBUILD_NAME)-doc --doc-main-package=python3-$(PYBUILD_NAME) |
| 24 |
dh_installdocs --remaining-packages |
| 25 |
|
| 26 |
override_dh_auto_build: |
| 27 |
# The name of the project need to be written in lowercase letters, |
| 28 |
# otherwise pybuild wont find the WHEEL file (as it's created from the |
| 29 |
# project name starting with an capital letter). |
| 30 |
sed -i 's,name = "Quart",name = "quart",g' pyproject.toml |
| 31 |
dh_auto_build |
| 32 |
# Now undo the previous replacement again, we need to do this hack as |
| 33 |
# dpkg will otherwise complain about modified source code of course in |
| 34 |
# case the build is getting started twice in a row. |
| 35 |
sed -i 's,name = "quart",name = "Quart",g' pyproject.toml |
| 36 |
|
| 37 |
override_dh_installexamples: |
| 38 |
dh_installexamples -ppython-$(PYBUILD_NAME)-doc --doc-main-package=python3-$(PYBUILD_NAME) |
| 39 |
dh_installexamples --remaining-packages |
| 40 |
|
| 41 |
override_dh_installchangelogs: |
| 42 |
dh_installchangelogs CHANGES.md |
| 43 |
|
| 44 |
override_dh_compress: |
| 45 |
dh_compress -X.py |
| 46 |
|
| 47 |
override_dh_clean: |
| 48 |
rm -rf .pybuild \ |
| 49 |
.mypy_cache \ |
| 50 |
docs/reference/source/* |
| 51 |
dh_clean |
| 52 |
|
| 53 |
.PHONY: override_dh_auto_build override_dh_auto_clean override_dh_installdocs override_dh_installexamples override_dh_installchangelogs override_dh_compress |