abinfo "Installing files ..."
mkdir -pv "$OLD_PKGDIR""$LIBDIR"
# NOTE: install dereferences symbolic links.
find "$PKGDIR""$LIBDIR" \( -type f -o -type l \) -executable -exec \
	cp -av {} "$OLD_PKGDIR""$LIBDIR"/ \;

abinfo "Creating ld.so.conf ..."
mkdir -pv "$OLD_PKGDIR"/etc/ld.so.conf.d
cat > "$OLD_PKGDIR"/etc/ld.so.conf.d/"$PKGNAME".conf << EOF
$LIBDIR
EOF

abinfo "Restoring PKGDIR ..."
export PKGDIR="$OLD_PKGDIR"
