1 |
commit: 2541f261a8f6e95f0769badba4cd2ba518af790b |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jun 20 21:15:25 2021 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 20 21:15:25 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2541f261 |
7 |
|
8 |
stardict.eclass: [QA] add EAPI guard, add basic eclassdoc |
9 |
|
10 |
* Declare supported EAPIs as: [QA] 6, 7 |
11 |
* Add inherit guards to die on unsupported/untested EAPIs |
12 |
* Add guard to prevent multiple inherits |
13 |
|
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
16 |
|
17 |
eclass/stardict.eclass | 42 ++++++++++++++++++++++++++++-------------- |
18 |
1 file changed, 28 insertions(+), 14 deletions(-) |
19 |
|
20 |
diff --git a/eclass/stardict.eclass b/eclass/stardict.eclass |
21 |
index 5e96b01625c..0061353f4ab 100644 |
22 |
--- a/eclass/stardict.eclass |
23 |
+++ b/eclass/stardict.eclass |
24 |
@@ -1,10 +1,10 @@ |
25 |
-# Copyright 1999-2020 Gentoo Authors |
26 |
+# Copyright 1999-2021 Gentoo Authors |
27 |
# Distributed under the terms of the GNU General Public License v2 |
28 |
|
29 |
-# Author : Alastair Tse <liquidx@g.o> |
30 |
-# |
31 |
-# Convienence class to do stardict dictionary installations. |
32 |
-# |
33 |
+# @NAME: stardict.eclass |
34 |
+# @AUTHOR: Alastair Tse <liquidx@g.o> |
35 |
+# @SUPPORTED_EAPIS: 6 7 |
36 |
+# @BLURB: Convenience class to do stardict dictionary installations. |
37 |
# Usage: |
38 |
# - Variables to set : |
39 |
# * FROM_LANG - From this language |
40 |
@@ -12,6 +12,16 @@ |
41 |
# * DICT_PREFIX - SRC_URI prefix, like "dictd_www.mova.org_" |
42 |
# * DICT_SUFFIX - SRC_URI after the prefix. |
43 |
|
44 |
+case ${EAPI:-0} in |
45 |
+ [67]) ;; |
46 |
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
47 |
+esac |
48 |
+ |
49 |
+EXPORT_FUNCTIONS src_compile src_install |
50 |
+ |
51 |
+if [[ -z ${_STARDICT_ECLASS} ]] ; then |
52 |
+_STARDICT_ECLASS=1 |
53 |
+ |
54 |
RESTRICT="strip" |
55 |
|
56 |
[ -z "${DICT_SUFFIX}" ] && DICT_SUFFIX=${PN#stardict-[[:lower:]]*-} |
57 |
@@ -25,18 +35,22 @@ fi |
58 |
|
59 |
HOMEPAGE="http://stardict.sourceforge.net/" |
60 |
SRC_URI="mirror://sourceforge/stardict/${DICT_P}.tar.bz2" |
61 |
+S="${WORKDIR}"/${DICT_P} |
62 |
|
63 |
-IUSE="gzip" |
64 |
-SLOT="0" |
65 |
LICENSE="GPL-2" |
66 |
+SLOT="0" |
67 |
+IUSE="gzip" |
68 |
|
69 |
-DEPEND="|| ( >=app-text/stardict-2.4.2 |
70 |
+DEPEND=" |
71 |
+ || ( |
72 |
+ >=app-text/stardict-2.4.2 |
73 |
app-text/sdcv |
74 |
- app-text/goldendict ) |
75 |
- gzip? ( app-arch/gzip |
76 |
- app-text/dictd )" |
77 |
- |
78 |
-S=${WORKDIR}/${DICT_P} |
79 |
+ app-text/goldendict |
80 |
+ ) |
81 |
+ gzip? ( |
82 |
+ app-arch/gzip |
83 |
+ app-text/dictd |
84 |
+ )" |
85 |
|
86 |
stardict_src_compile() { |
87 |
if use gzip; then |
88 |
@@ -56,4 +70,4 @@ stardict_src_install() { |
89 |
doins *.ifo |
90 |
} |
91 |
|
92 |
-EXPORT_FUNCTIONS src_compile src_install |
93 |
+fi |