This repository has been archived on 2022-08-10. You can view files and clone it, but cannot push or open issues or pull requests.
chez-openbsd/ta6ob/lz4/tests/test_install.sh
2022-08-09 23:28:25 +02:00

29 lines
968 B
Bash
Executable file

#/usr/bin/env sh
set -e
make="make -C $lz4_root"
unamestr=$(uname)
if [ "$unamestr" = 'Linux' ]; then
make="make -C $lz4_root"
elif [ "$unamestr" = 'FreeBSD' -o "$unamestr" = 'OpenBSD' ]; then
make="gmake -C $lz4_root"
fi
for cmd in install uninstall; do
for upper in DUMMY PREFIX EXEC_PREFIX LIBDIR INCLUDEDIR PKGCONFIGDIR BINDIR MANDIR MAN1DIR ; do
lower=$(echo $upper | tr '[:upper:]' '[:lower:]')
tmp_lower="$(pwd)/tmp-lower-$lower/"
tmp_upper="$(pwd)/tmp-upper-$lower/"
echo $make $cmd DESTDIR="$tmp_upper" $upper="test"
$make $cmd DESTDIR="$tmp_upper" $upper="test" >/dev/null
echo $make $cmd DESTDIR="$tmp_lower" $lower="test"
$make $cmd DESTDIR="$tmp_lower" $lower="test" >/dev/null
command diff -r "$tmp_lower" "$tmp_upper" && echo "SAME!" || false
if [ "x$cmd" = "xuninstall" ]; then
test -z "$(find "$tmp_lower" -type f)" && echo "EMPTY!" || false
rm -rf "$tmp_upper" "$tmp_lower"
fi
done
done