#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PACKAGE = $(shell dh_listpackages)
TMP     = $(CURDIR)/debian/$(PACKAGE)

# don't run resource intensive test t/ucd.t on slow arches
DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
SLOW_ARCH = armel armhf mips mipsel sparc sparc64 m68k
ifeq (,$(filter $(DEB_HOST_ARCH), $(SLOW_ARCH)))
TEST_FILES = $(wildcard t/*.t)
else
TEST_FILES = $(filter-out t/ucd.t,$(wildcard t/*.t))
endif

%:
	dh $@

override_dh_auto_install:
	dh_auto_install
	if [ ! -s $(TMP)/usr/lib/perl5/auto/Text/Bidi/private/private.bs ]; then \
	  rm $(TMP)/usr/lib/perl5/auto/Text/Bidi/private/private.bs; \
	fi
	# Remove fribidi.pl script, installed as an example instead:
	rm -rf $(TMP)/usr/bin
	rm -rf $(TMP)/usr/share/man/man1

override_dh_auto_test:
	dh_auto_test -- TEST_FILES="$(TEST_FILES)"
