#!/bin/sh -e

pkg=kraken2

if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cd "${AUTOPKGTEST_TMP}"
cp -a /usr/share/doc/${pkg}/test_data/* .

gunzip -r *

kraken2-build --add-to-library Acartia_tonsa.fasta --db test_db
kraken2-build --add-to-library Acinetobacter_phage.fasta --db test_db
# kraken2-build --build --minimizer-len 5 --db test_db
#   This leads to
## kraken2-build: number of minimizer spaces (6) exceeds max
## for minimizer len (5); max: 1
# kraken2 --db test_db test.fa > kraken.output
#   This leads to
## kraken2: database ("./test_db") does not contain necessary file taxo.k2d

