/[gentoo-x86]/eclass/vim-spell.eclass
Gentoo

Diff of /eclass/vim-spell.eclass

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

Revision 1.3 Revision 1.8
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.8 2010/04/23 19:01:37 darkside 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
69if [[ -z "${VIM_SPELL_CODE}" ]] ; then 71if [[ -z "${VIM_SPELL_CODE}" ]] ; then
70 VIM_SPELL_CODE="${PN/vim-spell-/}" 72 VIM_SPELL_CODE="${PN/vim-spell-/}"
71fi 73fi
72 74
73if [[ -z "${DESCRIPTION}" ]] ; then
74 DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})" 75DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})"
75fi
76 76
77if [[ -z "${HOMEPAGE}" ]] ; then 77if [[ -z "${HOMEPAGE}" ]] ; then
78 HOMEPAGE="http://www.vim.org/" 78 HOMEPAGE="http://www.vim.org/"
79fi 79fi
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
95 103
96 [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?" 104 [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?"
97} 105}
98 106
99vim-spell_pkg_postinst() { 107vim-spell_pkg_postinst() {
108 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
100 target="/usr/share/vim/vimfiles/spell/" 109 target="/usr/share/vim/vimfiles/spell/"
101 echo 110 echo
102 einfo "To enable ${VIM_SPELL_LANGUAGE} spell checking, use" 111 elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
103 einfo " :setlocal spell spelllang=${VIM_SPELL_CODE}" 112 elog " :setlocal spell spelllang=${VIM_SPELL_CODE}"
104 echo 113 echo
105 einfo "The following (Vim internal, not file) encodings are supported for" 114 elog "The following (Vim internal, not file) encodings are supported for"
106 einfo "this language:" 115 elog "this language:"
107 for f in "${ROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do 116 for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do
108 enc="${f##*/${VIM_SPELL_CODE}.}" 117 enc="${f##*/${VIM_SPELL_CODE}.}"
109 enc="${enc%.spl}" 118 enc="${enc%.spl}"
110 [[ -z "${enc}" ]] && continue 119 [[ -z "${enc}" ]] && continue
111 einfo " ${enc}" 120 elog " ${enc}"
112 done 121 done
113 echo 122 echo
114 einfo "For further documentation, use:" 123 elog "For further documentation, use:"
115 einfo " :help spell" 124 elog " :help spell"
116 echo 125 echo
117 epause 126 epause
118} 127}
119 128

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

  ViewVC Help
Powered by ViewVC 1.1.20