mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
cannadic.eclass: use einstalldocs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user