#!/usr/bin/make -f

export DBD_FIREBIRD_REQUIRE_EMBEDDED=1
export AUTOMATED_TESTING=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow

BAD_ARCH = kfreebsd-amd64 kfreebsd-i386 armel armhf arm64

ifneq (,$(shell for a in $(BAD_ARCH); do dpkg-architecture -e$$a && echo bad$$a; done))
    export DBD_FIREBIRD_TEST_SKIP_EVENTS_FORK=1
endif

export FIREBIRD_INCLUDE=/usr/include
export FIREBIRD_LIB=/usr/lib/$(shell dpkg-architecture -q DEB_BUILD_MULTIARCH)
export FIREBIRD_HOME=$(FIREBIRD_LIB)

%:
	dh $@ --with=perl_dbi

override_dh_auto_clean:
	# avoid re-generating Makefile
	! [ -e Makefile ] || touch Makefile
	dh_auto_clean
