public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Patrice Clement <monsieurp@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: vim@gentoo.org
Subject: [gentoo-dev] [PATCH 2/2] vim-spell.eclass: document variables using Gentoo documentation tags.
Date: Sat, 19 Aug 2017 14:53:50 +0200	[thread overview]
Message-ID: <20170819125350.10651-3-monsieurp@gentoo.org> (raw)
In-Reply-To: <20170819125350.10651-1-monsieurp@gentoo.org>

---
 eclass/vim-spell.eclass | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
index 1b0f93c264d..8c1b6314ed8 100644
--- a/eclass/vim-spell.eclass
+++ b/eclass/vim-spell.eclass
@@ -68,23 +68,34 @@ RDEPEND="${DEPEND}"
 SRC_URI="mirror://gentoo/${P}.tar.bz2"
 SLOT="0"
 
-if [[ -z "${VIM_SPELL_CODE}" ]] ; then
-	VIM_SPELL_CODE="${PN/vim-spell-/}"
-fi
+# @ECLASS-VARIABLE: DESCRIPTION
+# @DESCRIPTION:
+# Default DESCRIPTION for Vim spell ebuilds.
+: ${DESCRIPTION:="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_LOCALE})"}
 
-DESCRIPTION="vim spell files: ${VIM_SPELL_LANGUAGE} (${VIM_SPELL_CODE})"
+# @ECLASS-VARIABLE: HOMEPAGE
+# @DESCRIPTION:
+# Default HOMEPAGE for Vim spell ebuilds.
+: ${HOMEPAGE:="https://www.vim.org"}
 
-if [[ -z "${HOMEPAGE}" ]] ; then
-	HOMEPAGE="http://www.vim.org/"
-fi
+# @ECLASS-VARIABLE: VIM_SPELL_LOCALE
+# @INTERNAL
+# @DESCRIPTION:
+# Locale for the current ebuild.
+: ${VIM_SPELL_LOCALE:="${PN/vim-spell-/}"}
+
+# @ECLASS-VARIABLE: VIM_SPELL_DIRECTORY
+# @INTERNAL
+# @DESCRIPTION:
+# Path to Vim spell directory files.
+: ${VIM_SPELL_DIRECTORY:="/usr/share/vim/vimfiles/spell/"}
 
 # @FUNCTION: vim-spell_src_install
 # @DESCRIPTION:
 # Install Vim spell files.
 vim-spell_src_install() {
-	target="/usr/share/vim/vimfiles/spell/"
-	dodir "${target}"
-	insinto "${target}"
+	dodir "${VIM_SPELL_DIRECTORY}"
+	insinto "${VIM_SPELL_DIRECTORY}"
 
 	had_spell_file=
 	for f in *.spl ; do
@@ -112,15 +123,13 @@ vim-spell_src_install() {
 # Display installed Vim spell files.
 vim-spell_pkg_postinst() {
 	has "${EAPI:-0}" 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	target="/usr/share/vim/vimfiles/spell/"
 	echo
 	elog "To enable ${VIM_SPELL_LANGUAGE} spell checking, use"
-	elog "    :setlocal spell spelllang=${VIM_SPELL_CODE}"
+	elog "    :setlocal spell spelllang=${VIM_SPELL_LOCALE}"
 	echo
 	elog "The following (Vim internal, not file) encodings are supported for"
 	elog "this language:"
-	for f in "${EROOT}/${target}/${VIM_SPELL_CODE}".*.spl ; do
-		enc="${f##*/${VIM_SPELL_CODE}.}"
+	for f in "${EROOT}/${VIM_SPELL_DIRECTORY}/${VIM_SPELL_LOCALE}".*.spl ; do enc="${f##*/${VIM_SPELL_LOCALE}.}"
 		enc="${enc%.spl}"
 		[[ -z "${enc}" ]] && continue
 		elog "    ${enc}"
-- 
2.13.0



  parent reply	other threads:[~2017-08-19 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-19 12:53 [gentoo-dev] [PATCH 0/2] vim-spell.eclass: improvements Patrice Clement
2017-08-19 12:53 ` [gentoo-dev] [PATCH 1/2] vim-spell.eclass: document functions using Gentoo documentation tags Patrice Clement
2017-08-19 12:53 ` Patrice Clement [this message]
2017-08-19 18:14   ` [gentoo-dev] [PATCH 2/2] vim-spell.eclass: document variables " Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170819125350.10651-3-monsieurp@gentoo.org \
    --to=monsieurp@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=vim@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox