1 |
ciaranm |
1.1 |
# Copyright 1999-2005 Gentoo Foundation |
2 |
|
|
# Distributed under the terms of the GNU General Public License v2 |
3 |
pioto |
1.6 |
# $Header: /var/cvsroot/gentoo-x86/eclass/vim-spell.eclass,v 1.5 2006/01/23 21:35:21 ciaranm Exp $ |
4 |
ciaranm |
1.1 |
|
5 |
|
|
# |
6 |
|
|
# Original Author: Ciaran McCreesh <ciaranm@gentoo.org> |
7 |
|
|
# Maintainers: Vim Herd <vim@gentoo.org> |
8 |
|
|
# Purpose: Simplify installing spell files for vim7 |
9 |
|
|
# |
10 |
|
|
|
11 |
|
|
# How to make a vim spell file package using prebuilt spell lists |
12 |
|
|
# from upstream (${CODE} is the language's two letter code): |
13 |
|
|
# |
14 |
ciaranm |
1.5 |
# * Get the ${CODE}.*.spl, ${CODE}.*.sug (if your language has them) and |
15 |
|
|
# README_${CODE}.txt files. Currently they're at |
16 |
|
|
# ftp://ftp.vim.org/pub/vim/unstable/runtime/spell/ (except for English, |
17 |
|
|
# which should be taken from CVS instead). |
18 |
ciaranm |
1.1 |
# |
19 |
|
|
# * Stick them in vim-spell-${CODE}-$(date --iso | tr -d - ).tar.bz2 . Make sure |
20 |
|
|
# that they're in the appropriately named subdirectory to avoid having to mess |
21 |
|
|
# with S=. |
22 |
|
|
# |
23 |
|
|
# * Upload the tarball to the Gentoo mirrors. |
24 |
|
|
# |
25 |
|
|
# * (for now) Add your spell file to package.mask next to the other vim7 |
26 |
|
|
# things. The vim herd will handle unmasking your spell packages when vim7 |
27 |
|
|
# comes out of package.mask. |
28 |
|
|
# |
29 |
ciaranm |
1.2 |
# * Create the app-vim/vim-spell-${CODE} package. You should base your ebuild |
30 |
|
|
# upon app-vim/vim-spell-en. You will need to change VIM_SPELL_LANGUAGE, |
31 |
|
|
# KEYWORDS and LICENSE. Check the license carefully! The README will tell |
32 |
|
|
# you what it is. |
33 |
ciaranm |
1.1 |
# |
34 |
|
|
# * Don't forget metadata.xml. You should list vim as the herd, and yourself |
35 |
|
|
# as the maintainer (there is no need to join the vim herd just for spell |
36 |
|
|
# files): |
37 |
|
|
# |
38 |
|
|
# <?xml version="1.0" encoding="UTF-8"?> |
39 |
|
|
# <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
40 |
|
|
# <pkgmetadata> |
41 |
|
|
# <herd>vim</herd> |
42 |
|
|
# <maintainer> |
43 |
|
|
# <email>your-name@gentoo.org</email> |
44 |
|
|
# </maintainer> |
45 |
|
|
# <longdescription lang="en"> |
46 |
|
|
# Vim spell files for French (fr). Supported character sets are |
47 |
|
|
# UTF-8 and latin1. |
48 |
|
|
# </longdescription> |
49 |
|
|
# </pkgmetadata> |
50 |
|
|
# |
51 |
|
|
# * Send an email to vim@gentoo.org to let us know. |
52 |
|
|
# |
53 |
|
|
# Don't forget to update your package as necessary. |
54 |
|
|
# |
55 |
|
|
# If there isn't an upstream-provided pregenerated spell file for your language |
56 |
|
|
# yet, read :help spell.txt from inside vim7 for instructions on how to create |
57 |
|
|
# spell files. It's best to let upstream know if you've generated spell files |
58 |
|
|
# for another language rather than keeping them Gentoo-specific. |
59 |
|
|
|
60 |
ciaranm |
1.3 |
inherit eutils |
61 |
|
|
|
62 |
|
|
EXPORT_FUNCTIONS src_install pkg_postinst |
63 |
ciaranm |
1.1 |
|
64 |
|
|
IUSE="" |
65 |
|
|
DEPEND="|| ( >=app-editors/vim-7_alpha |
66 |
|
|
>=app-editors/gvim-7_alpha )" |
67 |
|
|
RDEPEND="${DEPEND}" |
68 |
|
|
SRC_URI="mirror://gentoo/${P}.tar.bz2" |
69 |
|
|
SLOT="0" |
70 |
|
|
|
71 |
|
|
if [[ -z "${VIM_SPELL_CODE}" ]] ; then |
72 |
|
|
VIM_SPELL_CODE="${PN/vim-spell-/}" |
73 |
|
|
fi |
74 |
|
|
|
75 |
ciaranm |
1.4 |
DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})" |
76 |
ciaranm |
1.1 |
|
77 |
|
|
if [[ -z "${HOMEPAGE}" ]] ; then |
78 |
|
|
HOMEPAGE="http://www.vim.org/" |
79 |
|
|
fi |
80 |
|
|
|
81 |
|
|
vim-spell_src_install() { |
82 |
|
|
target="/usr/share/vim/vimfiles/spell/" |
83 |
|
|
dodir "${target}" |
84 |
|
|
insinto "${target}" |
85 |
|
|
|
86 |
|
|
had_spell_file= |
87 |
ciaranm |
1.5 |
for f in *.spl *.sug ; do |
88 |
ciaranm |
1.1 |
doins "${f}" |
89 |
|
|
had_spell_file="yes" |
90 |
|
|
done |
91 |
|
|
|
92 |
|
|
for f in README* ; do |
93 |
|
|
dodoc "${f}" |
94 |
|
|
done |
95 |
|
|
|
96 |
|
|
[[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?" |
97 |
|
|
} |
98 |
|
|
|
99 |
ciaranm |
1.3 |
vim-spell_pkg_postinst() { |
100 |
|
|
target="/usr/share/vim/vimfiles/spell/" |
101 |
|
|
echo |
102 |
pioto |
1.6 |
elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" |
103 |
|
|
elog " :setlocal spell spelllang=${VIM_SPELL_CODE}" |
104 |
ciaranm |
1.3 |
echo |
105 |
pioto |
1.6 |
elog "The following (Vim internal, not file) encodings are supported for" |
106 |
|
|
elog "this language:" |
107 |
ciaranm |
1.3 |
for f in "${ROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do |
108 |
|
|
enc="${f##*/${VIM_SPELL_CODE}.}" |
109 |
|
|
enc="${enc%.spl}" |
110 |
|
|
[[ -z "${enc}" ]] && continue |
111 |
pioto |
1.6 |
elog " ${enc}" |
112 |
ciaranm |
1.3 |
done |
113 |
|
|
echo |
114 |
pioto |
1.6 |
elog "For further documentation, use:" |
115 |
|
|
elog " :help spell" |
116 |
ciaranm |
1.3 |
echo |
117 |
|
|
epause |
118 |
|
|
} |
119 |
|
|
|