From 53ea3a0737f19712c8b818d9e189652557f7b573 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Fri, 12 Mar 2021 11:41:11 +0100 Subject: 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 --- eclass/freedict.eclass | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'eclass/freedict.eclass') diff --git a/eclass/freedict.eclass b/eclass/freedict.eclass index c1b32d1b6bfb..cded485b5a47 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 @@ # maintainer-needed@gentoo.org # @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 -- cgit v1.2.3-65-gdbad