/[gentoo-x86]/eclass/cannadic.eclass
Gentoo

Diff of /eclass/cannadic.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.1.1.1
1# Copyright 1999-2003 Gentoo Technologies, Inc. 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.1 2003/09/11 06:22:21 usata Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.1.1.1 2005/11/30 09:59:19 chriswhite 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
11ECLASS=cannadic
12INHERITED="$INHERITED $ECLASS"
13EXPORT_FUNCTIONS cannadic-install dicsdir-install update-cannadic-dir \
14 src_install pkg_setup pkg_postinst pkg_postrm 11EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm
15 12
16IUSE="${IUSE} canna" 13IUSE="canna"
17 14
18DESCRIPTION="Based on the $ECLASS eclass" 15DESCRIPTION="Based on the $ECLASS eclass"
19HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this! 16HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this!
20SRC_URI="mirror://gentoo/${P}.tar.gz" 17SRC_URI="mirror://gentoo/${P}.tar.gz"
21 18
22LICENSE="public-domain" 19LICENSE="public-domain"
23# I added all keywords form /usr/portage/profiles/keyword.desc atm since
24# cannadic source is basically plain text and will run on any platform
25KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hpps ~arm ~amd64"
26SLOT="0" 20SLOT="0"
27
28# I don't add Canna as a dependency because Anthy also uses cannadic
29DEPEND="${DEPEND}
30 canna? ( app-i18n/canna )"
31 21
32S="${WORKDIR}" 22S="${WORKDIR}"
33 23
34DICSDIRFILE="$(echo ${FILESDIR}/*.dics.dir)" 24DICSDIRFILE="$(echo ${FILESDIR}/*.dics.dir)"
35CANNADICS="${CANNADICS}" # (optional) 25CANNADICS="${CANNADICS}" # (optional)
36DOCS="README*" 26DOCS="README*"
37 27
38# You don't need to modify these 28# You don't need to modify these
39#local cannadir dicsdir 29#local cannadir dicsdir
40cannadir="/var/lib/canna/dic/canna" 30cannadir="${ROOT}/var/lib/canna/dic/canna"
41dicsdir="/var/lib/canna/dic/dics.d" 31dicsdir="${ROOT}/var/lib/canna/dic/dics.d"
42 32
43# 33#
44# pkg_setup() : sets up cannadic dir 34# pkg_setup() : sets up cannadic dir
45pkg_setup() { 35cannadic_pkg_setup() {
46 36
47 keepdir $cannadir 37 keepdir $cannadir
48 fowners bin:bin $cannadir 38 fowners bin:bin $cannadir
49 fperms 0775 $cannadir 39 fperms 0775 $cannadir
50} 40}
70 60
71# 61#
72# src_install() : installs all dictionaries under ${WORKDIR} 62# src_install() : installs all dictionaries under ${WORKDIR}
73# plus dics.dir and docs 63# plus dics.dir and docs
74# 64#
75src_install() { 65cannadic_src_install() {
76 66
77 for f in *.c[btl]d *.t ; do 67 for f in *.c[btl]d *.t ; do
78 cannadic-install $f 68 cannadic-install $f
79 done 2>/dev/null 69 done 2>/dev/null
80 70
81 if [ -n "`use canna`" ] ; then 71 if use canna ; then
82 dicsdir-install || die 72 dicsdir-install || die
83 fi 73 fi
84 74
85 dodoc ${DOCS} 75 dodoc ${DOCS}
86} 76}
119} 109}
120 110
121# 111#
122# pkg_postinst() : updates dics.dir and print out notice after install 112# pkg_postinst() : updates dics.dir and print out notice after install
123# 113#
124pkg_postinst() { 114cannadic_pkg_postinst() {
125 115
126 if [ -n "`use canna`" ] ; then 116 if use canna ; then
127 update-cannadic-dir 117 update-cannadic-dir
128 einfo 118 einfo
129 einfo "Please restart cannaserver to fit changes." 119 einfo "Please restart cannaserver to fit the changes."
130 einfo "and modify your config file (~/.canna) to enable dictionary." 120 einfo "You need to modify your config file (~/.canna) to enable dictionaries."
131 121
132 if [ -n "${CANNADICS}" ] ; then 122 if [ -n "${CANNADICS}" ] ; then
133 einfo "e.g) add $(for d in ${CANNADICS}; do 123 einfo "e.g) add $(for d in ${CANNADICS}; do
134 echo -n \"$d\"\ 124 echo -n "\"$d\" "
135 done)to section use-dictionary()." 125 done)to section use-dictionary()."
136 einfo "For details, see documents under /usr/share/doc/${PF}" 126 einfo "For details, see documents under /usr/share/doc/${PF}"
137 fi 127 fi
138 128
129 einfo "If you do not have ~/.canna, you can find sample files in /usr/share/canna."
130 ewarn "If you are upgrading from existing dictionary, you may need to recreate"
131 ewarn "user dictionary if you have one."
139 einfo 132 einfo
140 fi 133 fi
141} 134}
142 135
143# 136#
144# pkg_postrm() : updates dics.dir and print out notice after uninstall 137# pkg_postrm() : updates dics.dir and print out notice after uninstall
145# 138#
146pkg_postrm() { 139cannadic_pkg_postrm() {
147 140
148 if [ -n "`use canna`" ] ; then 141 if use canna ; then
149 update-cannadic-dir 142 update-cannadic-dir
150 einfo 143 einfo
151 einfo "Please restart cannaserver to fit changes." 144 einfo "Please restart cannaserver to fit changes."
152 einfo "and modify your config file (~/.canna) to disable dictionary." 145 einfo "and modify your config file (~/.canna) to disable dictionary."
153 146
154 if [ -n "${CANNADICS}" ] ; then 147 if [ -n "${CANNADICS}" ] ; then
155 einfo "e.g) delete $(for d in ${CANNADICS}; do 148 einfo "e.g) delete $(for d in ${CANNADICS}; do
156 echo -n \"$d\"\ 149 echo -n "\"$d\" "
157 done)from section use-dictionary()." 150 done)from section use-dictionary()."
158 fi 151 fi
159 152
160 einfo 153 einfo
161 fi 154 fi

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.1.1

  ViewVC Help
Powered by ViewVC 1.1.20