#!/bin/sh

TDIR=COMPONENTS/${DH_COMPONENT}
export PERL5LIB=${CURDIR}/debian/${PACKAGE}/usr/share/perl5

if [ -z ${PACKAGE} ]
then
    echo PACKAGE not set
    exit 1
fi
PERL=$(which perl)

if [ -z ${DH_COMPONENT} ]
then
    echo DH_COMPONENT not set
    exit 1
fi

if [ ! -d ${TDIR} ]
then
    echo ${TDIR} not a directory
    exit 1
fi

if [ ! -d ${PERL5LIB} ]
then
    echo ${PERL5LIB} not a directory
    exit 1
fi

echo perl5lib: ${PERL5LIB}
echo tdir: ${TDIR}

if dh_auto_configure -D ${TDIR}
then
    EXIT_STATUS=0
else
    EXIT_STATUS=1
fi

exit $EXIT_STATUS


