dev-qt/qttest: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / eclass / aspell-dict-r1.eclass
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 # @ECLASS: aspell-dict-r1.eclass
5 # @MAINTAINER:
6 # maintainer-needed@gentoo.org
7 # @AUTHOR:
8 # Original author: Seemant Kulleen
9 #      -r1 author: David Seifert
10 # @SUPPORTED_EAPIS: 6
11 # @BLURB: An eclass to streamline the construction of ebuilds for new aspell dicts
12 # @DESCRIPTION:
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.
16
17 # @ECLASS-VARIABLE: ASPELL_LANG
18 # @REQUIRED
19 # @DESCRIPTION:
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.
23
24 # @ECLASS-VARIABLE: ASPELL_VERSION
25 # @DESCRIPTION:
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.
31
32 case ${EAPI:-0} in
33         [0-5])
34                 die "aspell-dict-r1.eclass is banned in EAPI ${EAPI:-0}"
35                 ;;
36         6)
37                 ;;
38         *)
39                 die "Unknown EAPI ${EAPI:-0}"
40                 ;;
41 esac
42
43 EXPORT_FUNCTIONS src_configure src_install
44
45 if [[ ! ${_ASPELL_DICT_R1} ]]; then
46
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##*.}
50
51 # @ECLASS-VARIABLE: ASPELL_SPELLANG
52 # @DESCRIPTION:
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}"
57
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"
61 unset _ASPELL_P
62
63 IUSE=""
64 SLOT="0"
65
66 _ASPELL_MAJOR_VERSION=${ASPELL_VERSION:-5}
67 [[ ${_ASPELL_MAJOR_VERSION} != [56] ]] && die "${ASPELL_VERSION} is not a valid version"
68
69 RDEPEND=">=app-text/aspell-0.${_ASPELL_MAJOR_VERSION}0"
70 DEPEND="${RDEPEND}"
71 unset _ASPELL_MAJOR_VERSION
72
73 # @FUNCTION: aspell-dict-r1_src_configure
74 # @DESCRIPTION:
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
78         ./configure || die
79 }
80
81 # @FUNCTION: aspell-dict-r1_src_install
82 # @DESCRIPTION:
83 # The aspell-dict-r1 src_install function which is exported.
84 aspell-dict-r1_src_install() {
85         default
86         [[ -s info ]] && dodoc info
87 }
88
89 _ASPELL_DICT_R1=1
90 fi