#!/bin/sh
# autopkgtest check: build and run with default test data
# Author: Tatiana Malygina <merlettaia@gmail.com>

set -e

pkg=dssp

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

cd $ADTTMP

cp -a /usr/share/doc/${pkg}/examples/* .
find . -type f -name "*.gz" -exec gunzip \{\} \;
for lnk in `find . -type l -name "*.gz"` ; do
    ln -s `basename $(readlink $lnk) .gz` `echo $lnk | sed 's/\.gz$//'`
    rm $lnk
done

#this should process a 'ATOM' portion of pdb file from RCSB.org
mkdssp -i 2OSL_fragment.pdb -o dssp_result.txt
[ -s dssp_result.txt ]

#this should process a typical pdb-file from RCSB.org
mkdssp -i 5bmg.pdb -o dssp_result2.txt
[ -s dssp_result2.txt ]
