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

export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow

%:
	dh $@ --with sphinxdoc

override_dh_auto_configure:
	dh_auto_configure -- \
		-DWITH_AVCODEC=1 \
		-DWITH_EXIV2=1 \
		-DWITH_FFMPEGTHUMBNAILER=1 \
		-DWITH_MYSQL=1 \
		-DWITH_SYSTEMD=0 \
		-DWITH_ZIP=0

# The documentation used to not get built within the CMake script, so it must be built
# manually. Future packagers should consider using upstream CMake doc target.
# sphinx_toolbox needs a writable HOME for its cache.
override_dh_auto_build:
	dh_auto_build
	mkdir -p doc/_build/home
	HOME=$(CURDIR)/doc/_build/home python3 -m sphinx -b html doc doc/_build/html
