/[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.6
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.6 2009/02/09 08:21:00 pva Exp $
4
5# Author: Kevin F. Quinn <kevquinn@gentoo.org>
6# Packages: app-dicts/myspell-*
7# Herd: app-dicts
8
9inherit multilib
4 10
5EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst 11EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst
6 12
7IUSE="" 13IUSE=""
8 14
9SLOT="0" 15SLOT="0"
10 16
11# tar, gzip, bzip2 are included in the base profile, but not unzip 17# tar, gzip, bzip2 are included in the base profile, but not unzip
12DEPEND="app-arch/unzip" 18DEPEND="app-arch/unzip"
13 19
14# The console application for using myspell dictionaries is 20# Dictionaries don't have any runtime dependencies
15# hunspell (which is making myspell itself obsolete). 21# Myspell dictionaries can be used by hunspell, openoffice and others
16RDEPEND="app-text/hunspell" 22RDEPEND=""
17 23
18# The destination directory for myspell dictionaries 24# The destination directory for myspell dictionaries
19MYSPELL_DICTBASE="/usr/share/myspell" 25MYSPELL_DICTBASE="/usr/share/myspell"
20 26
27# Legacy variable for dictionaries installed before eselect-oodict existed
28# so has to remain for binpkg support. This variable is unmaintained -
29# if you have a problem with it, emerge app-admin/eselect-oodict.
21# The location for openoffice softlinks 30# The location for openoffice softlinks
22MYSPELL_OOOBASE="/usr/lib/openoffice/share/dict/ooo" 31MYSPELL_OOOBASE="/usr/lib/openoffice/share/dict/ooo"
23 32
24 33
25# set array "fields" to the elements of $1, separated by $2. 34# set array "fields" to the elements of $1, separated by $2.
107# This format is from the available.lst, hyphavail.lst and 116# This format is from the available.lst, hyphavail.lst and
108# thesavail.lst files on the openoffice.org repository. 117# thesavail.lst files on the openoffice.org repository.
109 118
110myspell_src_install() { 119myspell_src_install() {
111 local filen fields entry dictlst 120 local filen fields entry dictlst
112 cd ${WORKDIR} 121 cd "${WORKDIR}"
113 # Install the dictionary, hyphenation and thesaurus files. 122 # Install the dictionary, hyphenation and thesaurus files.
114 # Create dictionary.lst.<lang> file containing the parts of 123 # Create dictionary.lst.<lang> file containing the parts of
115 # OOo's dictionary.lst file for this language, indicating 124 # OOo's dictionary.lst file for this language, indicating
116 # which dictionaries are relevant for each country variant 125 # which dictionaries are relevant for each country variant
117 # of the language. 126 # of the language.
144 153
145 154
146# Add entries in dictionary.lst.<lang> to OOo dictionary.lst 155# Add entries in dictionary.lst.<lang> to OOo dictionary.lst
147# and create softlinks indicated by dictionary.lst.<lang> 156# and create softlinks indicated by dictionary.lst.<lang>
148myspell_pkg_postinst() { 157myspell_pkg_postinst() {
158 # Update for known applications
159 if has_version ">=app-admin/eselect-oodict-20060706"; then
160 if has_version app-office/openoffice; then
161 eselect oodict set myspell-$(get_myspell_lang)
162 fi
163 if has_version app-office/openoffice-bin; then
164 # On AMD64, openoffice-bin is 32-bit so force ABI
165 has_multilib_profile && ABI=x86
166 eselect oodict set myspell-$(get_myspell_lang) --libdir $(get_libdir)
167 fi
168 return
169 fi
170 if has_version app-admin/eselect-oodict; then
171 eselect oodict set myspell-$(get_myspell_lang)
172 return
173 fi
174
175 # Legacy code for dictionaries installed before eselect-oodict existed
176 # so has to remain for binpkg support. This code is unmaintained -
177 # if you have a problem with it, emerge app-admin/eselect-oodict.
149 [[ -d ${MYSPELL_OOOBASE} ]] || return 178 [[ -d ${MYSPELL_OOOBASE} ]] || return
150 # This stuff is here, not in src_install, as the softlinks are 179 # This stuff is here, not in src_install, as the softlinks are
151 # deliberately _not_ listed in the package database. 180 # deliberately _not_ listed in the package database.
152 local dictlst entry fields prefix suffix suffixes filen 181 local dictlst entry fields prefix suffix suffixes filen
153 # Note; can only reach this point if ${MYSPELL_DICTBASE}/${dictlst} 182 # Note; can only reach this point if ${MYSPELL_DICTBASE}/${dictlst}
176# Remove softlinks and entries in dictionary.lst - uses 205# Remove softlinks and entries in dictionary.lst - uses
177# dictionary.<lang>.lst from /usr/share/myspell 206# dictionary.<lang>.lst from /usr/share/myspell
178# Done in preinst (prerm happens after postinst, which overwrites 207# Done in preinst (prerm happens after postinst, which overwrites
179# the dictionary.<lang>.lst file) 208# the dictionary.<lang>.lst file)
180myspell_pkg_preinst() { 209myspell_pkg_preinst() {
210 # Update for known applications
211 if has_version ">=app-admin/eselect-oodict-20060706"; then
212 if has_version app-office/openoffice; then
213 # When building from source, the default library path is correct
214 eselect oodict unset myspell-$(get_myspell_lang)
215 fi
216 if has_version app-office/openoffice-bin; then
217 # On AMD64, openoffice-bin is 32-bit, so get 32-bit library directory
218 has_multilib_profile && ABI=x86
219 eselect oodict unset myspell-$(get_myspell_lang) --libdir $(get_libdir)
220 fi
221 eselect oodict unset myspell-$(get_myspell_lang) --libdir $(get_libdir)
222 return
223 fi
224 # Previous versions of eselect-oodict didn't cater for -bin on amd64
225 if has_version app-admin/eselect-oodict; then
226 eselect oodict unset myspell-$(get_myspell_lang)
227 return
228 fi
229
230 # Legacy code for dictionaries installed before eselect-oodict existed
231 # Don't delete this; needed for uninstalls and binpkg support.
232 # This code is unmaintained - if you have a problem with it,
233 # emerge app-admin/eselect-oodict.
181 local filen dictlst entry fields removeentry suffix 234 local filen dictlst entry fields removeentry suffix
182 dictlst="dictionary.lst.$(get_myspell_lang)" 235 dictlst="dictionary.lst.$(get_myspell_lang)"
183 [[ -d ${MYSPELL_OOOBASE} ]] || return 236 [[ -d ${MYSPELL_OOOBASE} ]] || return
184 [[ -f ${MYSPELL_DICTBASE}/${dictlst} ]] || return 237 [[ -f ${MYSPELL_DICTBASE}/${dictlst} ]] || return
185 while read entry; do 238 while read entry; do

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

  ViewVC Help
Powered by ViewVC 1.1.20