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

Contents of /eclass/cannadic.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (hide annotations) (download)
Sat Oct 21 00:07:58 2006 UTC (7 years, 6 months ago) by flameeyes
Branch: MAIN
Changes since 1.13: +23 -31 lines
Remove canna useflag. All the packages that use this eclass needs canna to make sense. This removes also the canna useflag on... canna itself.

1 vapier 1.6 # Copyright 1999-2004 Gentoo Foundation
2 usata 1.1 # Distributed under the terms of the GNU General Public License v2
3 flameeyes 1.14 # $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.13 2006/05/26 15:19:55 antarus Exp $
4 usata 1.1 #
5     # Author: Mamoru KOMACHI <usata@gentoo.org>
6     #
7     # The cannadic eclass is used for installation and setup of Canna
8     # compatible dictionaries within the Portage system.
9     #
10    
11 agriffis 1.8 EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm
12 usata 1.1
13 flameeyes 1.14 IUSE=""
14 usata 1.1
15     DESCRIPTION="Based on the $ECLASS eclass"
16     HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this!
17     SRC_URI="mirror://gentoo/${P}.tar.gz"
18    
19     LICENSE="public-domain"
20     SLOT="0"
21    
22     S="${WORKDIR}"
23    
24 antarus 1.13 DICSDIRFILE="${FILESDIR}/*.dics.dir"
25 usata 1.1 CANNADICS="${CANNADICS}" # (optional)
26     DOCS="README*"
27    
28     # You don't need to modify these
29     #local cannadir dicsdir
30 usata 1.4 cannadir="${ROOT}/var/lib/canna/dic/canna"
31     dicsdir="${ROOT}/var/lib/canna/dic/dics.d"
32 usata 1.1
33     #
34     # pkg_setup() : sets up cannadic dir
35 agriffis 1.8 cannadic_pkg_setup() {
36 usata 1.1
37     keepdir $cannadir
38     fowners bin:bin $cannadir
39     fperms 0775 $cannadir
40     }
41    
42     #
43     # cannadic-install() : installs dictionaries to cannadir
44     #
45     cannadic-install() {
46    
47     insinto $cannadir
48     insopts -m0664 -o bin -g bin
49     doins "$@"
50     }
51    
52     #
53     # dicsdir-install() : installs dics.dir from ${FILESDIR}
54     #
55     dicsdir-install() {
56    
57     insinto ${dicsdir}
58     doins ${DICSDIRFILE}
59     }
60    
61     #
62     # src_install() : installs all dictionaries under ${WORKDIR}
63     # plus dics.dir and docs
64     #
65 agriffis 1.8 cannadic_src_install() {
66 usata 1.1
67     for f in *.c[btl]d *.t ; do
68     cannadic-install $f
69     done 2>/dev/null
70    
71 flameeyes 1.14 dicsdir-install || die
72 usata 1.1
73     dodoc ${DOCS}
74     }
75    
76     #
77     # update-cannadic-dir() : updates dics.dir for Canna Server,
78     # script for this part taken from Debian GNU/Linux
79     #
80     # compiles dics.dir files for Canna Server
81     # Copyright 2001 ISHIKAWA Mutsumi
82     # Licensed under the GNU General Public License, version 2. See the file
83     # /usr/portage/license/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.
84     update-cannadic-dir() {
85    
86     einfo
87     einfo "Updating dics.dir for Canna ..."
88     einfo
89    
90     # write new dics.dir file in case we are interrupted
91     cat >${cannadir}/dics.dir.update-new<<-EOF
92     # dics.dir -- automatically generated file by Portage.
93     # DO NOT EDIT BY HAND.
94     EOF
95    
96     for file in ${dicsdir}/*.dics.dir ; do
97     echo "# $file" >> ${cannadir}/dics.dir.update-new
98     cat $file >> ${cannadir}/dics.dir.update-new
99     einfo "Added $file."
100     done
101    
102     mv ${cannadir}/dics.dir.update-new ${cannadir}/dics.dir
103    
104     einfo
105     einfo "Done."
106     einfo
107     }
108    
109     #
110     # pkg_postinst() : updates dics.dir and print out notice after install
111     #
112 agriffis 1.8 cannadic_pkg_postinst() {
113 flameeyes 1.14 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."
117 usata 1.1
118 flameeyes 1.14 if [ -n "${CANNADICS}" ] ; then
119     einfo "e.g) add $(for d in ${CANNADICS}; do
120 swegener 1.11 echo -n "\"$d\" "
121 usata 1.1 done)to section use-dictionary()."
122 flameeyes 1.14 einfo "For details, see documents under /usr/share/doc/${PF}"
123     fi
124 usata 1.1
125 flameeyes 1.14 einfo "If you do not have ~/.canna, you can find sample files in /usr/share/canna."
126     ewarn "If you are upgrading from existing dictionary, you may need to recreate"
127     ewarn "user dictionary if you have one."
128     einfo
129 usata 1.1 }
130    
131     #
132     # pkg_postrm() : updates dics.dir and print out notice after uninstall
133     #
134 agriffis 1.8 cannadic_pkg_postrm() {
135 flameeyes 1.14 update-cannadic-dir
136     einfo
137     einfo "Please restart cannaserver to fit changes."
138     einfo "and modify your config file (~/.canna) to disable dictionary."
139 usata 1.1
140 flameeyes 1.14 if [ -n "${CANNADICS}" ] ; then
141     einfo "e.g) delete $(for d in ${CANNADICS}; do
142 swegener 1.11 echo -n "\"$d\" "
143 usata 1.1 done)from section use-dictionary()."
144 flameeyes 1.14 fi
145 usata 1.1
146 flameeyes 1.14 einfo
147 usata 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20