commit:     53ea3a0737f19712c8b818d9e189652557f7b573
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 12 10:41:11 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Mar 12 15:12:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53ea3a07

freedict.eclass: Support EAPI-7, fix HOMEPAGE, drop DESCRIPTION

Deprecate FORLANG and TOLANG in EAPI-7 in favor of setting DESCRIPTION directly.
Avoid HOMEPAGE redirect
Improve description, fix eclassdoc problems

Closes: https://bugs.gentoo.org/637738
Closes: https://bugs.gentoo.org/770265
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 eclass/freedict.eclass | 36 +++++++++++++++++++++++-------------
 1 file changed, 23 insertions(+), 13 deletions(-)

diff --git a/eclass/freedict.eclass b/eclass/freedict.eclass
index c1b32d1b6bf..cded485b5a4 100644
--- a/eclass/freedict.eclass
+++ b/eclass/freedict.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: freedict.eclass
@@ -6,7 +6,7 @@
 # [email protected]
 # @AUTHOR:
 # Original author: Seemant Kulleen
-# @SUPPORTED_EAPIS: 6
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: Ease the installation of freedict translation dictionaries
 # @DESCRIPTION:
 # This eclass exists to ease the installation of freedict translation
@@ -14,24 +14,34 @@
 # ebuilds are FORLANG and TOLANG for the source and target languages,
 # respectively.
 
+# @ECLASS-VARIABLE: FREEDICT_P
+# @DESCRIPTION:
+# Strips PN of 'freedict' prefix, to be used in SRC_URI and doins
+FREEDICT_P=${PN/freedict-/}
+
 # @ECLASS-VARIABLE: FORLANG
+# @DEFAULT_UNSET
 # @DESCRIPTION:
-# Please see above for a description.
+# DEPRECATED: Cleanup after EAPI-7 removal.
 
 # @ECLASS-VARIABLE: TOLANG
+# @DEFAULT_UNSET
 # @DESCRIPTION:
-# Please see above for a description.
+# DEPRECATED: Cleanup after EAPI-7 removal.
 
 case ${EAPI:-0} in
-       6) ;;
+       6)
+               DESCRIPTION="Freedict for language translation from ${FORLANG} 
to ${TOLANG}"
+               ;;
+       7)
+               [[ ${FORLANG} ]] && die "FORLANG is banned, set DESCRIPTION 
instead"
+               [[ ${TOLANG} ]] && die "TOLANG is banned, set DESCRIPTION 
instead"
+               ;;
        *) die "${ECLASS}.eclass is banned in EAPI=${EAPI}" ;;
 esac
 
-MY_P=${PN/freedict-/}
-
-DESCRIPTION="Freedict for language translation from ${FORLANG} to ${TOLANG}"
-HOMEPAGE="http://freedict.sourceforge.net/";
-SRC_URI="http://freedict.sourceforge.net/download/linux/${MY_P}.tar.gz";
+HOMEPAGE="http://freedict.sourceforge.net/en/";
+SRC_URI="http://freedict.sourceforge.net/download/linux/${FREEDICT_P}.tar.gz";
 
 LICENSE="GPL-2+"
 SLOT="0"
@@ -42,11 +52,11 @@ S="${WORKDIR}"
 
 # @FUNCTION: freedict_src_install
 # @DESCRIPTION:
-# The freedict src_install function, which is exported
+# Installs translation specific dict.dz and index files.
 freedict_src_install() {
        insinto /usr/$(get_libdir)/dict
-       doins ${MY_P}.dict.dz
-       doins ${MY_P}.index
+       doins ${FREEDICT_P}.dict.dz
+       doins ${FREEDICT_P}.index
 }
 
 EXPORT_FUNCTIONS src_install

Reply via email to