| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
#export DH_VERBOSE=1 |
| 5 |
|
| 6 |
include /usr/share/dpkg/pkg-info.mk |
| 7 |
|
| 8 |
BUILD_DATE = $(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)") |
| 9 |
SPHINXOPTS := -E -N -D html_last_updated_fmt="$(BUILD_DATE)" |
| 10 |
|
| 11 |
export PYBUILD_NAME=flask-sqlalchemy |
| 12 |
export PYBUILD_AFTER_INSTALL=rm -rf {destdir}/usr/lib/python3*/dist-packages/*.dist-info/licenses |
| 13 |
|
| 14 |
%: |
| 15 |
dh $@ --buildsystem=pybuild |
| 16 |
|
| 17 |
override_dh_sphinxdoc: |
| 18 |
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS))) |
| 19 |
############################################################################# |
| 20 |
# Pallets is using the Python packages pallets-sphinx-themes, sphinx-issues # |
| 21 |
# *and* flask_sqlalchemy to create the running setup for the sphinx run. # |
| 22 |
# As we are building python3-flask-sqlalchemy right now the usual call for # |
| 23 |
# sphinx would fail as no package meta information would be found found. # |
| 24 |
# We also can't use the package build in debian/python3-flask-sqlalchemy # |
| 25 |
# as the installation didn't is finished yet! # |
| 26 |
# So we must relay an the build folder from the wheel creation in # |
| 27 |
# /build/package/.pybuild. We pick up the folder with the most recent # |
| 28 |
# Python build, while introducing a new Python version into Debian the # |
| 29 |
# package wheel build will happen for all available Python versions! # |
| 30 |
# The meta information is then the same, and the meta information is the # |
| 31 |
# sphinx build looking for. # |
| 32 |
############################################################################# |
| 33 |
PYTHONPATH=`dirname $$(find .pybuild/ -type d -name "flask_sqlalchemy*dist-info" | head -n1)` \ |
| 34 |
python3 -m sphinx -b html $(SPHINXOPTS) docs $(CURDIR)/debian/flask-sqlalchemy-doc/usr/share/doc/flask-sqlalchemy-doc/html |
| 35 |
dh_sphinxdoc |
| 36 |
endif |
| 37 |
|
| 38 |
override_dh_installdocs: |
| 39 |
find examples -type f -name ".gitignore" -exec rm {} \; |
| 40 |
dh_installdocs |
| 41 |
|
| 42 |
override_dh_auto_test: |
| 43 |
dh_auto_test -- --system=custom --test-args="PYTHONPATH={build_dir} {interpreter} -m pytest -v -W 'once::DeprecationWarning'" |