#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

pkg := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
version=$(shell dpkg-parsechangelog -ldebian/changelog | grep Version: | cut -f2 -d' ' | cut -f1 -d- )
mandir=$(CURDIR)/debian/$(pkg)/usr/share/man/man1
bindir=$(CURDIR)/debian/$(pkg)/usr/bin


%:
	dh $@ --with autoreconf --parallel

override_dh_auto_configure:
	dh_auto_configure -- LIBS="-lboost_system -lboost_thread -lboost_serialization"

override_dh_auto_clean:
	dh_auto_clean
	rm -rf autom4te.cache

override_dh_builddeb:
	dh_builddeb -- -Z xz

override_dh_installman:
	dh_installman

	# try to create man pages whereever possible
	mkdir -p $(mandir)
	for i in cuffcompare compress_gtf gtf_to_sam cuffmerge \
cuffdiff cuffquant cuffnorm cufflinks ; do \
	help2man --no-info --no-discard-stderr  -h "" \
	    --name='component of cufflinks suite' \
	    --version-string="$(version)" \
		$(bindir)/$$i > $(mandir)/$$i.1; \
	done
	help2man --no-info --no-discard-stderr  \
	    --name='component of cufflinks suite' \
	    --version-string="$(version)" \
		$(bindir)/gffread > $(mandir)/gffread.1; \


