#!/usr/bin/make -f
# -*- makefile -*-

# Disable fixfilepath as it triggers build failures.
export DEB_BUILD_MAINT_OPTIONS = hardening=+all reproducible=-fixfilepath
BUILDHOME = $(CURDIR)/debian/build

override_dh_auto_configure:
	dh_auto_configure -- \
                -DUSE_HOST_SSE_FLAGS:BOOL=False \
                -DUSE_IGN_RECOMMENDED_FLAGS:BOOL=False

override_dh_clean:
	dh_clean
	rm -rf $(BUILDHOME)

execute_after_dh_auto_install:
	# Manually replace build path by install location in tag file
	sed -i -e 's#$(CURDIR).*/include#/usr/include/ignition/common3#' debian/tmp/usr/share/ignition/ignition-common3/ignition-common3.tag.xml

execute_after_dh_install:
	# need to remove duplicate files already present in other -dev packages
	$(RM) debian/libignition-common3-core-dev/usr/include/ignition/common*/ignition/common/av.hh
	$(RM) debian/libignition-common3-core-dev/usr/include/ignition/common*/ignition/common/events.hh
	$(RM) debian/libignition-common3-core-dev/usr/include/ignition/common*/ignition/common/graphics.hh

override_dh_auto_test:
	mkdir -p $(BUILDHOME)
	@echo 'blhc: ignore-line-regexp: .*test/static_assertions/plugin_.*'
	HOME=$(BUILDHOME) dh_auto_test --no-parallel

%:
	dh $@
