Debian Codegraph @

debian/mecab-naist-jdic-eucjp.postinst

raw
1 #!/bin/sh
2 # postinst script for mecab-naist-jdic-eucjp
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 priority="90"
9
10 srcdir="/usr/share/mecab/dic/naist-jdic-eucjp"
11 destdir="/var/lib/mecab/dic/naist-jdic-eucjp"
12 encoding="EUC-JP"
13
14 gendictdata()
15 {
16 echo "Now generating naist-jdic data for Mecab. This may take a while..."
17
18 [ -d ${srcdir} ] && [ -d ${destdir} ] || exit 1
19 /usr/lib/mecab/mecab-dict-index -d ${srcdir} -o ${destdir} \
20 -f EUC-JP -t ${encoding}
21
22 [ -s ${destdir}/dicrc ] || ln -s ${srcdir}/dicrc ${destdir}
23
24 echo "Check ${destdir} directory."
25 }
26
27 case "$1" in
28 configure)
29
30 gendictdata
31
32 update-alternatives \
33 --install /var/lib/mecab/dic/debian mecab-dictionary ${destdir} ${priority}
34 ;;
35
36 abort-upgrade|abort-remove|abort-deconfigure)
37 ;;
38
39 *)
40 echo "postinst called with unknown argument \`$1'" >&2
41 exit 1
42 ;;
43 esac
44
45 # dh_installdeb will replace this with shell code automatically
46 # generated by other debhelper scripts.
47
48 #DEBHELPER#
49
50 exit 0
51