/[gentoo-x86]/eclass/myspell.eclass
Gentoo

Diff of /eclass/myspell.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.4
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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/myspell.eclass,v 1.3 2006/05/22 18:09:00 kevquinn Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/myspell.eclass,v 1.4 2006/06/15 11:25:18 kevquinn Exp $
4
5# Author: Kevin F. Quinn <kevquinn@gentoo.org>
6# Packages: app-dicts/myspell-*
7# Herd: app-dicts
4 8
5EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst 9EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst
6 10
7IUSE="" 11IUSE=""
8 12
9SLOT="0" 13SLOT="0"
10 14
11# tar, gzip, bzip2 are included in the base profile, but not unzip 15# tar, gzip, bzip2 are included in the base profile, but not unzip
12DEPEND="app-arch/unzip" 16DEPEND="app-arch/unzip"
13 17
14# The console application for using myspell dictionaries is 18# Dictionaries don't have any runtime dependencies
15# hunspell (which is making myspell itself obsolete). 19# Myspell dictionaries can be used by hunspell, openoffice and others
16RDEPEND="app-text/hunspell" 20RDEPEND=""
17 21
18# The destination directory for myspell dictionaries 22# The destination directory for myspell dictionaries
19MYSPELL_DICTBASE="/usr/share/myspell" 23MYSPELL_DICTBASE="/usr/share/myspell"
20 24
21# The location for openoffice softlinks 25# The location for openoffice softlinks
144 148
145 149
146# Add entries in dictionary.lst.<lang> to OOo dictionary.lst 150# Add entries in dictionary.lst.<lang> to OOo dictionary.lst
147# and create softlinks indicated by dictionary.lst.<lang> 151# and create softlinks indicated by dictionary.lst.<lang>
148myspell_pkg_postinst() { 152myspell_pkg_postinst() {
153 has_version eselect-oodict &&
154 eselect oodict set myspell-$(get_myspell_lang)
155
156 # Legacy code for dictionaries installed before eselect-oodict existed
157 # so has to remain for binpkg support. This code is unmaintained -
158 # if you have a problem with it, emerge eselect-oodict.
149 [[ -d ${MYSPELL_OOOBASE} ]] || return 159 [[ -d ${MYSPELL_OOOBASE} ]] || return
150 # This stuff is here, not in src_install, as the softlinks are 160 # This stuff is here, not in src_install, as the softlinks are
151 # deliberately _not_ listed in the package database. 161 # deliberately _not_ listed in the package database.
152 local dictlst entry fields prefix suffix suffixes filen 162 local dictlst entry fields prefix suffix suffixes filen
153 # Note; can only reach this point if ${MYSPELL_DICTBASE}/${dictlst} 163 # Note; can only reach this point if ${MYSPELL_DICTBASE}/${dictlst}
176# Remove softlinks and entries in dictionary.lst - uses 186# Remove softlinks and entries in dictionary.lst - uses
177# dictionary.<lang>.lst from /usr/share/myspell 187# dictionary.<lang>.lst from /usr/share/myspell
178# Done in preinst (prerm happens after postinst, which overwrites 188# Done in preinst (prerm happens after postinst, which overwrites
179# the dictionary.<lang>.lst file) 189# the dictionary.<lang>.lst file)
180myspell_pkg_preinst() { 190myspell_pkg_preinst() {
191 if has_version app-admin/eselect-oodict; then
192 eselect oodict unset myspell-$(get_myspell_lang)
193 return
194 fi
195
196 # Legacy code for dictionaries installed before eselect-oodict existed
197 # Don't delete this; needed for uninstalls and binpkg support.
181 local filen dictlst entry fields removeentry suffix 198 local filen dictlst entry fields removeentry suffix
182 dictlst="dictionary.lst.$(get_myspell_lang)" 199 dictlst="dictionary.lst.$(get_myspell_lang)"
183 [[ -d ${MYSPELL_OOOBASE} ]] || return 200 [[ -d ${MYSPELL_OOOBASE} ]] || return
184 [[ -f ${MYSPELL_DICTBASE}/${dictlst} ]] || return 201 [[ -f ${MYSPELL_DICTBASE}/${dictlst} ]] || return
185 while read entry; do 202 while read entry; do

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.20