#!/usr/bin/make -f

.PHONY: build

%:
	dh $@ --parallel --with autoreconf

build:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- --without-openssl --with-nettle \
		--enable-bsdtar=shared --enable-bsdcpio=shared

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
ifneq (,$(shell locale -a | grep en_US.utf8))
	_VERBOSITY_LEVEL=1 dh_auto_test --parallel
else
	mkdir -p tmp-locales
	localedef -i /usr/share/i18n/locales/en_US -c -f UTF-8 \
		-A /usr/share/locale/locale.alias tmp-locales/en_US.UTF-8
	_VERBOSITY_LEVEL=1 LOCPATH=$(CURDIR)/tmp-locales dh_auto_test --parallel
	rm -rf tmp-locales
endif
endif
