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

Diff of /eclass/myspell.eclass

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

Revision 1.4 Revision 1.5
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.4 2006/06/15 11:25:18 kevquinn Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/myspell.eclass,v 1.5 2006/07/08 15:20:13 kevquinn Exp $
4 4
5# Author: Kevin F. Quinn <kevquinn@gentoo.org> 5# Author: Kevin F. Quinn <kevquinn@gentoo.org>
6# Packages: app-dicts/myspell-* 6# Packages: app-dicts/myspell-*
7# Herd: app-dicts 7# Herd: app-dicts
8 8
9inherit multilib
10
9EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst 11EXPORT_FUNCTIONS src_install pkg_preinst pkg_postinst
10 12
11IUSE="" 13IUSE=""
12 14
13SLOT="0" 15SLOT="0"
20RDEPEND="" 22RDEPEND=""
21 23
22# The destination directory for myspell dictionaries 24# The destination directory for myspell dictionaries
23MYSPELL_DICTBASE="/usr/share/myspell" 25MYSPELL_DICTBASE="/usr/share/myspell"
24 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.
25# The location for openoffice softlinks 30# The location for openoffice softlinks
26MYSPELL_OOOBASE="/usr/lib/openoffice/share/dict/ooo" 31MYSPELL_OOOBASE="/usr/lib/openoffice/share/dict/ooo"
27 32
28 33
29# set array "fields" to the elements of $1, separated by $2. 34# set array "fields" to the elements of $1, separated by $2.
148 153
149 154
150# Add entries in dictionary.lst.<lang> to OOo dictionary.lst 155# Add entries in dictionary.lst.<lang> to OOo dictionary.lst
151# and create softlinks indicated by dictionary.lst.<lang> 156# and create softlinks indicated by dictionary.lst.<lang>
152myspell_pkg_postinst() { 157myspell_pkg_postinst() {
153 has_version eselect-oodict && 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
154 eselect oodict set myspell-$(get_myspell_lang) 171 eselect oodict set myspell-$(get_myspell_lang)
172 return
173 fi
155 174
156 # Legacy code for dictionaries installed before eselect-oodict existed 175 # Legacy code for dictionaries installed before eselect-oodict existed
157 # so has to remain for binpkg support. This code is unmaintained - 176 # so has to remain for binpkg support. This code is unmaintained -
158 # if you have a problem with it, emerge eselect-oodict. 177 # if you have a problem with it, emerge app-admin/eselect-oodict.
159 [[ -d ${MYSPELL_OOOBASE} ]] || return 178 [[ -d ${MYSPELL_OOOBASE} ]] || return
160 # 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
161 # deliberately _not_ listed in the package database. 180 # deliberately _not_ listed in the package database.
162 local dictlst entry fields prefix suffix suffixes filen 181 local dictlst entry fields prefix suffix suffixes filen
163 # Note; can only reach this point if ${MYSPELL_DICTBASE}/${dictlst} 182 # Note; can only reach this point if ${MYSPELL_DICTBASE}/${dictlst}
186# Remove softlinks and entries in dictionary.lst - uses 205# Remove softlinks and entries in dictionary.lst - uses
187# dictionary.<lang>.lst from /usr/share/myspell 206# dictionary.<lang>.lst from /usr/share/myspell
188# Done in preinst (prerm happens after postinst, which overwrites 207# Done in preinst (prerm happens after postinst, which overwrites
189# the dictionary.<lang>.lst file) 208# the dictionary.<lang>.lst file)
190myspell_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
191 if has_version app-admin/eselect-oodict; then 225 if has_version app-admin/eselect-oodict; then
192 eselect oodict unset myspell-$(get_myspell_lang) 226 eselect oodict unset myspell-$(get_myspell_lang)
193 return 227 return
194 fi 228 fi
195 229
196 # Legacy code for dictionaries installed before eselect-oodict existed 230 # Legacy code for dictionaries installed before eselect-oodict existed
197 # Don't delete this; needed for uninstalls and binpkg support. 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.
198 local filen dictlst entry fields removeentry suffix 234 local filen dictlst entry fields removeentry suffix
199 dictlst="dictionary.lst.$(get_myspell_lang)" 235 dictlst="dictionary.lst.$(get_myspell_lang)"
200 [[ -d ${MYSPELL_OOOBASE} ]] || return 236 [[ -d ${MYSPELL_OOOBASE} ]] || return
201 [[ -f ${MYSPELL_DICTBASE}/${dictlst} ]] || return 237 [[ -f ${MYSPELL_DICTBASE}/${dictlst} ]] || return
202 while read entry; do 238 while read entry; do

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

  ViewVC Help
Powered by ViewVC 1.1.20