#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
		-DUSE_INSTALLED_LIBHANDLEGRAPH_ONLY=ON

override_dh_auto_test:
	dh_auto_build -- test_libvgio
	./obj-$(DEB_HOST_GNU_TYPE)/test_libvgio

execute_after_dh_install:
	d-shlibmove --commit \
		    --multiarch \
		    --devunversioned \
		    --exclude-la \
		    --override s/libjansson[0-9]*-dev/libjansson-dev/ \
                    --movedev debian/tmp/usr/include/vg usr/include \
                    --movedev debian/tmp/usr/lib/*/cmake usr/lib/$(DEB_HOST_MULTIARCH) \
                    debian/tmp/usr/lib/*/*.so
