Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Kyle Cavin <kyle.cavin@...>
Subject: gdata-build eclass proposal
Date: Mon, 26 Oct 2009 00:06:09 -0400
-----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:
gdata-tree.tar.bz2 (application/bzip)
# 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:
gdata-tree.tar.bz2.sig (Binary data)
Attachment:
gdata-build.eclass.sig (Binary data)
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
adding a modification timestamp to the installed pkgs database (vdb)
Next by thread:
qemu/kvm image with prepared multilib setup for testing
Previous by date:
adding a modification timestamp to the installed pkgs database (vdb)
Next by date:
Re: Automated Package Removal and Addition Tracker, for the week ending 2009-10-25 23h59 UTC


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.