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

Diff of /eclass/cannadic.eclass

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

Revision 1.2 Revision 1.14
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.2 2003/12/29 15:50:08 usata Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.14 2006/10/21 00:07:58 flameeyes 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=""
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 21
28S="${WORKDIR}" 22S="${WORKDIR}"
29 23
30DICSDIRFILE="$(echo ${FILESDIR}/*.dics.dir)" 24DICSDIRFILE="${FILESDIR}/*.dics.dir"
31CANNADICS="${CANNADICS}" # (optional) 25CANNADICS="${CANNADICS}" # (optional)
32DOCS="README*" 26DOCS="README*"
33 27
34# You don't need to modify these 28# You don't need to modify these
35#local cannadir dicsdir 29#local cannadir dicsdir
36cannadir="/var/lib/canna/dic/canna" 30cannadir="${ROOT}/var/lib/canna/dic/canna"
37dicsdir="/var/lib/canna/dic/dics.d" 31dicsdir="${ROOT}/var/lib/canna/dic/dics.d"
38 32
39# 33#
40# pkg_setup() : sets up cannadic dir 34# pkg_setup() : sets up cannadic dir
41pkg_setup() { 35cannadic_pkg_setup() {
42 36
43 keepdir $cannadir 37 keepdir $cannadir
44 fowners bin:bin $cannadir 38 fowners bin:bin $cannadir
45 fperms 0775 $cannadir 39 fperms 0775 $cannadir
46} 40}
66 60
67# 61#
68# src_install() : installs all dictionaries under ${WORKDIR} 62# src_install() : installs all dictionaries under ${WORKDIR}
69# plus dics.dir and docs 63# plus dics.dir and docs
70# 64#
71src_install() { 65cannadic_src_install() {
72 66
73 for f in *.c[btl]d *.t ; do 67 for f in *.c[btl]d *.t ; do
74 cannadic-install $f 68 cannadic-install $f
75 done 2>/dev/null 69 done 2>/dev/null
76 70
77 if [ -n "`use canna`" ] ; then
78 dicsdir-install || die 71 dicsdir-install || die
79 fi
80 72
81 dodoc ${DOCS} 73 dodoc ${DOCS}
82} 74}
83 75
84# 76#
115} 107}
116 108
117# 109#
118# pkg_postinst() : updates dics.dir and print out notice after install 110# pkg_postinst() : updates dics.dir and print out notice after install
119# 111#
120pkg_postinst() { 112cannadic_pkg_postinst() {
113 update-cannadic-dir
114 einfo
115 einfo "Please restart cannaserver to fit the changes."
116 einfo "You need to modify your config file (~/.canna) to enable dictionaries."
121 117
122 if [ -n "`use canna`" ] ; then 118 if [ -n "${CANNADICS}" ] ; then
123 update-cannadic-dir 119 einfo "e.g) add $(for d in ${CANNADICS}; do
124 einfo 120 echo -n "\"$d\" "
125 einfo "Please restart cannaserver to fit changes." 121 done)to section use-dictionary()."
126 einfo "and modify your config file (~/.canna) to enable dictionary." 122 einfo "For details, see documents under /usr/share/doc/${PF}"
123 fi
127 124
128 if [ -n "${CANNADICS}" ] ; then 125 einfo "If you do not have ~/.canna, you can find sample files in /usr/share/canna."
129 einfo "e.g) add $(for d in ${CANNADICS}; do 126 ewarn "If you are upgrading from existing dictionary, you may need to recreate"
130 echo -n \"$d\"\ 127 ewarn "user dictionary if you have one."
131 done)to section use-dictionary()."
132 einfo "For details, see documents under /usr/share/doc/${PF}"
133 fi
134
135 einfo 128 einfo
136 fi
137} 129}
138 130
139# 131#
140# pkg_postrm() : updates dics.dir and print out notice after uninstall 132# pkg_postrm() : updates dics.dir and print out notice after uninstall
141# 133#
142pkg_postrm() { 134cannadic_pkg_postrm() {
135 update-cannadic-dir
136 einfo
137 einfo "Please restart cannaserver to fit changes."
138 einfo "and modify your config file (~/.canna) to disable dictionary."
143 139
144 if [ -n "`use canna`" ] ; then 140 if [ -n "${CANNADICS}" ] ; then
145 update-cannadic-dir 141 einfo "e.g) delete $(for d in ${CANNADICS}; do
146 einfo 142 echo -n "\"$d\" "
147 einfo "Please restart cannaserver to fit changes." 143 done)from section use-dictionary()."
148 einfo "and modify your config file (~/.canna) to disable dictionary." 144 fi
149 145
150 if [ -n "${CANNADICS}" ] ; then
151 einfo "e.g) delete $(for d in ${CANNADICS}; do
152 echo -n \"$d\"\
153 done)from section use-dictionary()."
154 fi
155
156 einfo 146 einfo
157 fi
158} 147}

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.20