1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # Original Author: Ciaran McCreesh <ciaranm@gentoo.org>
6 # Maintainers: Vim Herd <vim@gentoo.org>
7 # Purpose: Simplify installing spell files for vim7
10 # How to make a vim spell file package using prebuilt spell lists
11 # from upstream (${CODE} is the language's two letter code):
13 # * Get the ${CODE}.*.spl, ${CODE}.*.sug (if your language has them) and
14 # README_${CODE}.txt files. Currently they're at
15 # ftp://ftp.vim.org/pub/vim/unstable/runtime/spell/ (except for English,
16 # which should be taken from CVS instead).
18 # * Stick them in vim-spell-${CODE}-$(date --iso | tr -d - ).tar.bz2 . Make sure
19 # that they're in the appropriately named subdirectory to avoid having to mess
22 # * Upload the tarball to the Gentoo mirrors.
24 # * (for now) Add your spell file to package.mask next to the other vim7
25 # things. The vim herd will handle unmasking your spell packages when vim7
26 # comes out of package.mask.
28 # * Create the app-vim/vim-spell-${CODE} package. You should base your ebuild
29 # upon app-vim/vim-spell-en. You will need to change VIM_SPELL_LANGUAGE,
30 # KEYWORDS and LICENSE. Check the license carefully! The README will tell
33 # * Don't forget metadata.xml. You should list vim as the herd, and yourself
34 # as the maintainer (there is no need to join the vim herd just for spell
37 # <?xml version="1.0" encoding="UTF-8"?>
38 # <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
42 # <email>your-name@gentoo.org</email>
44 # <longdescription lang="en">
45 # Vim spell files for French (fr). Supported character sets are
50 # * Send an email to vim@gentoo.org to let us know.
52 # Don't forget to update your package as necessary.
54 # If there isn't an upstream-provided pregenerated spell file for your language
55 # yet, read :help spell.txt from inside vim7 for instructions on how to create
56 # spell files. It's best to let upstream know if you've generated spell files
57 # for another language rather than keeping them Gentoo-specific.
61 EXPORT_FUNCTIONS src_install pkg_postinst
64 DEPEND="|| ( >=app-editors/vim-7_alpha
65 >=app-editors/gvim-7_alpha )"
67 SRC_URI="mirror://gentoo/${P}.tar.bz2"
70 if [[ -z "${VIM_SPELL_CODE}" ]] ; then
71 VIM_SPELL_CODE="${PN/vim-spell-/}"
74 DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})"
76 if [[ -z "${HOMEPAGE}" ]] ; then
77 HOMEPAGE="http://www.vim.org/"
80 vim-spell_src_install() {
81 target="/usr/share/vim/vimfiles/spell/"
87 if [[ -f "${f}" ]]; then
94 if [[ -f "${f}" ]]; then
103 [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?"
106 vim-spell_pkg_postinst() {
107 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
108 target="/usr/share/vim/vimfiles/spell/"
110 elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
111 elog " :setlocal spell spelllang=${VIM_SPELL_CODE}"
113 elog "The following (Vim internal, not file) encodings are supported for"
114 elog "this language:"
115 for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do
116 enc="${f##*/${VIM_SPELL_CODE}.}"
118 [[ -z "${enc}" ]] && continue
122 elog "For further documentation, use:"