From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4B91D139694 for ; Sun, 19 Mar 2017 21:22:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DFD4E21C0C6; Sun, 19 Mar 2017 21:22:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8599321C07C for ; Sun, 19 Mar 2017 21:22:49 +0000 (UTC) Received: from thinkpad.fritz.box (cable-static-236-115.teleport.ch [213.188.236.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: soap) by smtp.gentoo.org (Postfix) with ESMTPSA id C10D233E142 for ; Sun, 19 Mar 2017 21:22:47 +0000 (UTC) Message-ID: <1489958564.1346.2.camel@gentoo.org> Subject: [gentoo-dev] Review: aspell-dict-r1.eclass From: David Seifert To: gentoo-dev@lists.gentoo.org Date: Sun, 19 Mar 2017 22:22:44 +0100 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 1af2d73d-8ca0-473d-a30f-a062303b93e1 X-Archives-Hash: 07308e37e1e24485ffc9daeedc5050ea This is a revbump of aspell-dict.eclass, in order to bring it up to EAPI 6 standards. Comment here or on https://github.com/gentoo/gentoo/pull/4237 --- eclass/aspell-dict.eclass +++ eclass/aspell-dict-r1.eclass @@ -1,77 +1,89 @@ -# Copyright 1999-2014 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation  # Distributed under the terms of the GNU General Public License v2   -# @ECLASS: aspell-dict.eclass +# @ECLASS: aspell-dict-r1.eclass  # @MAINTAINER:  # maintainer-needed@gentoo.org  # @AUTHOR:  # Original author: Seemant Kulleen +#      -r1 author: David Seifert  # @BLURB: An eclass to streamline the construction of ebuilds for new aspell dicts  # @DESCRIPTION: -# The aspell-dict eclass is designed to streamline the construction of +# The aspell-dict-r1 eclass is designed to streamline the construction of  # ebuilds for the new aspell dictionaries (from gnu.org) which support  # aspell-0.50. Support for aspell-0.60 has been added by Sergey Ulanov.    # @ECLASS-VARIABLE: ASPELL_LANG  # @REQUIRED  # @DESCRIPTION: -# Which language is the dictionary for? It's used for the DESCRIPTION of the -# package. +# Pure cleartext string that is included into DESCRIPTION. This is the name +# of the language, for instance "Hungarian". Needs to be defined before +# inheriting the eclass. + +# @ECLASS-VARIABLE: ASPELL_VERSION +# @DESCRIPTION: +# What major version of aspell is this dictionary for? Valid values are 5, 6 or undefined. +# This value is used to construct SRC_URI and *DEPEND strings. If defined to 6, +# >=app-text/aspell-0.60 will be added to DEPEND and RDEPEND, otherwise, +# >=app-text/aspell-0.50 is added to DEPEND and RDEPEND. If the value is to be overridden, +# it needs to be overridden before inheriting the eclass. + +case ${EAPI:-0} in + [0-5]) + die "aspell-dict-r1.eclass is banned in EAPI ${EAPI:-0}" + ;; + 6) + ;; + *) + die "Unknown EAPI ${EAPI:-0}" + ;; +esac   -# @ECLASS-VARIABLE: ASPOSTFIX -# @REQUIRED -# @DESCRIPTION: -# What major version of aspell is this dictionary for? +EXPORT_FUNCTIONS src_configure src_install   -case ${EAPI} in - 0|1) EXPORT_FUNCTIONS src_compile src_install ;; - *) EXPORT_FUNCTIONS src_configure src_compile src_install ;; -esac +if [[ ! ${_ASPELL_DICT_R1} ]]; then + +# aspell packages have an idiosyncratic versioning scheme, that is +# the last separating version separator is replaced by a '-'. +_ASPELL_P=aspell${ASPELL_VERSION}-${PN/aspell-/}-${PV%.*}-${PV##*.} + +# @ECLASS-VARIABLE: ASPELL_SPELLANG +# @DESCRIPTION: +# Short (readonly) form of the language code, generated from ${PN} +# For instance, 'aspell-hu' yields the value 'hu'. +readonly ASPELL_SPELLANG=${PN/aspell-/} +S="${WORKDIR}/${_ASPELL_P}"   -#MY_P=${PN}-${PV%.*}-${PV#*.*.} -MY_P=${P%.*}-${PV##*.} -MY_P=aspell${ASPOSTFIX}-${MY_P/aspell-/} -SPELLANG=${PN/aspell-/} -S="${WORKDIR}/${MY_P}"  DESCRIPTION="${ASPELL_LANG} language dictionary for aspell"  HOMEPAGE="http://aspell.net" -SRC_URI="mirror://gnu/aspell/dict/${SPELLANG}/${MY_P}.tar.bz2" +SRC_URI="mirror://gnu/aspell/dict/${ASPELL_SPELLANG}/${_ASPELL_P}.tar.bz2" +unset _ASPELL_P    IUSE=""  SLOT="0"   -if [ x${ASPOSTFIX} = x6 ] ; then - RDEPEND=">=app-text/aspell-0.60" - DEPEND="${RDEPEND}" -else - RDEPEND=">=app-text/aspell-0.50" - DEPEND="${RDEPEND}" -fi +_ASPELL_MAJOR_VERSION=${ASPELL_VERSION:-5} +[[ ${_ASPELL_MAJOR_VERSION} != [56] ]] && die "{ASPELL_VERSION} is not a valid version"   -# @FUNCTION: aspell-dict_src_configure -# @DESCRIPTION: -# The aspell-dict src_configure function which is exported. -aspell-dict_src_configure() { +RDEPEND=">=app-text/aspell-0.${_ASPELL_MAJOR_VERSION}0" +DEPEND="${RDEPEND}" +unset _ASPELL_MAJOR_VERSION + +# @FUNCTION: aspell-dict-r1_src_configure +# @DESCRIPTION: +# The aspell-dict-r1 src_configure function which is exported. +aspell-dict-r1_src_configure() { + # non-autoconf based script, cannot be used with econf   ./configure || die  }   -# @FUNCTION: aspell-dict_src_compile +# @FUNCTION: aspell-dict-r1_src_install  # @DESCRIPTION: -# The aspell-dict src_compile function which is exported. -aspell-dict_src_compile() { - case ${EAPI} in - 0|1) aspell-dict_src_configure ;; - esac - emake || die +# The aspell-dict-r1 src_install function which is exported. +aspell-dict-r1_src_install() { + default + [[ -s info ]] && dodoc info  }   -# @FUNCTION: aspell-dict_src_install -# @DESCRIPTION: -# The aspell-dict src_install function which is exported. -aspell-dict_src_install() { - make DESTDIR="${D}" install || die - - for doc in README info ; do - [ -s "$doc" ] && dodoc $doc - done -} +_ASPELL_DICT_R1=1 +fi