| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.7 2005/01/05 09:26:30 usata Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.8 2005/06/27 20:07:32 agriffis Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Mamoru KOMACHI <usata@gentoo.org> |
5 | # Author: Mamoru KOMACHI <usata@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # The cannadic eclass is used for installation and setup of Canna |
7 | # The cannadic eclass is used for installation and setup of Canna |
| 8 | # compatible dictionaries within the Portage system. |
8 | # compatible dictionaries within the Portage system. |
| 9 | # |
9 | # |
| 10 | |
10 | |
| 11 | ECLASS=cannadic |
11 | ECLASS=cannadic |
| 12 | INHERITED="$INHERITED $ECLASS" |
12 | INHERITED="$INHERITED $ECLASS" |
| 13 | EXPORT_FUNCTIONS cannadic-install dicsdir-install update-cannadic-dir \ |
|
|
| 14 | src_install pkg_setup pkg_postinst pkg_postrm |
13 | EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm |
| 15 | |
14 | |
| 16 | IUSE="${IUSE} canna" |
15 | IUSE="${IUSE} canna" |
| 17 | |
16 | |
| 18 | DESCRIPTION="Based on the $ECLASS eclass" |
17 | DESCRIPTION="Based on the $ECLASS eclass" |
| 19 | HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this! |
18 | HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this! |
| … | |
… | |
| 33 | cannadir="${ROOT}/var/lib/canna/dic/canna" |
32 | cannadir="${ROOT}/var/lib/canna/dic/canna" |
| 34 | dicsdir="${ROOT}/var/lib/canna/dic/dics.d" |
33 | dicsdir="${ROOT}/var/lib/canna/dic/dics.d" |
| 35 | |
34 | |
| 36 | # |
35 | # |
| 37 | # pkg_setup() : sets up cannadic dir |
36 | # pkg_setup() : sets up cannadic dir |
| 38 | pkg_setup() { |
37 | cannadic_pkg_setup() { |
| 39 | |
38 | |
| 40 | keepdir $cannadir |
39 | keepdir $cannadir |
| 41 | fowners bin:bin $cannadir |
40 | fowners bin:bin $cannadir |
| 42 | fperms 0775 $cannadir |
41 | fperms 0775 $cannadir |
| 43 | } |
42 | } |
| … | |
… | |
| 63 | |
62 | |
| 64 | # |
63 | # |
| 65 | # src_install() : installs all dictionaries under ${WORKDIR} |
64 | # src_install() : installs all dictionaries under ${WORKDIR} |
| 66 | # plus dics.dir and docs |
65 | # plus dics.dir and docs |
| 67 | # |
66 | # |
| 68 | src_install() { |
67 | cannadic_src_install() { |
| 69 | |
68 | |
| 70 | for f in *.c[btl]d *.t ; do |
69 | for f in *.c[btl]d *.t ; do |
| 71 | cannadic-install $f |
70 | cannadic-install $f |
| 72 | done 2>/dev/null |
71 | done 2>/dev/null |
| 73 | |
72 | |
| … | |
… | |
| 112 | } |
111 | } |
| 113 | |
112 | |
| 114 | # |
113 | # |
| 115 | # pkg_postinst() : updates dics.dir and print out notice after install |
114 | # pkg_postinst() : updates dics.dir and print out notice after install |
| 116 | # |
115 | # |
| 117 | pkg_postinst() { |
116 | cannadic_pkg_postinst() { |
| 118 | |
117 | |
| 119 | if use canna ; then |
118 | if use canna ; then |
| 120 | update-cannadic-dir |
119 | update-cannadic-dir |
| 121 | einfo |
120 | einfo |
| 122 | einfo "Please restart cannaserver to fit the changes." |
121 | einfo "Please restart cannaserver to fit the changes." |
| … | |
… | |
| 137 | } |
136 | } |
| 138 | |
137 | |
| 139 | # |
138 | # |
| 140 | # pkg_postrm() : updates dics.dir and print out notice after uninstall |
139 | # pkg_postrm() : updates dics.dir and print out notice after uninstall |
| 141 | # |
140 | # |
| 142 | pkg_postrm() { |
141 | cannadic_pkg_postrm() { |
| 143 | |
142 | |
| 144 | if use canna ; then |
143 | if use canna ; then |
| 145 | update-cannadic-dir |
144 | update-cannadic-dir |
| 146 | einfo |
145 | einfo |
| 147 | einfo "Please restart cannaserver to fit changes." |
146 | einfo "Please restart cannaserver to fit changes." |