1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 # Original Author: Ciaran McCreesh <ciaranm@gentoo.org>
7 # Maintainers: Vim Herd <vim@gentoo.org>
8 # Purpose: Simplify installing spell files for vim7
11 # How to make a vim spell file package using prebuilt spell lists
12 # from upstream (${CODE} is the language's two letter code):
14 # * 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).
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
23 # * Upload the tarball to the Gentoo mirrors.
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.
29 # * 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
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
38 # <?xml version="1.0" encoding="UTF-8"?>
39 # <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
43 # <email>your-name@gentoo.org</email>
45 # <longdescription lang="en">
46 # Vim spell files for French (fr). Supported character sets are
51 # * Send an email to vim@gentoo.org to let us know.
53 # Don't forget to update your package as necessary.
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.
62 EXPORT_FUNCTIONS src_install pkg_postinst
65 DEPEND="|| ( >=app-editors/vim-7_alpha
66 >=app-editors/gvim-7_alpha )"
68 SRC_URI="mirror://gentoo/${P}.tar.bz2"
71 if [[ -z "${VIM_SPELL_CODE}" ]] ; then
72 VIM_SPELL_CODE="${PN/vim-spell-/}"
75 DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})"
77 if [[ -z "${HOMEPAGE}" ]] ; then
78 HOMEPAGE="http://www.vim.org/"
81 vim-spell_src_install() {
82 target="/usr/share/vim/vimfiles/spell/"
88 if [[ -f "${f}" ]]; then
95 if [[ -f "${f}" ]]; then
100 for f in README* ; do
104 [[ -z "${had_spell_file}" ]] && die "Didn't install any spell files?"
107 vim-spell_pkg_postinst() {
108 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
109 target="/usr/share/vim/vimfiles/spell/"
111 elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
112 elog " :setlocal spell spelllang=${VIM_SPELL_CODE}"
114 elog "The following (Vim internal, not file) encodings are supported for"
115 elog "this language:"
116 for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do
117 enc="${f##*/${VIM_SPELL_CODE}.}"
119 [[ -z "${enc}" ]] && continue
123 elog "For further documentation, use:"