#!/bin/bash
set -e

pkg=ncbi-epcr

if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
  # Double quote below to expand the temporary directory variable now versus
  # later is on purpose.
  # shellcheck disable=SC2064
  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
fi

cp -a /usr/share/doc/${pkg}/data/* "${AUTOPKGTEST_TMP}"
cd "${AUTOPKGTEST_TMP}"
gunzip -r *

famap -b gingko.mmap -t N gingko.fasta
fahash -b gingko.hash -w 3 -f 2 gingko.mmap
re-PCR -S gingko.hash -n 5 -g 0 -d 100-300 -o rbcL5.rePCR rbcL-primer.txt
