#!/usr/bin/make -f

#export DH_VERBOSE=1
export QT_SELECT=qt5

ifeq ($(DEB_HOST_ARCH_OS), linux)
CONFIGURE_FLAGS = --with-libudev
endif

# latex generation seems to be broken
CONFIGURE_FLAGS += --enable-doxygen-man --disable-doxygen-ps --disable-doxygen-pdf

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf ./bootstrap.sh

override_dh_auto_configure:
	dh_auto_configure -- --disable-silent-rules --with-libv4lconvertsubdir=libv4lconvert0 $(CONFIGURE_FLAGS)

override_dh_auto_build:
	dh_auto_build
	$(MAKE) doxygen-run

override_dh_install:
	# Remove useless autogenreated doxygen files
	rm -f doxygen-doc/html/*.md5

	dh_install --list-missing

override_dh_installchangelogs:
	dh_installchangelogs -Nlibv4l-dev -Nv4l-utils -Nqv4l2 ChangeLog

override_dh_installdocs:

	dh_installdocs -Nlibv4l-dev -Nv4l-utils -Nqv4l2

override_dh_makeshlibs:
	dh_makeshlibs -Xv4l1compat -Xv4l2convert -Xlibv4l-mplane

