summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-04-01 12:41:23 +0200
committerDavid Seifert <soap@gentoo.org>2017-04-01 12:42:08 +0200
commit084c330739a449c3356120a2fd6dc7c8d200abc8 (patch)
tree08e8fe5997387d911100a9c19e05b0eec7163cf4 /eclass
parentmail-client/roundcube: add ~ppc keyword (bug 594824). (diff)
downloadgentoo-084c330739a449c3356120a2fd6dc7c8d200abc8.tar.gz
gentoo-084c330739a449c3356120a2fd6dc7c8d200abc8.tar.bz2
gentoo-084c330739a449c3356120a2fd6dc7c8d200abc8.zip
aspell-dict-r1.eclass: Port aspell-dict.eclass to EAPI 6, ban older EAPIs
Closes: https://github.com/gentoo/gentoo/pull/4237
Diffstat (limited to 'eclass')
-rw-r--r--eclass/aspell-dict-r1.eclass89
1 files changed, 89 insertions, 0 deletions
diff --git a/eclass/aspell-dict-r1.eclass b/eclass/aspell-dict-r1.eclass
new file mode 100644
index 000000000000..aed65d6c9ad3
--- /dev/null
+++ b/eclass/aspell-dict-r1.eclass
@@ -0,0 +1,89 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# @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-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:
+# 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
+
+EXPORT_FUNCTIONS src_configure src_install
+
+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}"
+
+DESCRIPTION="${ASPELL_LANG} language dictionary for aspell"
+HOMEPAGE="http://aspell.net"
+SRC_URI="mirror://gnu/aspell/dict/${ASPELL_SPELLANG}/${_ASPELL_P}.tar.bz2"
+unset _ASPELL_P
+
+IUSE=""
+SLOT="0"
+
+_ASPELL_MAJOR_VERSION=${ASPELL_VERSION:-5}
+[[ ${_ASPELL_MAJOR_VERSION} != [56] ]] && die "${ASPELL_VERSION} is not a valid version"
+
+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-r1_src_install
+# @DESCRIPTION:
+# The aspell-dict-r1 src_install function which is exported.
+aspell-dict-r1_src_install() {
+ default
+ [[ -s info ]] && dodoc info
+}
+
+_ASPELL_DICT_R1=1
+fi