1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: aspell-dict-r1.eclass
6 # maintainer-needed@gentoo.org
8 # Original author: Seemant Kulleen
9 # -r1 author: David Seifert
11 # @BLURB: An eclass to streamline the construction of ebuilds for new aspell dicts
13 # The aspell-dict-r1 eclass is designed to streamline the construction of
14 # ebuilds for the new aspell dictionaries (from gnu.org) which support
15 # aspell-0.50. Support for aspell-0.60 has been added by Sergey Ulanov.
17 # @ECLASS-VARIABLE: ASPELL_LANG
20 # Pure cleartext string that is included into DESCRIPTION. This is the name
21 # of the language, for instance "Hungarian". Needs to be defined before
22 # inheriting the eclass.
24 # @ECLASS-VARIABLE: ASPELL_VERSION
26 # What major version of aspell is this dictionary for? Valid values are 5, 6 or undefined.
27 # This value is used to construct SRC_URI and *DEPEND strings. If defined to 6,
28 # >=app-text/aspell-0.60 will be added to DEPEND and RDEPEND, otherwise,
29 # >=app-text/aspell-0.50 is added to DEPEND and RDEPEND. If the value is to be overridden,
30 # it needs to be overridden before inheriting the eclass.
34 die "aspell-dict-r1.eclass is banned in EAPI ${EAPI:-0}"
39 die "Unknown EAPI ${EAPI:-0}"
43 EXPORT_FUNCTIONS src_configure src_install
45 if [[ ! ${_ASPELL_DICT_R1} ]]; then
47 # aspell packages have an idiosyncratic versioning scheme, that is
48 # the last separating version separator is replaced by a '-'.
49 _ASPELL_P=aspell${ASPELL_VERSION}-${PN/aspell-/}-${PV%.*}-${PV##*.}
51 # @ECLASS-VARIABLE: ASPELL_SPELLANG
53 # Short (readonly) form of the language code, generated from ${PN}
54 # For instance, 'aspell-hu' yields the value 'hu'.
55 readonly ASPELL_SPELLANG=${PN/aspell-/}
56 S="${WORKDIR}/${_ASPELL_P}"
58 DESCRIPTION="${ASPELL_LANG} language dictionary for aspell"
59 HOMEPAGE="http://aspell.net"
60 SRC_URI="mirror://gnu/aspell/dict/${ASPELL_SPELLANG}/${_ASPELL_P}.tar.bz2"
66 _ASPELL_MAJOR_VERSION=${ASPELL_VERSION:-5}
67 [[ ${_ASPELL_MAJOR_VERSION} != [56] ]] && die "${ASPELL_VERSION} is not a valid version"
69 RDEPEND=">=app-text/aspell-0.${_ASPELL_MAJOR_VERSION}0"
71 unset _ASPELL_MAJOR_VERSION
73 # @FUNCTION: aspell-dict-r1_src_configure
75 # The aspell-dict-r1 src_configure function which is exported.
76 aspell-dict-r1_src_configure() {
77 # non-autoconf based script, cannot be used with econf
81 # @FUNCTION: aspell-dict-r1_src_install
83 # The aspell-dict-r1 src_install function which is exported.
84 aspell-dict-r1_src_install() {
86 [[ -s info ]] && dodoc info