#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CPPFLAGS_MAINT_APPEND = -I/usr/include/eigen3
ifneq (,$(filter $(DEB_HOST_ARCH),i386 kfreebsd-i386 hurd-i386 armel armhf mipsel))
	export DEB_CXXFLAGS_MAINT_APPEND = -g0
endif

%:
	dh $@

override_dh_auto_build:
	mkdir -p $(CURDIR)/obj/
	mkdir -p $(CURDIR)/bin/
	dh_auto_build

override_dh_auto_clean:
	rm -f debian/upstream.example/examples.tar.xz
	dh_auto_clean

override_dh_install:
	cd debian/upstream.example && find -type f | LC_ALL=C sort | grep -v examples.tar.xz | \
	    tar -T - --sort=name --mode=go=rX,u+rw,a-s --owner=root --group=root --numeric-owner -Jcvf examples.tar.xz
	dh_install
