| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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.3 2005/09/28 19:59:46 ciaranm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/vim-spell.eclass,v 1.7 2009/07/07 18:54:05 arfrever 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 | # |
| … | |
… | |
| 68 | |
70 | |
| 69 | if [[ -z "${VIM_SPELL_CODE}" ]] ; then |
71 | if [[ -z "${VIM_SPELL_CODE}" ]] ; then |
| 70 | VIM_SPELL_CODE="${PN/vim-spell-/}" |
72 | VIM_SPELL_CODE="${PN/vim-spell-/}" |
| 71 | fi |
73 | fi |
| 72 | |
74 | |
| 73 | if [[ -z "${DESCRIPTION}" ]] ; then |
|
|
| 74 | DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})" |
75 | DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})" |
| 75 | fi |
|
|
| 76 | |
76 | |
| 77 | if [[ -z "${HOMEPAGE}" ]] ; then |
77 | if [[ -z "${HOMEPAGE}" ]] ; then |
| 78 | HOMEPAGE="http://www.vim.org/" |
78 | HOMEPAGE="http://www.vim.org/" |
| 79 | fi |
79 | fi |
| 80 | |
80 | |
| … | |
… | |
| 83 | dodir "${target}" |
83 | dodir "${target}" |
| 84 | insinto "${target}" |
84 | insinto "${target}" |
| 85 | |
85 | |
| 86 | had_spell_file= |
86 | had_spell_file= |
| 87 | for f in *.spl ; do |
87 | for f in *.spl ; do |
|
|
88 | if [[ -f "${f}" ]]; then |
| 88 | doins "${f}" |
89 | doins "${f}" |
| 89 | 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 |
| 90 | done |
98 | done |
| 91 | |
99 | |
| 92 | for f in README* ; do |
100 | for f in README* ; do |
| 93 | dodoc "${f}" |
101 | dodoc "${f}" |
| 94 | done |
102 | done |
| … | |
… | |
| 97 | } |
105 | } |
| 98 | |
106 | |
| 99 | vim-spell_pkg_postinst() { |
107 | vim-spell_pkg_postinst() { |
| 100 | target="/usr/share/vim/vimfiles/spell/" |
108 | target="/usr/share/vim/vimfiles/spell/" |
| 101 | echo |
109 | echo |
| 102 | einfo "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" |
110 | elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" |
| 103 | einfo " :setlocal spell spelllang=${VIM_SPELL_CODE}" |
111 | elog " :setlocal spell spelllang=${VIM_SPELL_CODE}" |
| 104 | echo |
112 | echo |
| 105 | einfo "The following (Vim internal, not file) encodings are supported for" |
113 | elog "The following (Vim internal, not file) encodings are supported for" |
| 106 | einfo "this language:" |
114 | elog "this language:" |
| 107 | for f in "${ROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do |
115 | for f in "${ROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do |
| 108 | enc="${f##*/${VIM_SPELL_CODE}.}" |
116 | enc="${f##*/${VIM_SPELL_CODE}.}" |
| 109 | enc="${enc%.spl}" |
117 | enc="${enc%.spl}" |
| 110 | [[ -z "${enc}" ]] && continue |
118 | [[ -z "${enc}" ]] && continue |
| 111 | einfo " ${enc}" |
119 | elog " ${enc}" |
| 112 | done |
120 | done |
| 113 | echo |
121 | echo |
| 114 | einfo "For further documentation, use:" |
122 | elog "For further documentation, use:" |
| 115 | einfo " :help spell" |
123 | elog " :help spell" |
| 116 | echo |
124 | echo |
| 117 | epause |
125 | epause |
| 118 | } |
126 | } |
| 119 | |
127 | |