| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2011 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/vim-spell.eclass,v 1.1.1.1 2005/11/30 09:59:18 chriswhite Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vim-spell.eclass,v 1.9 2011/12/27 17:55:12 fauli Exp $ |
| 4 | |
4 | |
| 5 | # |
5 | # |
| 6 | # Original Author: Ciaran McCreesh <ciaranm@gentoo.org> |
6 | # Original Author: Ciaran McCreesh <ciaranm@gentoo.org> |
| 7 | # Maintainers: Vim Herd <vim@gentoo.org> |
7 | # Maintainers: Vim Herd <vim@gentoo.org> |
| 8 | # Purpose: Simplify installing spell files for vim7 |
8 | # Purpose: Simplify installing spell files for vim7 |
| 9 | # |
9 | # |
| 10 | |
10 | |
| 11 | # How to make a vim spell file package using prebuilt spell lists |
11 | # How to make a vim spell file package using prebuilt spell lists |
| 12 | # from upstream (${CODE} is the language's two letter code): |
12 | # from upstream (${CODE} is the language's two letter code): |
| 13 | # |
13 | # |
| 14 | # * Get the ${CODE}.*.spl and README_${CODE}.txt files. Currently they're |
14 | # * Get the ${CODE}.*.spl, ${CODE}.*.sug (if your language has them) and |
|
|
15 | # README_${CODE}.txt files. Currently they're at |
| 15 | # at ftp://ftp.vim.org/pub/vim/unstable/runtime/spell/ . |
16 | # ftp://ftp.vim.org/pub/vim/unstable/runtime/spell/ (except for English, |
|
|
17 | # which should be taken from CVS instead). |
| 16 | # |
18 | # |
| 17 | # * Stick them in vim-spell-${CODE}-$(date --iso | tr -d - ).tar.bz2 . Make sure |
19 | # * Stick them in vim-spell-${CODE}-$(date --iso | tr -d - ).tar.bz2 . Make sure |
| 18 | # that they're in the appropriately named subdirectory to avoid having to mess |
20 | # that they're in the appropriately named subdirectory to avoid having to mess |
| 19 | # with S=. |
21 | # with S=. |
| 20 | # |
22 | # |
| … | |
… | |
| 81 | dodir "${target}" |
83 | dodir "${target}" |
| 82 | insinto "${target}" |
84 | insinto "${target}" |
| 83 | |
85 | |
| 84 | had_spell_file= |
86 | had_spell_file= |
| 85 | for f in *.spl ; do |
87 | for f in *.spl ; do |
|
|
88 | if [[ -f "${f}" ]]; then |
| 86 | doins "${f}" |
89 | doins "${f}" |
| 87 | had_spell_file="yes" |
90 | had_spell_file="yes" |
|
|
91 | fi |
|
|
92 | done |
|
|
93 | |
|
|
94 | for f in *.sug ; do |
|
|
95 | if [[ -f "${f}" ]]; then |
|
|
96 | doins "${f}" |
|
|
97 | fi |
| 88 | done |
98 | done |
| 89 | |
99 | |
| 90 | for f in README* ; do |
100 | for f in README* ; do |
| 91 | dodoc "${f}" |
101 | dodoc "${f}" |
| 92 | done |
102 | done |
| 93 | |
103 | |
| 94 | [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?" |
104 | [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?" |
| 95 | } |
105 | } |
| 96 | |
106 | |
| 97 | vim-spell_pkg_postinst() { |
107 | vim-spell_pkg_postinst() { |
|
|
108 | has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}" |
| 98 | target="/usr/share/vim/vimfiles/spell/" |
109 | target="/usr/share/vim/vimfiles/spell/" |
| 99 | echo |
110 | echo |
| 100 | einfo "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" |
111 | elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" |
| 101 | einfo " :setlocal spell spelllang=${VIM_SPELL_CODE}" |
112 | elog " :setlocal spell spelllang=${VIM_SPELL_CODE}" |
| 102 | echo |
113 | echo |
| 103 | einfo "The following (Vim internal, not file) encodings are supported for" |
114 | elog "The following (Vim internal, not file) encodings are supported for" |
| 104 | einfo "this language:" |
115 | elog "this language:" |
| 105 | for f in "${ROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do |
116 | for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do |
| 106 | enc="${f##*/${VIM_SPELL_CODE}.}" |
117 | enc="${f##*/${VIM_SPELL_CODE}.}" |
| 107 | enc="${enc%.spl}" |
118 | enc="${enc%.spl}" |
| 108 | [[ -z "${enc}" ]] && continue |
119 | [[ -z "${enc}" ]] && continue |
| 109 | einfo " ${enc}" |
120 | elog " ${enc}" |
| 110 | done |
121 | done |
| 111 | echo |
122 | echo |
| 112 | einfo "For further documentation, use:" |
123 | elog "For further documentation, use:" |
| 113 | einfo " :help spell" |
124 | elog " :help spell" |
| 114 | echo |
125 | echo |
| 115 | epause |
126 | epause |
| 116 | } |
127 | } |
| 117 | |
|
|