#!/usr/bin/make -f
export QT_SELECT=qt5
export DH_VERBOSE=1

include /usr/share/dpkg/default.mk

DH_AUTO_ARGS = --parallel --buildsystem=cmake

%:
	dh $@ --parallel

# Override qcef exe path to /usr/lib/qcef.
override_dh_auto_configure:
ifneq (,$(wildcard .git/config))
	git submodule update --init --recursive
	git submodule update --remote
else
	rm -rf cef
	git clone http://gerrit.uniontech.com/cef-binary cef
endif
	dh_auto_configure -- \
	  -DCMAKE_BUILD_TYPE=Release \
	  -DPROJECT_ARCH=${DEB_TARGET_GNU_CPU} \
	  -DCMAKE_INSTALL_PREFIX=/usr \
	  -DQCEF_INSTALL_PATH=/usr/lib/${DEB_HOST_MULTIARCH}

override_dh_auto_build:
	dh_auto_build -- qcef

# chrome-sandbox requires SUID attribute.
override_dh_fixperms:
	dh_fixperms --exclude chrome-sandbox
