Gentoo Archives: gentoo-dev

From: Patrice Clement <monsieurp@g.o>
To: gentoo-dev@l.g.o
Cc: vim@g.o
Subject: [gentoo-dev] [PATCH 2/2] vim-spell.eclass: document variables using Gentoo documentation tags.
Date: Sat, 19 Aug 2017 12:55:03
Message-Id: 20170819125350.10651-3-monsieurp@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/2] vim-spell.eclass: improvements. by Patrice Clement
1 ---
2 eclass/vim-spell.eclass | 37 +++++++++++++++++++++++--------------
3 1 file changed, 23 insertions(+), 14 deletions(-)
4
5 diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
6 index 1b0f93c264d..8c1b6314ed8 100644
7 --- a/eclass/vim-spell.eclass
8 +++ b/eclass/vim-spell.eclass
9 @@ -68,23 +68,34 @@ RDEPEND="${DEPEND}"
10 SRC_URI="mirror://gentoo/${P}.tar.bz2"
11 SLOT="0"
12
13 -if [[ -z "${VIM_SPELL_CODE}" ]] ; then
14 - VIM_SPELL_CODE="${PN/vim-spell-/}"
15 -fi
16 +# @ECLASS-VARIABLE: DESCRIPTION
17 +# @DESCRIPTION:
18 +# Default DESCRIPTION for Vim spell ebuilds.
19 +: ${DESCRIPTION:="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_LOCALE})"}
20
21 -DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})"
22 +# @ECLASS-VARIABLE: HOMEPAGE
23 +# @DESCRIPTION:
24 +# Default HOMEPAGE for Vim spell ebuilds.
25 +: ${HOMEPAGE:="https://www.vim.org"}
26
27 -if [[ -z "${HOMEPAGE}" ]] ; then
28 - HOMEPAGE="http://www.vim.org/"
29 -fi
30 +# @ECLASS-VARIABLE: VIM_SPELL_LOCALE
31 +# @INTERNAL
32 +# @DESCRIPTION:
33 +# Locale for the current ebuild.
34 +: ${VIM_SPELL_LOCALE:="${PN/vim-spell-/}"}
35 +
36 +# @ECLASS-VARIABLE: VIM_SPELL_DIRECTORY
37 +# @INTERNAL
38 +# @DESCRIPTION:
39 +# Path to Vim spell directory files.
40 +: ${VIM_SPELL_DIRECTORY:="/usr/share/vim/vimfiles/spell/"}
41
42 # @FUNCTION: vim-spell_src_install
43 # @DESCRIPTION:
44 # Install Vim spell files.
45 vim-spell_src_install() {
46 - target="/usr/share/vim/vimfiles/spell/"
47 - dodir "${target}"
48 - insinto "${target}"
49 + dodir "${VIM_SPELL_DIRECTORY}"
50 + insinto "${VIM_SPELL_DIRECTORY}"
51
52 had_spell_file=
53 for f in *.spl ; do
54 @@ -112,15 +123,13 @@ vim-spell_src_install() {
55 # Display installed Vim spell files.
56 vim-spell_pkg_postinst() {
57 has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
58 - target="/usr/share/vim/vimfiles/spell/"
59 echo
60 elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
61 - elog " :setlocal spell spelllang=${VIM_SPELL_CODE}"
62 + elog " :setlocal spell spelllang=${VIM_SPELL_LOCALE}"
63 echo
64 elog "The following (Vim internal, not file) encodings are supported for"
65 elog "this language:"
66 - for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do
67 - enc="${f##*/${VIM_SPELL_CODE}.}"
68 + for f in "${EROOT}/${VIM_SPELL_DIRECTORY}/${VIM_SPELL_LOCALE}".*.spl ; do enc="${f##*/${VIM_SPELL_LOCALE}.}"
69 enc="${enc%.spl}"
70 [[ -z "${enc}" ]] && continue
71 elog " ${enc}"
72 --
73 2.13.0

Replies