#!/usr/bin/make -f

# DH_VERBOSE := 1

include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_install:
	dh_auto_install --buildsystem=makefile -- install PREFIX=$(CURDIR)/debian/$(DEB_SOURCE)/usr/lib/proteinortho

override_dh_fixperms:
	dh_fixperms
	find debian \( -name "*.faa" -o -name "*.gff" \) -exec chmod -x \{\} \;

override_dh_install:
	dh_install
	for pl in `grep -Rl '#!/usr/bin/env[[:space:]]\+perl' debian/*/usr/*` ; do \
	    sed -i '1s?^#!/usr/bin/env[[:space:]]\+perl?#!/usr/bin/perl?' $${pl} ; \
	done

override_dh_auto_clean:
	dh_auto_clean
	rm -f  remove.graph test_blastp.blast-graph test_blastp.info test_blastp.proteinortho-graph test_blastp.proteinortho-graph.summary test_blastp.proteinortho.html test_blastp.proteinortho.tsv test_lastp.blast-graph test_lastp.info test_lastp.proteinortho-graph test_lastp.proteinortho-graph.summary test_lastp.proteinortho.html test_lastp.proteinortho.tsv test_synteny.blast-graph test_synteny.ffadj-graph test_synteny.info test_synteny.poff-graph test_synteny.poff.html test_synteny.poff.tsv test_synteny.proteinortho-graph test_synteny.proteinortho-graph.summary test_synteny.proteinortho.html test_synteny.proteinortho.tsv test_synteny.poff-graph.summary
