#!/usr/bin/make -f

export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed

%:
	dh $@ --buildsystem cmake

override_dh_auto_configure:
	dh_auto_configure -Scmake -- \
	  -DReleaseBuild=ON \
	  -DBIN_PATH=/usr/games/ \
	  -DDOC_PATH=/usr/share/doc/dustracing2d/ \
	  -DDATA_PATH=/usr/share/games/dustracing2d/

ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
override_dh_auto_test:
	xvfb-run dh_auto_test
endif

override_dh_auto_install:
	dh_auto_install
	# replace the shipped DejaVu font with a link to the packaged version
	find debian/tmp -name DejaVuSans-Bold.ttf -exec ln -sf /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf {} \;
	find debian/tmp -name LICENCE.txt -delete

override_dh_missing:
	dh_missing --fail-missing
