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

Diff of /eclass/cannadic.eclass

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

Revision 1.11 Revision 1.14
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.11 2005/08/22 16:20:30 swegener 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
11EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm 11EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm
12 12
13IUSE="${IUSE} canna" 13IUSE=""
14 14
15DESCRIPTION="Based on the $ECLASS eclass" 15DESCRIPTION="Based on the $ECLASS eclass"
16HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this! 16HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this!
17SRC_URI="mirror://gentoo/${P}.tar.gz" 17SRC_URI="mirror://gentoo/${P}.tar.gz"
18 18
19LICENSE="public-domain" 19LICENSE="public-domain"
20SLOT="0" 20SLOT="0"
21 21
22S="${WORKDIR}" 22S="${WORKDIR}"
23 23
24DICSDIRFILE="$(echo ${FILESDIR}/*.dics.dir)" 24DICSDIRFILE="${FILESDIR}/*.dics.dir"
25CANNADICS="${CANNADICS}" # (optional) 25CANNADICS="${CANNADICS}" # (optional)
26DOCS="README*" 26DOCS="README*"
27 27
28# You don't need to modify these 28# You don't need to modify these
29#local cannadir dicsdir 29#local cannadir dicsdir
66 66
67 for f in *.c[btl]d *.t ; do 67 for f in *.c[btl]d *.t ; do
68 cannadic-install $f 68 cannadic-install $f
69 done 2>/dev/null 69 done 2>/dev/null
70 70
71 if use canna ; then
72 dicsdir-install || die 71 dicsdir-install || die
73 fi
74 72
75 dodoc ${DOCS} 73 dodoc ${DOCS}
76} 74}
77 75
78# 76#
110 108
111# 109#
112# pkg_postinst() : updates dics.dir and print out notice after install 110# pkg_postinst() : updates dics.dir and print out notice after install
113# 111#
114cannadic_pkg_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."
115 117
116 if use canna ; then
117 update-cannadic-dir
118 einfo
119 einfo "Please restart cannaserver to fit the changes."
120 einfo "You need to modify your config file (~/.canna) to enable dictionaries."
121
122 if [ -n "${CANNADICS}" ] ; then 118 if [ -n "${CANNADICS}" ] ; then
123 einfo "e.g) add $(for d in ${CANNADICS}; do 119 einfo "e.g) add $(for d in ${CANNADICS}; do
124 echo -n "\"$d\" " 120 echo -n "\"$d\" "
125 done)to section use-dictionary()." 121 done)to section use-dictionary()."
126 einfo "For details, see documents under /usr/share/doc/${PF}" 122 einfo "For details, see documents under /usr/share/doc/${PF}"
127 fi 123 fi
128 124
129 einfo "If you do not have ~/.canna, you can find sample files in /usr/share/canna." 125 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" 126 ewarn "If you are upgrading from existing dictionary, you may need to recreate"
131 ewarn "user dictionary if you have one." 127 ewarn "user dictionary if you have one."
132 einfo 128 einfo
133 fi
134} 129}
135 130
136# 131#
137# pkg_postrm() : updates dics.dir and print out notice after uninstall 132# pkg_postrm() : updates dics.dir and print out notice after uninstall
138# 133#
139cannadic_pkg_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."
140 139
141 if use canna ; then
142 update-cannadic-dir
143 einfo
144 einfo "Please restart cannaserver to fit changes."
145 einfo "and modify your config file (~/.canna) to disable dictionary."
146
147 if [ -n "${CANNADICS}" ] ; then 140 if [ -n "${CANNADICS}" ] ; then
148 einfo "e.g) delete $(for d in ${CANNADICS}; do 141 einfo "e.g) delete $(for d in ${CANNADICS}; do
149 echo -n "\"$d\" " 142 echo -n "\"$d\" "
150 done)from section use-dictionary()." 143 done)from section use-dictionary()."
151 fi 144 fi
152 145
153 einfo 146 einfo
154 fi
155} 147}

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

  ViewVC Help
Powered by ViewVC 1.1.20