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

Diff of /eclass/cannadic.eclass

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

Revision 1.14 Revision 1.16
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2011 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.14 2006/10/21 00:07:58 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.16 2011/08/22 04:46:31 vapier Exp $
4# 4
5# @ECLASS: cannadic.eclass
6# @AUTHOR:
5# Author: Mamoru KOMACHI <usata@gentoo.org> 7# Original author: Mamoru KOMACHI <usata@gentoo.org>
6# 8# @BLURB: Function for Canna compatible dictionaries
9# @DESCRIPTION:
7# The cannadic eclass is used for installation and setup of Canna 10# The cannadic eclass is used for installation and setup of Canna
8# compatible dictionaries within the Portage system. 11# compatible dictionaries within the Portage system.
9# 12
10 13
11EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm 14EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm
12 15
13IUSE="" 16IUSE=""
14 17
28# You don't need to modify these 31# You don't need to modify these
29#local cannadir dicsdir 32#local cannadir dicsdir
30cannadir="${ROOT}/var/lib/canna/dic/canna" 33cannadir="${ROOT}/var/lib/canna/dic/canna"
31dicsdir="${ROOT}/var/lib/canna/dic/dics.d" 34dicsdir="${ROOT}/var/lib/canna/dic/dics.d"
32 35
33# 36# @FUNCTION: cannadic_pkg_setup
34# pkg_setup() : sets up cannadic dir 37# @DESCRIPTION:
38# Sets up cannadic dir
35cannadic_pkg_setup() { 39cannadic_pkg_setup() {
36 40
37 keepdir $cannadir 41 keepdir $cannadir
38 fowners bin:bin $cannadir 42 fowners bin:bin $cannadir
39 fperms 0775 $cannadir 43 fperms 0775 $cannadir
40} 44}
41 45
42# 46# @FUNCTION: cannadic-install
43# cannadic-install() : installs dictionaries to cannadir 47# @DESCRIPTION:
44# 48# Installs dictionaries to cannadir
45cannadic-install() { 49cannadic-install() {
46 50
47 insinto $cannadir 51 insinto $cannadir
48 insopts -m0664 -o bin -g bin 52 insopts -m0664 -o bin -g bin
49 doins "$@" 53 doins "$@"
50} 54}
51 55
52# 56# @FUNCTION: dicsdir-install
53# dicsdir-install() : installs dics.dir from ${FILESDIR} 57# @DESCRIPTION:
54# 58# Installs dics.dir from ${DICSDIRFILE}
55dicsdir-install() { 59dicsdir-install() {
56 60
57 insinto ${dicsdir} 61 insinto ${dicsdir}
58 doins ${DICSDIRFILE} 62 doins ${DICSDIRFILE}
59} 63}
60 64
61# 65# @FUNCTION: cannadic_src_install
66# @DESCRIPTION:
62# src_install() : installs all dictionaries under ${WORKDIR} 67# Installs all dictionaries under ${WORKDIR}
63# plus dics.dir and docs 68# plus dics.dir and docs
64#
65cannadic_src_install() { 69cannadic_src_install() {
66 70
67 for f in *.c[btl]d *.t ; do 71 for f in *.c[btl]d *.t ; do
68 cannadic-install $f 72 cannadic-install $f
69 done 2>/dev/null 73 done 2>/dev/null
71 dicsdir-install || die 75 dicsdir-install || die
72 76
73 dodoc ${DOCS} 77 dodoc ${DOCS}
74} 78}
75 79
80# @FUNCTION: update-cannadic-dir
81# @DESCRIPTION:
82# Updates dics.dir for Canna Server, script for this part taken from Debian GNU/Linux
76# 83#
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 84# compiles dics.dir files for Canna Server
81# Copyright 2001 ISHIKAWA Mutsumi 85# Copyright 2001 ISHIKAWA Mutsumi
82# Licensed under the GNU General Public License, version 2. See the file 86# 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>. 87# /usr/portage/license/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.
84update-cannadic-dir() { 88update-cannadic-dir() {
85 89
86 einfo 90 einfo
87 einfo "Updating dics.dir for Canna ..." 91 einfo "Updating dics.dir for Canna ..."
88 einfo 92 einfo
104 einfo 108 einfo
105 einfo "Done." 109 einfo "Done."
106 einfo 110 einfo
107} 111}
108 112
109# 113# @FUNCTION: cannadic_pkg_postinst
114# @DESCRIPTION:
110# pkg_postinst() : updates dics.dir and print out notice after install 115# Updates dics.dir and print out notice after install
111#
112cannadic_pkg_postinst() { 116cannadic_pkg_postinst() {
113 update-cannadic-dir 117 update-cannadic-dir
114 einfo 118 einfo
115 einfo "Please restart cannaserver to fit the changes." 119 einfo "Please restart cannaserver to fit the changes."
116 einfo "You need to modify your config file (~/.canna) to enable dictionaries." 120 einfo "You need to modify your config file (~/.canna) to enable dictionaries."
126 ewarn "If you are upgrading from existing dictionary, you may need to recreate" 130 ewarn "If you are upgrading from existing dictionary, you may need to recreate"
127 ewarn "user dictionary if you have one." 131 ewarn "user dictionary if you have one."
128 einfo 132 einfo
129} 133}
130 134
131# 135# @FUNCTION: cannadic_pkg_postrm
136# @DESCRIPTION:
132# pkg_postrm() : updates dics.dir and print out notice after uninstall 137# Updates dics.dir and print out notice after uninstall
133#
134cannadic_pkg_postrm() { 138cannadic_pkg_postrm() {
135 update-cannadic-dir 139 update-cannadic-dir
136 einfo 140 einfo
137 einfo "Please restart cannaserver to fit changes." 141 einfo "Please restart cannaserver to fit changes."
138 einfo "and modify your config file (~/.canna) to disable dictionary." 142 einfo "and modify your config file (~/.canna) to disable dictionary."

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

  ViewVC Help
Powered by ViewVC 1.1.20