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

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_missing:
	dh_missing --fail-missing

override_dh_auto_configure:
	dh_auto_configure -- -DBUILD_DOCS=ON

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	sh tests/xvfb.sh dh_auto_test || exit $?
endif

override_dh_install:
	# move doc files
	mkdir -p debian/tmp/usr/share/doc/libu1db-qt5-dev/
	mv debian/tmp/usr/share/doc/u1db-qt/html debian/tmp/usr/share/doc/libu1db-qt5-dev/
	rmdir debian/tmp/usr/share/doc/u1db-qt/
	# remove empty images/ dir
	rmdir debian/tmp/usr/share/doc/libu1db-qt5-dev/html/images/
	# run dh_install, finally
	dh_install

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
