# Install dictionary extensions for spellchecking
if [ -x "usr/lib/libreoffice/program/unopkg" ]; then
  UNOPKGTMP=$(mktemp -d unopkg.XXXXXX) || UNOPKGTMP=/tmp/unopkg.$$
  if [ -f "usr/lib/libreoffice/share/extensions/install/dict-or.oxt" ]; then
    echo "Installing shared version of 'dict-or.oxt' ..."
    chroot . /usr/lib/libreoffice/program/unopkg remove --shared \
      dict-or.oxt 1>/dev/null 2>/dev/null
    chroot . /usr/lib/libreoffice/program/unopkg add \
      --suppress-license --shared \
      usr/lib/libreoffice/share/extensions/install/dict-or.oxt \
      "-env:UserInstallation=file:///$UNOPKGTMP" 1>/dev/null 2>/dev/null
  fi
  rm -rf $UNOPKGTMP
fi

