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

