#!/usr/bin/make -f

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

%:
	dh $@ --parallel --buildsystem cmake --with gnome --with translations

override_dh_auto_configure:
	dh_auto_configure -- -DENABLE_NAUTILUS=ON \
	                     -DENABLE_UNITY=ON \
	                     -DENABLE_UNITY_CCPANEL=ON \
	                     -DCMAKE_INSTALL_LIBEXECDIR="/usr/lib/${DEB_HOST_MULTIARCH}" \
	                     -DCMAKE_INSTALL_SYSCONFDIR="/etc"

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_auto_test:
	rm -rf $(CURDIR)/debian/tmp-home
	mkdir -p $(CURDIR)/debian/tmp-home
	HOME=$(CURDIR)/debian/tmp-home dh_auto_test
	fusermount -u $(CURDIR)/debian/tmp-home/.gvfs || true
	rm -rf $(CURDIR)/debian/tmp-home

override_dh_auto_clean:
	dh_auto_clean
	rm -rf $(CURDIR)/debian/tmp-home
