#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export CMAKE_OPTIONS := \
  -Dwith-glfs=false \
  -Dwith-tcmalloc=false \
  -DSUPPORT_SYSTEMD=ON \
  -DCMAKE_INSTALL_PREFIX=/usr

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(CMAKE_OPTIONS)

override_dh_auto_install:
	dh_auto_install
	# Move systemd file to /lib instead of /usr/lib
	mkdir -p debian/tmp/lib/systemd/system
	mv debian/tmp/usr/lib/systemd/system/tcmu-runner.service debian/tmp/lib/systemd/system/tcmu-runner.service
	rm -r debian/tmp/usr/lib/systemd
	# List files available
	find debian/tmp

override_dh_missing:
	dh_missing --fail-missing
