#!/usr/bin/make -f

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_BUILD_MAINT_OPTIONS = dilos=-ld_z_ignore
export CPPFLAGS+= -D__EXTENSIONS__ -DDILOS

%:
	dh $@ --with gir --buildsystem=cmake --no-parallel

override_dh_auto_configure:
	dh_auto_configure -- -DGOBJECT_INTROSPECTION=true -DICAL_GLIB_VAPI=true \
	-DCMAKE_INSTALL_LIBDIR="lib/$(DEB_HOST_MULTIARCH)" -DCMAKE_INSTALL_RUNSTATEDIR=/var/run

override_dh_missing:
	dh_missing --list-missing

ifneq (,$(filter $(DEB_HOST_ARCH), kfreebsd-amd64 kfreebsd-i386))
override_dh_auto_test:
	: # the tests hang on the buildds, don't run them
	: -dh_auto_test
endif

override_dh_strip:
	dh_strip --dbgsym-migration='libical-dbg (<< 2~)'
