#!/usr/bin/make -f
#export DH_VERBOSE = 1


export DEB_BUILD_MAINT_OPTIONS = hardening=-all optimize=-lto

%:
	dh $@

override_dh_auto_build:
	dh_auto_build
ifeq (0,1)
	if which help2man >/dev/null 2>&1; then \
	  help2man \
	    --no-info \
	    --section=8 \
	    --name='Debuginfo editing helper' \
	    --version-string="$$(./debugedit --version | sed 's/RPM *//')" \
	    --include=debian/debugedit.h2m ./debugedit \
	    > debian/debugedit.8; \
	fi
endif

override_dh_auto_test:
	: # -ffile-prefix-map= isn't expected ...
	if [ ! -f tests/atlocal.orig ]; then \
	  cp -p tests/atlocal tests/atlocal.orig; \
	  sed -i 's/^\(C\|LD\)FLAGS=.*/\1FLAGS=""/' tests/atlocal; \
	fi
	if dh_auto_test; then \
	  : ; \
	else \
	  cat tests/testsuite.log; \
	  exit 1; \
	fi
