summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2017-07-12 20:54:47 +0900
committerAkinori Hattori <hattya@gentoo.org>2017-07-12 20:54:47 +0900
commit85a858e7d6a6e45e158b3874a7eff5162dcdfc81 (patch)
tree49a5508841996f3b2c4542231734aaa9b733f7ec /eclass/cannadic.eclass
parentapp-admin/logrotate: Fix path in service unit and remove src_compile (diff)
downloadgentoo-85a858e7d6a6e45e158b3874a7eff5162dcdfc81.tar.gz
gentoo-85a858e7d6a6e45e158b3874a7eff5162dcdfc81.tar.bz2
gentoo-85a858e7d6a6e45e158b3874a7eff5162dcdfc81.zip
cannadic.eclass: use einstalldocs
Diffstat (limited to 'eclass/cannadic.eclass')
-rw-r--r--eclass/cannadic.eclass73
1 files changed, 31 insertions, 42 deletions
diff --git a/eclass/cannadic.eclass b/eclass/cannadic.eclass
index d407751f6893..ac15bb73ac50 100644
--- a/eclass/cannadic.eclass
+++ b/eclass/cannadic.eclass
@@ -1,33 +1,27 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: cannadic.eclass
+# @MAINTAINER:
+# cjk@gentoo.org
# @AUTHOR:
-# Original author: Mamoru KOMACHI <usata@gentoo.org>
+# Mamoru KOMACHI <usata@gentoo.org>
# @BLURB: Function for Canna compatible dictionaries
# @DESCRIPTION:
# The cannadic eclass is used for installation and setup of Canna
# compatible dictionaries within the Portage system.
+inherit eutils
-EXPORT_FUNCTIONS src_install pkg_setup pkg_postinst pkg_postrm
+EXPORT_FUNCTIONS pkg_setup pkg_postinst pkg_postrm src_install
-IUSE=""
-
-HOMEPAGE="http://canna.sourceforge.jp/" # you need to change this!
+HOMEPAGE="http://canna.osdn.jp/" # you need to change this!
SRC_URI="mirror://gentoo/${P}.tar.gz"
-LICENSE="public-domain"
-SLOT="0"
-
-S="${WORKDIR}"
-
DICSDIRFILE="${FILESDIR}/*.dics.dir"
CANNADICS="${CANNADICS}" # (optional)
-DOCS="README*"
# You don't need to modify these
-#local cannadir dicsdir
cannadir="${ROOT}/var/lib/canna/dic/canna"
dicsdir="${ROOT}/var/lib/canna/dic/dics.d"
@@ -35,27 +29,24 @@ dicsdir="${ROOT}/var/lib/canna/dic/dics.d"
# @DESCRIPTION:
# Sets up cannadic dir
cannadic_pkg_setup() {
-
- keepdir $cannadir
- fowners bin:bin $cannadir
- fperms 0775 $cannadir
+ keepdir ${cannadir}
+ fowners bin:bin ${cannadir}
+ fperms 0775 ${cannadir}
}
# @FUNCTION: cannadic-install
# @DESCRIPTION:
# Installs dictionaries to cannadir
cannadic-install() {
-
- insinto $cannadir
- insopts -m0664 -o bin -g bin
- doins "$@"
+ insinto ${cannadir}
+ insopts -m 0664 -o bin -g bin
+ doins "${@}"
}
# @FUNCTION: dicsdir-install
# @DESCRIPTION:
# Installs dics.dir from ${DICSDIRFILE}
dicsdir-install() {
-
insinto ${dicsdir}
doins ${DICSDIRFILE}
}
@@ -65,14 +56,14 @@ dicsdir-install() {
# 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
+ local f
+ for f in *.c[btl]d *.t; do
+ cannadic-install ${f}
+ done 2> /dev/null
dicsdir-install || die
- dodoc ${DOCS}
+ einstalldocs
}
# @FUNCTION: update-cannadic-dir
@@ -84,21 +75,21 @@ cannadic_src_install() {
# Licensed under the GNU General Public License, version 2. See the file
# /usr/portage/license/GPL-2 or <http://www.gnu.org/copyleft/gpl.txt>.
update-cannadic-dir() {
-
einfo
einfo "Updating dics.dir for Canna ..."
einfo
# write new dics.dir file in case we are interrupted
- cat >${cannadir}/dics.dir.update-new<<-EOF
+ cat <<-EOF > ${cannadir}/dics.dir.update-new
# dics.dir -- automatically generated file by Portage.
# DO NOT EDIT BY HAND.
EOF
- for file in ${dicsdir}/*.dics.dir ; do
- echo "# $file" >> ${cannadir}/dics.dir.update-new
- cat $file >> ${cannadir}/dics.dir.update-new
- einfo "Added $file."
+ local f
+ for f in ${dicsdir}/*.dics.dir; do
+ echo "# ${f}" >> ${cannadir}/dics.dir.update-new
+ cat ${f} >> ${cannadir}/dics.dir.update-new
+ einfo "Added ${f}."
done
mv ${cannadir}/dics.dir.update-new ${cannadir}/dics.dir
@@ -113,15 +104,14 @@ update-cannadic-dir() {
# 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 [ -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}"
+ 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."
@@ -135,14 +125,13 @@ cannadic_pkg_postinst() {
# 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 [ -n "${CANNADICS}" ] ; then
- einfo "e.g) delete $(for d in ${CANNADICS}; do
- echo -n "\"$d\" "
- done)from section use-dictionary()."
+ if [[ -n "${CANNADICS}" ]]; then
+ einfo "e.g) delete $(for d in ${CANNADICS}; do echo -n "\"${d}\" "; done)from section use-dictionary()."
fi
einfo