PORTNAME=	samtools
DISTVERSION=	1.25
CATEGORIES=	biology
MASTER_SITES=	https://github.com/samtools/${PORTNAME}/releases/download/${DISTVERSION}/

MAINTAINER=	freebsd@alteholz.de
COMMENT=	Tools for manipulating next-generation sequencing data
WWW=		https://www.htslib.org/ \
		https://github.com/samtools/bcftools/

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

BUILD_DEPENDS=	htslib>=1.25:biology/htslib
BUILD_DEPENDS+=	${TEST_DEPENDS} # workaround for `poudriere testport`
LIB_DEPENDS=	libhts.so:biology/htslib
TEST_DEPENDS=	bash:shells/bash

USES=		autoreconf cpe gmake localbase ncurses perl5 python:env shebangfix tar:bz2
USE_PERL5=	test

SHEBANG_FILES=	misc/*
SHEBANG_GLOB=	*.pl *.py *.sh

GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--with-htslib=system

TEST_TARGET=	test

PORTEXAMPLES=	*

OPTIONS_DEFINE=	EXAMPLES

post-install-EXAMPLES-on:
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
	cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}

.include <bsd.port.mk>
