#!/usr/bin/make -f

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

export DEB_BUILD_MAINT_OPTIONS = hardening=+all reproducible=+fixfilepath

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- \
	                     -DCMAKE_INSTALL_LIBDIR:BOOL=lib/$(DEB_HOST_MULTIARCH) \
	                     -DCMAKE_INSTALL_INCLUDEDIR:BOOL=include/$(DEB_HOST_MULTIARCH) \
	                     -DBUILD_EXAMPLES:BOOL=OFF \
	                     -DBUILD_TESTING:BOOL=ON \
	                     -DBUILD_TESTRUNNER:BOOL=ON \
	                     -DENABLE_PLUGIN:BOOL=ON \
	                     -DENABLE_WEB_LISTENER:BOOL=ON \
	                     -DENABLE_LUA_PLUGIN:BOOL=ON \
	                     -DENABLE_RUBY_PLUGIN:BOOL=ON \
	                     -DENABLE_PYTHON_PLUGIN:BOOL=OFF \

override_dh_auto_install-indep:

override_dh_auto_build-indep:
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	dh_auto_build -- dox
endif

override_dh_installdocs-indep:
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	dh_installdocs -plibrobottestingframework-doc --doc-main-package=robot-testing-framework -Xjquery.js
	dh_installdocs --remaining-packages
	dh_doxygen -plibrobottestingframework-doc
endif

override_dh_installexamples-indep:
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	dh_installexamples -plibrobottestingframework-doc --doc-main-package=robot-testing-framework
	dh_installexamples --remaining-packages
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
endif
