| 1 |
# Eclass for Java packages from bare sources exported by Maven |
| 2 |
# |
| 3 |
# Copyright (c) 2004-2011, Gentoo Foundation |
| 4 |
# |
| 5 |
# Licensed under the GNU General Public License, v2 |
| 6 |
# |
| 7 |
# $Header: /var/cvsroot/gentoo-x86/eclass/java-mvn-src.eclass,v 1.1 2010/01/16 18:48:39 weaver Exp $ |
| 8 |
|
| 9 |
inherit java-pkg-simple |
| 10 |
|
| 11 |
# ----------------------------------------------------------------------------- |
| 12 |
# @eclass-begin |
| 13 |
# @eclass-summary Eclass for Java packages from bare sources exported by Maven |
| 14 |
# |
| 15 |
# This class is intended to build pure Java packages from the sources exported |
| 16 |
# from the source:jar goal of Maven 2. These archives contain bare Java source |
| 17 |
# files, with no build instructions or additional resource files. They are |
| 18 |
# unsuitable for packages that require resources besides compiled class files. |
| 19 |
# The benefit is that for artifacts developed with Maven, these source files |
| 20 |
# are often released together with binary packages, whereas the full build |
| 21 |
# environment might be contained in some revision control system or not |
| 22 |
# available at all. |
| 23 |
# ----------------------------------------------------------------------------- |
| 24 |
|
| 25 |
# ----------------------------------------------------------------------------- |
| 26 |
# @variable-external GROUP_ID |
| 27 |
# @variable-default ${PN} |
| 28 |
# |
| 29 |
# The groupId of the artifact, in dotted notation. |
| 30 |
# ----------------------------------------------------------------------------- |
| 31 |
: ${GROUP_ID:=${PN}} |
| 32 |
|
| 33 |
# ----------------------------------------------------------------------------- |
| 34 |
# @variable-external ARTIFACT_ID |
| 35 |
# @variable-default ${PN} |
| 36 |
# |
| 37 |
# The artifactId of the artifact. |
| 38 |
# ----------------------------------------------------------------------------- |
| 39 |
: ${ARTIFACT_ID:=${PN}} |
| 40 |
|
| 41 |
# ----------------------------------------------------------------------------- |
| 42 |
# @variable-external MAVEN2_REPOSITORIES |
| 43 |
# @variable-default http://repo2.maven.org/maven2 http://download.java.net/maven/2 |
| 44 |
# |
| 45 |
# The repositories to search for the artifacts. Must follow Maven2 layout. |
| 46 |
# ----------------------------------------------------------------------------- |
| 47 |
: ${MAVEN2_REPOSITORIES:="http://repo2.maven.org/maven2 http://download.java.net/maven/2"} |
| 48 |
|
| 49 |
# ----------------------------------------------------------------------------- |
| 50 |
# @variable-internal RELATIVE_SRC_URI |
| 51 |
# |
| 52 |
# The path of the source artifact relative to the root of the repository. |
| 53 |
# Will be set by the eclass to follow Maven 2 repository layout. |
| 54 |
# ----------------------------------------------------------------------------- |
| 55 |
RELATIVE_SRC_URI=${GROUP_ID//./\/}/${ARTIFACT_ID}/${PV}/${ARTIFACT_ID}-${PV}-sources.jar |
| 56 |
|
| 57 |
# Look for source jar in all listed repositories |
| 58 |
for repo in ${MAVEN2_REPOSITORIES}; do |
| 59 |
SRC_URI="${SRC_URI} ${repo}/${RELATIVE_SRC_URI}" |
| 60 |
done |
| 61 |
unset repo |
| 62 |
|
| 63 |
# ------------------------------------------------------------------------------ |
| 64 |
# @eclass-end |
| 65 |
# ------------------------------------------------------------------------------ |