PLANG=it_IT post_install() { # oldskull alternatives: bye-bye if [ $(readlink /usr/share/myspell/default.aff | grep alternatives) ]; then rm -f /usr/share/myspell/default.aff fi if [ $(readlink /usr/share/myspell/default.dic | grep alternatives) ]; then rm -f /usr/share/myspell/default.dic fi rm -f /etc/alternatives/default.{aff,dic} # if there is no default dictionary, then install one if [ ! -L /usr/share/myspell/default.aff ]; then ln -s /usr/share/myspell/$PLANG.aff /usr/share/myspell/default.aff fi if [ ! -L /usr/share/myspell/default.dic ]; then ln -s /usr/share/myspell/$PLANG.dic /usr/share/myspell/default.dic fi } post_remove() { # if we removed the default, then set up a new default (if any) if [ "$(readlink /usr/share/myspell/default.aff)" == "/usr/share/myspell/$PLANG.aff" ]; then rm -f /usr/share/myspell/default.aff if [ -e /usr/share/myspell/*.aff ]; then ln -s $(ls -1 /usr/share/myspell/*.aff 2>/dev/null | grep -v default | head -n 1 | sed 's/\*//') /usr/share/myspell/default.aff fi fi if [ "$(readlink /usr/share/myspell/default.dic)" == "/usr/share/myspell/$PLANG.dic" ]; then rm -f /usr/share/myspell/default.dic if [ -e /usr/share/myspell/*.dic ]; then ln -s $(ls -1 /usr/share/myspell/*.dic 2>/dev/null | grep -v default | head -n 1 | sed 's/\*//') /usr/share/myspell/default.dic fi fi } post_upgrade() { post_install } op=$1 shift $op $* # vim: ft=sh