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

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

  ViewVC Help
Powered by ViewVC 1.1.20