--- eclass/cannadic.eclass 2005/11/30 09:59:19 1.1.1.1 +++ eclass/cannadic.eclass 2012/09/15 16:16:53 1.17 @@ -1,18 +1,20 @@ -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.1.1.1 2005/11/30 09:59:19 chriswhite Exp $ -# -# Author: Mamoru KOMACHI -# +# $Header: /var/cvsroot/gentoo-x86/eclass/cannadic.eclass,v 1.17 2012/09/15 16:16:53 zmedico Exp $ + +# @ECLASS: cannadic.eclass +# @AUTHOR: +# Original author: Mamoru KOMACHI +# @BLURB: Function for Canna compatible dictionaries +# @DESCRIPTION: # The cannadic eclass is used for installation and setup of Canna # compatible dictionaries within the Portage system. -# + EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm -IUSE="canna" +IUSE="" -DESCRIPTION="Based on the $ECLASS eclass" HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this! SRC_URI="mirror://gentoo/${P}.tar.gz" @@ -21,7 +23,7 @@ S="${WORKDIR}" -DICSDIRFILE="$(echo ${FILESDIR}/*.dics.dir)" +DICSDIRFILE="${FILESDIR}/*.dics.dir" CANNADICS="${CANNADICS}" # (optional) DOCS="README*" @@ -30,8 +32,9 @@ cannadir="${ROOT}/var/lib/canna/dic/canna" dicsdir="${ROOT}/var/lib/canna/dic/dics.d" -# -# pkg_setup() : sets up cannadic dir +# @FUNCTION: cannadic_pkg_setup +# @DESCRIPTION: +# Sets up cannadic dir cannadic_pkg_setup() { keepdir $cannadir @@ -39,9 +42,9 @@ fperms 0775 $cannadir } -# -# cannadic-install() : installs dictionaries to cannadir -# +# @FUNCTION: cannadic-install +# @DESCRIPTION: +# Installs dictionaries to cannadir cannadic-install() { insinto $cannadir @@ -49,40 +52,38 @@ doins "$@" } -# -# dicsdir-install() : installs dics.dir from ${FILESDIR} -# +# @FUNCTION: dicsdir-install +# @DESCRIPTION: +# Installs dics.dir from ${DICSDIRFILE} dicsdir-install() { insinto ${dicsdir} doins ${DICSDIRFILE} } -# -# src_install() : installs all dictionaries under ${WORKDIR} -# plus dics.dir and docs -# +# @FUNCTION: cannadic_src_install +# @DESCRIPTION: +# Installs all dictionaries under ${WORKDIR} +# plus dics.dir and docs cannadic_src_install() { for f in *.c[btl]d *.t ; do cannadic-install $f done 2>/dev/null - if use canna ; then - dicsdir-install || die - fi + dicsdir-install || die dodoc ${DOCS} } -# -# update-cannadic-dir() : updates dics.dir for Canna Server, -# script for this part taken from Debian GNU/Linux -# -# compiles dics.dir files for Canna Server -# Copyright 2001 ISHIKAWA Mutsumi -# Licensed under the GNU General Public License, version 2. See the file -# /usr/portage/license/GPL-2 or . +# @FUNCTION: update-cannadic-dir +# @DESCRIPTION: +# Updates dics.dir for Canna Server, script for this part taken from Debian GNU/Linux +# +# compiles dics.dir files for Canna Server +# Copyright 2001 ISHIKAWA Mutsumi +# Licensed under the GNU General Public License, version 2. See the file +# /usr/portage/license/GPL-2 or . update-cannadic-dir() { einfo @@ -108,48 +109,42 @@ einfo } -# -# pkg_postinst() : updates dics.dir and print out notice after install -# +# @FUNCTION: cannadic_pkg_postinst +# @DESCRIPTION: +# Updates dics.dir and print out notice after install cannadic_pkg_postinst() { + update-cannadic-dir + einfo + einfo "Please restart cannaserver to fit the changes." + einfo "You need to modify your config file (~/.canna) to enable dictionaries." - if use canna ; then - update-cannadic-dir - einfo - einfo "Please restart cannaserver to fit the changes." - einfo "You need to modify your config file (~/.canna) to enable dictionaries." - - if [ -n "${CANNADICS}" ] ; then - einfo "e.g) add $(for d in ${CANNADICS}; do + if [ -n "${CANNADICS}" ] ; then + einfo "e.g) add $(for d in ${CANNADICS}; do echo -n "\"$d\" " done)to section use-dictionary()." - einfo "For details, see documents under /usr/share/doc/${PF}" - fi - - einfo "If you do not have ~/.canna, you can find sample files in /usr/share/canna." - ewarn "If you are upgrading from existing dictionary, you may need to recreate" - ewarn "user dictionary if you have one." - einfo + einfo "For details, see documents under /usr/share/doc/${PF}" fi + + einfo "If you do not have ~/.canna, you can find sample files in /usr/share/canna." + ewarn "If you are upgrading from existing dictionary, you may need to recreate" + ewarn "user dictionary if you have one." + einfo } -# -# pkg_postrm() : updates dics.dir and print out notice after uninstall -# +# @FUNCTION: cannadic_pkg_postrm +# @DESCRIPTION: +# Updates dics.dir and print out notice after uninstall cannadic_pkg_postrm() { + update-cannadic-dir + einfo + einfo "Please restart cannaserver to fit changes." + einfo "and modify your config file (~/.canna) to disable dictionary." - if use canna ; then - update-cannadic-dir - einfo - einfo "Please restart cannaserver to fit changes." - einfo "and modify your config file (~/.canna) to disable dictionary." - - if [ -n "${CANNADICS}" ] ; then - einfo "e.g) delete $(for d in ${CANNADICS}; do + if [ -n "${CANNADICS}" ] ; then + einfo "e.g) delete $(for d in ${CANNADICS}; do echo -n "\"$d\" " done)from section use-dictionary()." - fi - - einfo fi + + einfo }