summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin F. Quinn <kevquinn@gentoo.org>2006-06-02 13:28:52 +0000
committerKevin F. Quinn <kevquinn@gentoo.org>2006-06-02 13:28:52 +0000
commit78faba191f3c599d6c6d346980a628f9c3ecbc8e (patch)
treee86fab8854c44ab903cd03c47f5a3224c4fd8329 /app-admin/eselect-oodict
parentAdd patch to fix rdoc call with rake 0.7. Thanks to Stephen Tallowitz in bug ... (diff)
downloadhistorical-78faba191f3c599d6c6d346980a628f9c3ecbc8e.tar.gz
historical-78faba191f3c599d6c6d346980a628f9c3ecbc8e.tar.bz2
historical-78faba191f3c599d6c6d346980a628f9c3ecbc8e.zip
Initial release
Package-Manager: portage-2.1_rc2-r3
Diffstat (limited to 'app-admin/eselect-oodict')
-rw-r--r--app-admin/eselect-oodict/ChangeLog11
-rw-r--r--app-admin/eselect-oodict/Manifest29
-rw-r--r--app-admin/eselect-oodict/eselect-oodict-20060601.ebuild21
-rw-r--r--app-admin/eselect-oodict/files/digest-eselect-oodict-200606011
-rw-r--r--app-admin/eselect-oodict/files/oodict.eselect-20060601319
-rw-r--r--app-admin/eselect-oodict/metadata.xml11
6 files changed, 392 insertions, 0 deletions
diff --git a/app-admin/eselect-oodict/ChangeLog b/app-admin/eselect-oodict/ChangeLog
new file mode 100644
index 000000000000..6d99fdfc8cb6
--- /dev/null
+++ b/app-admin/eselect-oodict/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for app-admin/eselect-oodict
+# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-oodict/ChangeLog,v 1.1 2006/06/02 13:28:52 kevquinn Exp $
+
+*eselect-oodict-20060601 (02 Jun 2006)
+
+ 02 Jun 2006; Kevin F. Quinn <kevquinn@gentoo.org>
+ +files/oodict.eselect-20060601, +metadata.xml,
+ +eselect-oodict-20060601.ebuild:
+ Initial release
+
diff --git a/app-admin/eselect-oodict/Manifest b/app-admin/eselect-oodict/Manifest
new file mode 100644
index 000000000000..4157a7b1780f
--- /dev/null
+++ b/app-admin/eselect-oodict/Manifest
@@ -0,0 +1,29 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX oodict.eselect-20060601 8601 RMD160 b155949bd135dada008071ff44bb75e4f986e03e SHA1 120066acaf062a658ce1a14ea97429a19a1c2023 SHA256 358908631dec0efd0ddf9372a27e5bea9c512a84f79dec478ee81bdf2ff5adab
+MD5 a8b3cbdf733441703d7003881cea00d5 files/oodict.eselect-20060601 8601
+RMD160 b155949bd135dada008071ff44bb75e4f986e03e files/oodict.eselect-20060601 8601
+SHA256 358908631dec0efd0ddf9372a27e5bea9c512a84f79dec478ee81bdf2ff5adab files/oodict.eselect-20060601 8601
+EBUILD eselect-oodict-20060601.ebuild 585 RMD160 811e6789033fad06d276ff3c80a86ba7f3d9b318 SHA1 5027b9d9ffc796e78dbef771b27a8c2bc042f907 SHA256 f5a9b2532f26f904e21f9b433a335af9d7a1e408440f4c19ed14f455ddfc737d
+MD5 94f8b71643358aab58ebcc203ea447ec eselect-oodict-20060601.ebuild 585
+RMD160 811e6789033fad06d276ff3c80a86ba7f3d9b318 eselect-oodict-20060601.ebuild 585
+SHA256 f5a9b2532f26f904e21f9b433a335af9d7a1e408440f4c19ed14f455ddfc737d eselect-oodict-20060601.ebuild 585
+MISC ChangeLog 418 RMD160 1013cadea9b59c44f2a8d705a33f1892a1ec85ea SHA1 864f7841828c2bea51df7f5c927e1116467094d7 SHA256 54253682f8f139ce746d17480f41e38235b5ac72e0367721ed77197223c5b913
+MD5 455c21d1ed7f279adb7ce2135b9c0ba5 ChangeLog 418
+RMD160 1013cadea9b59c44f2a8d705a33f1892a1ec85ea ChangeLog 418
+SHA256 54253682f8f139ce746d17480f41e38235b5ac72e0367721ed77197223c5b913 ChangeLog 418
+MISC metadata.xml 373 RMD160 6486334c78258a4c92f9677dedbf5f71792df98f SHA1 30355580d79cd9642443d08f2ce84d4f6b1ac19b SHA256 696ddf2d4ae253fa47210427a0a7185d45798382724b121b90b8404067cc7b70
+MD5 e65569ceeadc12f0be5c36ea4224e8ae metadata.xml 373
+RMD160 6486334c78258a4c92f9677dedbf5f71792df98f metadata.xml 373
+SHA256 696ddf2d4ae253fa47210427a0a7185d45798382724b121b90b8404067cc7b70 metadata.xml 373
+MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-eselect-oodict-20060601 1
+RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-eselect-oodict-20060601 1
+SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-eselect-oodict-20060601 1
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2.2 (GNU/Linux)
+
+iD8DBQFEgD9FZfNLSOUrp0sRAuczAJ9dy+M/RDvO/Etfrilp7hbPE5p8kgCdEEIh
+qa2VpjHNktaGWp7AfSjPlIg=
+=bUb9
+-----END PGP SIGNATURE-----
diff --git a/app-admin/eselect-oodict/eselect-oodict-20060601.ebuild b/app-admin/eselect-oodict/eselect-oodict-20060601.ebuild
new file mode 100644
index 000000000000..48e8169a0aed
--- /dev/null
+++ b/app-admin/eselect-oodict/eselect-oodict-20060601.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-oodict/eselect-oodict-20060601.ebuild,v 1.1 2006/06/02 13:28:52 kevquinn Exp $
+
+DESCRIPTION="Manages configuration of dictionaries for OpenOffice.Org."
+HOMEPAGE="http://www.gentoo.org/"
+
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE=""
+
+RDEPEND=">=app-admin/eselect-1.0.2"
+
+src_install() {
+ insinto /usr/share/eselect/modules
+ cp ${FILESDIR}/oodict.eselect-${PVR} ${T}/oodict.eselect
+ doins ${T}/oodict.eselect
+}
diff --git a/app-admin/eselect-oodict/files/digest-eselect-oodict-20060601 b/app-admin/eselect-oodict/files/digest-eselect-oodict-20060601
new file mode 100644
index 000000000000..8b137891791f
--- /dev/null
+++ b/app-admin/eselect-oodict/files/digest-eselect-oodict-20060601
@@ -0,0 +1 @@
+
diff --git a/app-admin/eselect-oodict/files/oodict.eselect-20060601 b/app-admin/eselect-oodict/files/oodict.eselect-20060601
new file mode 100644
index 000000000000..8b53d96a643d
--- /dev/null
+++ b/app-admin/eselect-oodict/files/oodict.eselect-20060601
@@ -0,0 +1,319 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id: oodict.eselect-20060601,v 1.1 2006/06/02 13:28:52 kevquinn Exp $
+
+DESCRIPTION="Manages configuration of dictionaries for OpenOffice.Org."
+MAINTAINER="kevquinn@gentoo.org"
+SVN_DATE='$Date: 2006/06/02 13:28:52 $'
+VERSION=$(svn_date_to_version "${SVN_DATE}" )
+
+# Supports myspell(hunspell) dictionaries; designed to be extensible to
+# manage other types of dictionaries should they become applicable
+# to OpenOffice.org.
+
+OOO_DICTBASE="/usr/lib/openoffice/share/dict/ooo"
+OOO_DICTLIST="dictionary.lst"
+
+MYSPELL_BASE="/usr/share/myspell"
+
+# set array "fields" to the elements of $1, separated by $2.
+# This saves having to muck about with IFS all over the place.
+oodict_set_fields() {
+ local old_IFS
+ old_IFS="${IFS}"
+ IFS=$2
+ fields=($1)
+ IFS="${old_IFS}"
+}
+
+# dictionary names are <class>-<lang>
+oodict_get_lang() {
+ local fields
+ oodict_set_fields "${P}" "-"
+ echo ${fields[1]}
+}
+
+# return suffixes for dictionary type; spelling dictionary,
+# hyphenation dictionary and thesaurus.
+oodict_get_myspell_suffixes() {
+ case $1 in
+ DICT) echo ".aff .dic" ;;
+ HYPH) echo ".dic" ;;
+ THES) echo ".dat .idx" ;;
+ esac
+}
+
+# display a heading (indented 4 spaces) and a wrapped list of
+# language codes (indented 6 spaces)
+oodict_display_langs() {
+ local count lang
+ printf " $1:\n"
+ shift
+ if [[ $1 == "" ]]; then
+ printf " (none)\n"
+ else
+ count=0
+ for lang in $*; do
+ [[ ${count} == 0 ]] && printf " "
+ printf " %s" ${lang}
+ ((count = count+1))
+ [[ ${count} == 22 ]] && printf "\n" && count=0
+ done
+ [[ ${count} == 0 ]] || printf "\n"
+ fi
+}
+
+# Format of dictionary.lst files (from OOo standard
+# dictionary.lst file):
+#
+# List of All Dictionaries to be Loaded by OpenOffice
+# ---------------------------------------------------
+# Each Entry in the list have the following space delimited fields
+#
+# Field 0: Entry Type "DICT" - spellchecking dictionary
+# "HYPH" - hyphenation dictionary
+# "THES" - thesaurus files
+#
+# Field 1: Language code from Locale "en" or "de" or "pt" ...
+#
+# Field 2: Country Code from Locale "US" or "GB" or "PT"
+#
+# Field 3: Root name of file(s) "en_US" or "hyph_de" or "th_en_US"
+# (do not add extensions to the name)
+
+# Format of MYSPELL_[SPELLING|HYPHENATION|THESAURUS]_DICTIONARIES:
+#
+# Field 0: Language code
+# Field 1: Country code
+# Field 2: Root name of dictionary files
+# Field 3: Description
+# Field 4: Archive filename
+#
+# This format is from the available.lst, hyphavail.lst and
+# thesavail.lst files on the openoffice.org repository.
+
+
+
+
+### show action
+
+## {{{ show stuff
+describe_show() {
+ echo "Show which dictionaries are configured for use with OpenOffice.org."
+}
+
+do_show() {
+ local lang sources suffix suffixes
+ [[ -f ${OOO_DICTBASE}/${OOO_DICTLIST} ]] || return
+ lang=""
+ myspell_sources=""
+ unknown_sources=""
+ listn=1
+ write_list_start "OpenOffice.org configured dictionaries"
+ while read entry; do
+ fields=(${entry})
+ [[ ${fields[0]:0:1} == "#" ]] && continue
+ lang=${fields[1]}
+ for suffix in $(oodict_get_myspell_suffixes ${fields[0]}); do
+ if [[ -h ${OOO_DICTBASE}/${fields[3]}${suffix} ]]; then
+ src=$(canonicalise ${OOO_DICTBASE}/${fields[3]}${suffix})
+ if [[ ${src/${MYSPELL_BASE}} != ${src} ]]; then
+ has ${lang} ${myspell_sources} ||
+ myspell_sources="${myspell_sources} ${lang}"
+ else
+ write_warning_msg "Unrecognised link to ${src} ignored\n"
+ fi
+ else
+ write_warning_msg "${OOO_DICTBASE}/${fields[3]}${suffix} is not a softlink, ignored\n"
+ fi
+ done
+ done <<-EOF
+ $(sort --key=2 ${OOO_DICTBASE}/${OOO_DICTLIST})
+ EOF
+ write_numbered_list_entry 1 "myspell"
+ oodict_display_langs "Configured language codes" ${myspell_sources}
+}
+## }}}
+
+
+### list action
+
+## {{{ list stuff
+describe_list() {
+ echo "List the dictionaries that can be configured for use with OpenOffice."
+}
+
+do_list() {
+ local known_langs
+ write_list_start "Installed dictionary sources:"
+ write_numbered_list_entry 1 "myspell"
+ known_langs=""
+ for dict in ${MYSPELL_BASE}/${OOO_DICTLIST}.*; do
+ known_langs="${known_langs} ${dict/${MYSPELL_BASE}\/${OOO_DICTLIST}.}"
+ done
+ oodict_display_langs "Installed language codes" ${known_langs}
+}
+## }}}
+
+
+### unset action
+
+## {{{ unset stuff
+describe_unset() {
+ echo "Unconfigure a dictionary from use with OpenOffice.org."
+}
+
+describe_unset_parameters() {
+ echo "<dictionary>"
+}
+
+describe_unset_options() {
+ echo "dictionary: <class>-<lang> e.g. myspell-en"
+}
+
+do_unset() {
+ # Check OOo dictionary area exists
+ [[ -d ${OOO_DICTBASE} ]] || return
+ local dict dlang dtype suffix filen dictlst entry fields
+ dict=$1
+ dlang=${dict/*-}
+ dtype=${dict/-*}
+ dictlst="${OOO_DICTLIST}.${dlang}"
+ case ${dtype} in
+ myspell)
+ # Remove softlinks and entries in dictionary.lst - uses
+ # dictionary.<lang>.lst from /usr/share/myspell
+ if [[ -f ${MYSPELL_BASE}/${dictlst} ]]; then
+ while read entry; do
+ fields=(${entry})
+ [[ ${fields[0]:0:1} == "#" ]] && continue
+ [[ ${fields[3]} == "" ]] && continue
+ # Remove entry from dictionary.lst
+ sed -i -e "/^${fields[0]} ${fields[1]} ${fields[2]} ${fields[3]}$/ { d }" \
+ ${OOO_DICTBASE}/${OOO_DICTLIST} ||
+ die "Could not edit ${OOO_DICTBASE}/${OOO_DICTLIST}"
+ # See if any other entries in dictionary.lst match the current
+ # dictionary type and filename
+ grep "^${fields[0]} .* ${fields[3]}$" ${OOO_DICTBASE}/${OOO_DICTLIST} \
+ 2>&1 > /dev/null && continue
+ # If no other entries match, remove relevant symlinks
+ for suffix in $(oodict_get_myspell_suffixes ${fields[0]}); do
+ filen="${fields[3]}${suffix}"
+ [[ -f ${OOO_DICTBASE}/${filen} ]] &&
+ if [[ -h ${OOO_DICTBASE}/${filen} ]]; then
+ rm -f ${OOO_DICTBASE}/${filen} ||
+ die "Failed t remove ${OOO_DICTBASE}/${filen}"
+ else
+ write_warning_msg "File ${OOO_DICTBASE}/${filen} is not a softlink so left untouched"
+ fi
+ done
+ done < ${MYSPELL_BASE}/${dictlst}
+ else
+ write_warning_msg "Source ${dict} is not installed; nothing changed"
+ fi
+ ;;
+ *)
+ die "Unknown dictionary type ${dtype}"
+ ;;
+ esac
+}
+## }}}
+
+### set action
+
+## {{{ set stuff
+describe_set() {
+ echo "Configure a dictionary for use with OpenOffice.org."
+}
+
+describe_set_parameters() {
+ echo "<dictionary>"
+}
+
+describe_set_options() {
+ echo "dictionary: <class>-<lang> e.g. myspell-en"
+}
+
+do_set() {
+ local dict dlang dtype filen dictlst entry fields suffix
+ dict=$1
+ dlang=${dict/*-}
+ dtype=${dict/-*}
+ dictlst="${OOO_DICTLIST}.${dlang}"
+ case ${dtype} in
+ myspell)
+ # Clear out any existing entry
+ do_unset ${dict}
+ # Ensure OOo dictionary area exists
+ [[ -d ${OOO_DICTBASE} ]] || mkdir -p ${OOO_DICTBASE}
+ # Set new entries & links
+ [[ -f ${MYSPELL_BASE}/${dictlst} ]] ||
+ die "Dictionary $1 not found in ${MYSPELL_BASE}"
+ [[ -f ${OOO_DICTBASE}/${OOO_DICTLIST} ]] ||
+ touch ${OOO_DICTBASE}/${OOO_DICTLIST} ||
+ die "Unable to create ${OOO_DICTBASE}/${OOO_DICTLIST}"
+ while read entry; do
+ fields=(${entry})
+ [[ ${fields[0]:0:1} == "#" ]] && continue
+ grep "^${fields[0]} ${fields[1]} ${fields[2]} " \
+ ${OOO_DICTBASE}/${OOO_DICTLIST} > /dev/null 2>&1 ||
+ echo "${entry}" >> ${OOO_DICTBASE}/${OOO_DICTLIST}
+ for suffix in $(oodict_get_myspell_suffixes ${fields[0]}); do
+ filen="${fields[3]}${suffix}"
+ if [[ -h ${OOO_DICTBASE}/${filen} ]]; then
+ rm -f ${OOO_DICTBASE}/${filen} ||
+ die "Failed to remove ${OOO_DICTBASE}/${filen}"
+ fi
+ if [[ ! -f ${OOO_DICTBASE}/${filen} ]]; then
+ ln -s ${MYSPELL_BASE}/${filen} ${OOO_DICTBASE}/${filen} ||
+ die "Failed to create symlink from ${MYSPELL_BASE}/${filen} to ${OOO_DICTBASE}/${filen}"
+ else
+ write_warning_msg "File ${OOO_DICTBASE}/${filen} is not a softlink so left untouched"
+ fi
+ done
+ done < ${MYSPELL_BASE}/${dictlst}
+ ;;
+ *)
+ die "Unknown dictionary type $1"
+ ;;
+ esac
+}
+## }}}
+
+
+### update action
+
+## {{{ update stuff
+describe_update() {
+ echo "(Re)build OpenOffice.org dictionary configuration."
+}
+
+describe_update_parameters() {
+ echo "[<class>]"
+}
+
+describe_update_options() {
+ echo "class: type of dictionary (e.g. myspell) - omit to update everything"
+}
+
+do_update() {
+ local dlang dtype dictlst dtypes
+ dtypes=$1
+ [[ -z ${dtypes} ]] && dtypes="myspell"
+ for dtype in ${dtypes}; do
+ case ${dtype} in
+ myspell)
+ for dictlst in ${MYSPELL_BASE}/${OOO_DICTLIST}.*; do
+ dlang=${dictlst/*.lst.}
+ do_set ${dtype}-${dlang}
+ done
+ ;;
+ *)
+ die "Unknown dictionary type $1"
+ ;;
+ esac
+ done
+}
+## }}}
+
+# vim: ts=4 sw=4 noet fdm=marker
diff --git a/app-admin/eselect-oodict/metadata.xml b/app-admin/eselect-oodict/metadata.xml
new file mode 100644
index 000000000000..76018c025e71
--- /dev/null
+++ b/app-admin/eselect-oodict/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>app-dicts</herd>
+<herd>openoffice</herd>
+<maintainer>
+ <email>kevquinn@gentoo.org</email>
+ <name>Kevin F. Quinn</name>
+</maintainer>
+<longdescription>Manages configuration of dictionaries for OpenOffice.Org.</longdescription>
+</pkgmetadata>