#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/makefile.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

CFLAGS += -fPIC $(LDFLAGS) $(CPPFLAGS)

DEB_MAKE_BUILD_TARGET = all all-recur razip lib
DEB_MAKE_CHECK_TARGET = -C examples all

DEB_COMPRESS_EXCLUDE = .bam
DEB_DH_BUILDDEB_ARGS = -- -Z=xz
DEB_INSTALL_CHANGELOGS_ALL = NEWS
clean::
	$(RM) examples/calDepth examples/ex1.bam examples/ex1.bam.bai examples/ex1.fa.fai examples/ex1.glf examples/ex1.glfview.gz examples/ex1.pileup.gz examples/ex1a.bam examples/ex1b.bam examples/ex1f-rmduppe.bam examples/ex1f-rmdupse.bam examples/ex1f.bam examples/ex1f.rg examples/ex1.bcf

binary-install/samtools::
	install -m 644 bcftools/README $(CURDIR)/debian/samtools/usr/share/doc/samtools/README.bcftools
	ln -s samtools.1.gz $(CURDIR)/debian/samtools/usr/share/man/man1/bcftools.1.gz
	dh_bash-completion

binary-fixup/samtools::
	sed -i 's|^#!/software/bin/python|#!/usr/bin/python|' $(CURDIR)/debian/samtools/usr/share/samtools/varfilter.py
