pkgsrc/math/djbsort/INSTALL
schmonz 70d46b6be7 From DJB: "For correctness, ./test has to be run on the installation
machine, not on the machine preparing a binary package." (Also: "The
issues are explained in Section 8 of
https://pqcrypto.eu.org/deliverables/d2.4.pdf.")

For this to work, we install the source tree (with built objects) to
${PREFIX}/share/djbsort. Then we run tests, install to ${PREFIX}/include
and ${PREFIX}/lib, and check the installed files against pseudo-PLIST.

This means pkg_add(1) will fail if no C compiler is present, which is
unusual behavior for pkg_add but perhaps not entirely unreasonable for a
C library.

Bump PKGREVISION.
2018-07-31 05:38:56 +00:00

59 lines
1.3 KiB
Text

# $NetBSD: INSTALL,v 1.1 2018/07/31 05:38:56 schmonz Exp $
DIFF="@DIFF@"
INSTALL_DATA="@INSTALL_DATA@"
PSEUDO_PLIST="@PSEUDO_PLIST@"
SHAREDIR="@SHAREDIR@"
case "${STAGE}" in
POST-INSTALL)
cd ${PREFIX}/${SHAREDIR}
./test
TEST_EXITCODE=$?
if [ ${TEST_EXITCODE} -ne 0 ]; then
${CAT} <<EOF
===========================================================================
ERROR: tests exited nonzero (${TEST_EXITCODE}).
The installation may not be correct or performant.
===========================================================================
EOF
exit 1
fi
./upgrade
cd link-install/newest
_INSTALLED_FILES=''
for i in include/*.h; do
${INSTALL_DATA} ${i} ${PREFIX}/include
_INSTALLED_FILES="${_INSTALLED_FILES}"'
'"include/$(${BASENAME} ${i})"
done
for i in lib/*/*.a; do
${INSTALL_DATA} ${i} ${PREFIX}/lib
_INSTALLED_FILES="${_INSTALLED_FILES}"'
'"lib/$(${BASENAME} ${i})"
done
_INSTALLED_FILES=$(${ECHO} "${_INSTALLED_FILES}" | ${GREP} -v '^$' | ${SORT} -u)
cd ${PREFIX}/${SHAREDIR}
echo "${_INSTALLED_FILES}" | ${DIFF} -u pseudo-PLIST -
DIFF_EXITCODE=$?
if [ ${DIFF_EXITCODE} -ne 0 ]; then
${CAT} <<EOF
===========================================================================
ERROR: installed files do not match pseudo-PLIST.
===========================================================================
EOF
exit 1
fi
;;
esac