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

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

  ViewVC Help
Powered by ViewVC 1.1.20