#!/usr/bin/make -f
pkg=findimagedupes
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

%:
	dh $@

override_dh_auto_build:
	# Bug #531145: Removing installation instructions from the manpage, as
	# they are useless if the package is installed. Upstream has no other
	# documentation, so this section will stay in upstream's version.
	if grep -q '^=head1 INSTALLATION' $(pkg); then \
        sed -i.pristine '/^=head1 INSTALLATION/,/^=head1 /{/^=head1 OPTIONS/p;d;}' \
		$(pkg); fi
	# Upstream has now updated README himself in version 2.18
	# It might be reasonable to create the README this way anyway
	# pod2text findimagedupes > ./tmp/README
	dh_auto_build

override_dh_clean:
	[ ! -f findimagedupes.pristine ] || mv findimagedupes.pristine findimagedupes
	dh_clean
