1 |
Okay, this is my first attempt at writing an eclass, so comments are |
2 |
welcome. |
3 |
|
4 |
First of all, here's the background. Sword modules are currently lumped |
5 |
together in one general package (sword-modules), when it would be |
6 |
simpler and easier to track them by having them as individual packages, |
7 |
each in app-dict, with a package naming scheme of "sword-ModName" |
8 |
format. ModName is the naming scheme used upstream to release modules |
9 |
as, so creating ebuilds is going to be in the official releases a matter |
10 |
of just inheriting the eclass and setting the SWORD_MODULE variable. |
11 |
The eclass takes care of the rest, which is just unpacking the files and |
12 |
dropping them in /usr/share/sword |
13 |
|
14 |
Since upstream[1] doesn't have any proper versioning scheme (all |
15 |
releases are ModName.zip, regardless of version), I'm going to manually |
16 |
host a mirror on spaceparanoids[2] of the module with the version |
17 |
suffixed on the filename. Alternatively, I could just put them in |
18 |
distfiles-local. With the eclass, we can have ebuilds for each version |
19 |
release. |
20 |
|
21 |
Let me know what you guys thinks. Thanks. |
22 |
|
23 |
Here's the eclass: |
24 |
|
25 |
# Copyright 1999-2008 Gentoo Foundation |
26 |
# Distributed under the terms of the GNU General Public License v2 |
27 |
# $Header: $ |
28 |
|
29 |
# |
30 |
# eclass to simplify installation of Sword modules |
31 |
# Bugs to theology@g.o |
32 |
# |
33 |
|
34 |
HOMEPAGE="http://www.crosswire.org/sword/modules/" |
35 |
SRC_URI="http://spaceparanoids.org/downloads/sword/${SWORD_MODULE}-${PV}.zip" |
36 |
|
37 |
SLOT="0" |
38 |
IUSE="" |
39 |
|
40 |
S="${WORKDIR}" |
41 |
|
42 |
RDEPEND="app-text/sword" |
43 |
DEPEND="app-arch/unzip" |
44 |
|
45 |
sword-module_src_install() { |
46 |
insinto /usr/share/sword/modules |
47 |
doins -r "${S}"/modules/* |
48 |
insinto /usr/share/sword/mods.d |
49 |
doins "${S}"/mods.d/* |
50 |
} |
51 |
|
52 |
EXPORT_FUNCTIONS src_install |
53 |
|
54 |
|
55 |
|
56 |
And also a sample ebuild that inherits it, this would be |
57 |
app-dicts/sword-WebstersDict-1.1.ebuild: |
58 |
|
59 |
|
60 |
|
61 |
# Copyright 1999-2008 Gentoo Foundation |
62 |
# Distributed under the terms of the GNU General Public License v2 |
63 |
# $Header: $ |
64 |
|
65 |
SWORD_MODULE="WebstersDict" |
66 |
|
67 |
inherit sword-module |
68 |
|
69 |
DESCRIPTION="Webster's Revised Unabridged Dictionary of the English |
70 |
Language 1913" |
71 |
HOMEPAGE="http://crosswire.org/sword/modules/ModInfo.jsp?modName=WebstersDict" |
72 |
LICENSE="public-domain" |
73 |
KEYWORDS="~amd64" |
74 |
|
75 |
|
76 |
1. http://crosswire.org/sword/modules/index.jsp |
77 |
|
78 |
2. http://spaceparanoids.org/downloads/sword/ |
79 |
-- |
80 |
gentoo-dev@l.g.o mailing list |