#!/usr/bin/make -f

DH_VERBOSE := 1
DEBVERS        := $(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')
VERSION        := $(shell echo '$(DEBVERS)' | sed -e 's/^[0-9]*://' -e 's/-.*//')

%:
	dh $@ --parallel

override_dh_auto_clean:
	cd ./sample_data && ./cleanme.pl

override_dh_auto_build:

override_dh_install:
	dh_install
	find debian/transdecoder -name '*.p?' | xargs sed -i \
                's=^#!/usr/local/bin/perl=#!/usr/bin/perl='

override_dh_installman:
	pod2man --section=1 --center="Transcriptome Protein Prediction" \
		--release="$$VERSION" TransDecoder.LongOrfs > \
		debian/TransDecoder.LongOrfs.1
	pod2man --section=1 --center="Transcriptome Protein Prediction" \
		--release="$$VERSION" TransDecoder.Predict > \
		debian/TransDecoder.Predict.1
	dh_installman

get-orig-source:
	uscan --verbose --force-download --repack --compression xz

override_dh_clean:
	# generated man pages
	dh_clean debian/TransDecoder.LongOrfs.1 debian/TransDecoder.Predict.1
