* [gentoo-dev] gdata-build eclass proposal
@ 2009-10-26 4:06 Kyle Cavin
2009-10-26 21:41 ` William Hubbs
0 siblings, 1 reply; 2+ messages in thread
From: Kyle Cavin @ 2009-10-26 4:06 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The Google Data Protocol is a REST-inspired technology for reading,
writing, and modifying information on the web.
LINK: http://code.google.com/apis/gdata/
The upstream distribution packages together 18 separate java libraries.
This eclass separates these packages, permitting trivial ebuilds.
Please tinker and advise.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkrlIDEACgkQWiD4kSM5q3kz4gCcD3G2VsynWxhCZEgPIF/SfIW3
5gQAn3tJI+NvZ3Hql/Wv0ELhvMGuTBwx
=o4aA
-----END PGP SIGNATURE-----
[-- Attachment #2: gdata-tree.tar.bz2 --]
[-- Type: application/x-bzip, Size: 5247 bytes --]
[-- Attachment #3: gdata-build.eclass --]
[-- Type: text/plain, Size: 3212 bytes --]
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# @ECLASS: gdata-build.eclass
# @BLURB: Eclass for gdata API ebuilds.
# @DESCRIPTION:
# This eclass contains various functions that are used when building gdata APIs.
EAPI="2"
#JAVA_PKG_DEBUG=1
WANT_ANT_TASKS="ant-nodeps"
EANT_BUILD_XML="build-src.xml"
EANT_BUILD_TARGET="build.manifest build.${PN/gdata-/}"
inherit java-utils-2 java-pkg-2 java-ant-2
MY_P="db-${P}"
DESCRIPTION="Google Data APIs${GDATA_EXTRA_DESCRIPTION}"
HOMEPAGE="http://code.google.com/apis/gdata/"
SRC_URI="http://gdata-java-client.googlecode.com/files/gdata-src.java-${PV}.zip"
LICENSE="Apache-2.0"
COMMON_DEPS="${GDATA_EXTRA_DEPS}"
if [ ${PN} == "gdata-core" ]; then
COMMON_DEPS="$COMMON_DEPS
java-virtuals/apt-mirror:0
java-virtuals/javamail:0
>=dev-java/sun-jaf-1.1"
else
COMMON_DEPS="$COMMON_DEPS
>=dev-java/gdata-core-${PV}"
fi
DEPEND="$COMMON_DEPS
>=virtual/jdk-1.6"
RDEPEND="$COMMON_DEPS
>=virtual/jre-1.6"
# @ECLASS-VARIABLE: GDATA_EXTRA_JARS
# @DESCRIPTION:
# Base names for extra jars included by the package. All jars are expected to
# exist in the lib directory of the build tree. If a corresponding meta package
# exists, it will also be installed.
#
# @EXAMPLE:
# To include a jar named gdata-examples-3.0.jar, use following line:
# GDATA_EXTRA_JARS="gdata-examples"
# @ECLASS-VARIABLE: GDATA_EXTRA_DEPS
# @DESCRIPTION:
# Convenience variable to add dependencies to both DEPEND and RDEPEND.
# @ECLASS-VARIABLE: GDATA_EXTRA_DESCRIPTION
# @DESCRIPTION:
# Clarify any ambiguous package names with this variable. Prepend a colon
# to the string so it looks pretty, and stays consistent.
# @ECLASS-VARIABLE: GDATA_TARGET
# @DESCRIPTION:
# Override the default installation jar. The form of this variable is identical
# to that of GDATA_EXTRA_JARS, and defaults to ${PN}.
S="${WORKDIR}/gdata/java"
# @FUNCTION: gdata-build_src_prepare
# @DESCRIPTION: Prepares dependencies and classpath for each build.
gdata-build_src_prepare() {
mkdir gdata_dep
if [ ${PN} != "gdata-core" ]; then
EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} gdata-core"
else
java-pkg_jar-from google-collect
java-pkg_jar-from sun-jaf {,gdata_dep/}activation.jar
java-pkg_jar-from javamail {,gdata_dep/}mail.jar
EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH} apt-mirror"
fi
sed -i -e 's|/tmp/||' build-src/build.properties
for i in build-src.xml build-src/{core,${PN/gdata-/}}.xml; do
if [ ${PN} != "gdata-core" ]; then
tmp="`basename $i .xml`"
echo "Removing target dependencies for $i"
sed -i -e "/<target name=\"build.$tmp\"/s|depends=[^ />]*||" $i
fi
java-ant_rewrite-classpath $i;
done
rm -f lib/*
}
# @FUNCTION: gdata-build_src_install
# @DESCRIPTION: Installs the required targets.
gdata-build_src_install() {
for pkg in ${GDATA_TARGET-${PN}} ${GDATA_EXTRA_JARS}; do
java-pkg_newjar lib/$pkg-[0-9]*.jar $pkg.jar
[ -f lib/$pkg-meta*.jar ] && \
java-pkg_newjar lib/$pkg-meta*.jar $pkg-meta.jar
done
if [ ${PN} == "gdata-core" ]; then
dodoc ../README-src.txt ../RELEASE_NOTES.txt || die "docs failed"
fi
}
EXPORT_FUNCTIONS src_prepare src_install
[-- Attachment #4: gdata-tree.tar.bz2.sig --]
[-- Type: application/octet-stream, Size: 72 bytes --]
[-- Attachment #5: gdata-build.eclass.sig --]
[-- Type: application/octet-stream, Size: 72 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-dev] gdata-build eclass proposal
2009-10-26 4:06 [gentoo-dev] gdata-build eclass proposal Kyle Cavin
@ 2009-10-26 21:41 ` William Hubbs
0 siblings, 0 replies; 2+ messages in thread
From: William Hubbs @ 2009-10-26 21:41 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 416 bytes --]
On Mon, Oct 26, 2009 at 12:06:09AM -0400, Kyle Cavin wrote:
<snip>
> # @ECLASS: gdata-build.eclass
> # @BLURB: Eclass for gdata API ebuilds.
> # @DESCRIPTION:
> # This eclass contains various functions that are used when building gdata APIs.
>
> EAPI="2"
EAPI can be tested for in eclasses, but eclasses should not set it.
---
William Hubbs
gentoo accessibility team lead
williamh@gentoo.org
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-26 21:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-26 4:06 [gentoo-dev] gdata-build eclass proposal Kyle Cavin
2009-10-26 21:41 ` William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox