#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

disable_test=0
# BTS:718740
ifneq (,$(findstring $(DEB_HOST_ARCH),armel armhf ia64 sparc mipsel))
disable_test=1
endif

%:
	dh $@ --buildsystem=rebar --with rebar

override_dh_auto_test:
ifeq "$(disable_test)" "0"
	rebar eunit -vv skip_deps=true
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf ebin/*.beam
	rm -rf ebin/*.app
	rm -rf c_src/*.o
	rm -rf priv/bitcask.so
	rm -rf .eunit
