#!/bin/sh
# postinst script for unidic-mecab
#
# see: dh_installdeb(1)

set -e

priority="110"

srcdir="/usr/share/mecab/dic/unidic"
destdir="/var/lib/mecab/dic/unidic"
encoding="UTF-8"

case "$1" in
    configure)
	# No action to avoid over using CPU
	#echo "Compiling Unidic dictionary for Mecab.  This takes long long time..."
	#/usr/lib/mecab/mecab-dict-index -d ${srcdir} -o ${dstdir} -t ${encoding}
    update-alternatives \
      --install /var/lib/mecab/dic/debian mecab-dictionary "${destdir}" "${priority}"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
