[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] RFC: new sword-module eclass
From:       Steve Dibb <beandog () gentoo ! org>
Date:       2008-01-29 5:38:27
Message-ID: 479EBBD3.9060303 () gentoo ! org
[Download RAW message or body]

Okay, this is my first attempt at writing an eclass, so comments are 
welcome.

First of all, here's the background.  Sword modules are currently lumped 
together in one general package (sword-modules), when it would be 
simpler and easier to track them by having them as individual packages, 
each in app-dict, with a package naming scheme of "sword-ModName" 
format.  ModName is the naming scheme used upstream to release modules 
as, so creating ebuilds is going to be in the official releases a matter 
of just inheriting the eclass and setting the SWORD_MODULE variable. 
The eclass takes care of the rest, which is just unpacking the files and 
dropping them in /usr/share/sword

Since upstream[1] doesn't have any proper versioning scheme (all 
releases are ModName.zip, regardless of version), I'm going to manually 
host a mirror on spaceparanoids[2] of the module with the version 
suffixed on the filename.  Alternatively, I could just put them in 
distfiles-local.  With the eclass, we can have ebuilds for each version 
release.

Let me know what you guys thinks.  Thanks.

Here's the eclass:

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

#
# eclass to simplify installation of Sword modules
# Bugs to theology@gentoo.org
#

HOMEPAGE="http://www.crosswire.org/sword/modules/"
SRC_URI="http://spaceparanoids.org/downloads/sword/${SWORD_MODULE}-${PV}.zip"

SLOT="0"
IUSE=""

S="${WORKDIR}"

RDEPEND="app-text/sword"
DEPEND="app-arch/unzip"

sword-module_src_install() {
         insinto /usr/share/sword/modules
         doins -r "${S}"/modules/*
         insinto /usr/share/sword/mods.d
         doins "${S}"/mods.d/*
}

EXPORT_FUNCTIONS src_install



And also a sample ebuild that inherits it, this would be 
app-dicts/sword-WebstersDict-1.1.ebuild:



# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

SWORD_MODULE="WebstersDict"

inherit sword-module

DESCRIPTION="Webster's Revised Unabridged Dictionary of the English 
Language 1913"
HOMEPAGE="http://crosswire.org/sword/modules/ModInfo.jsp?modName=WebstersDict"
LICENSE="public-domain"
KEYWORDS="~amd64"


1. http://crosswire.org/sword/modules/index.jsp

2. http://spaceparanoids.org/downloads/sword/
-- 
gentoo-dev@lists.gentoo.org mailing list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic