#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

export CC = $(DEB_HOST_GNU_TYPE)-g++

%:
	dh $@

override_dh_auto_clean:
	-rm -rf Makefile html2text *.o configure-tmp Dependencies debian/tests/*.result debian/html2textrc.5

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd debian/tests/ && sh runtests
endif

override_dh_installman:
	# darn, patch those typos (bug #309887 here)
	zcat html2textrc.5.gz | sed \
		"s/specifiy/specify/; s/elemet/element/; s/who's/whose/" \
		> debian/html2textrc.5
	dh_installman

override_dh_auto_install:
	# do nothing
