perl-functions.eclass: should 'just work' in EAPI=6
[gentoo.git] / eclass / java-mvn-src.eclass
1 # Copyright 2004-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 # @ECLASS: java-mvn-src.eclass
6 # @MAINTAINER:
7 # java@gentoo.org
8 # @AUTHOR:
9 # Java maintainers (java@gentoo.org)
10 # @BLURB: Eclass for Java packages from bare sources exported by Maven
11 # @DESCRIPTION:
12 # This class is intended to build pure Java packages from the sources exported
13 # from the source:jar goal of Maven 2. These archives contain bare Java source
14 # files, with no build instructions or additional resource files. They are
15 # unsuitable for packages that require resources besides compiled class files.
16 # The benefit is that for artifacts developed with Maven, these source files
17 # are often released together with binary packages, whereas the full build
18 # environment might be contained in some revision control system or not
19 # available at all.
20
21 inherit java-pkg-simple
22
23 # @ECLASS-VARIABLE: GROUP_ID
24 # @DESCRIPTION:
25 # The groupId of the artifact, in dotted notation. Default value is ${PN}.
26 : ${GROUP_ID:=${PN}}
27
28 # @ECLASS-VARIABLE: ARTIFACT_ID
29 # @DESCRIPTION:
30 # The artifactId of the artifact. Default value is ${PN}.
31 : ${ARTIFACT_ID:=${PN}}
32
33 # @ECLASS-VARIABLE: MAVEN2_REPOSITORIES
34 # @DESCRIPTION:
35 # The repositories to search for the artifacts. Must follow Maven2 layout.
36 # Default value is the following string:
37 # "http://repo2.maven.org/maven2 http://download.java.net/maven/2"
38 : ${MAVEN2_REPOSITORIES:="http://repo2.maven.org/maven2 http://download.java.net/maven/2"}
39
40 # @ECLASS-VARIABLE: RELATIVE_SRC_URI
41 # @DESCRIPTION:
42 # The path of the source artifact relative to the root of the repository.
43 # Will be set by the eclass to follow Maven 2 repository layout.
44 RELATIVE_SRC_URI=${GROUP_ID//./\/}/${ARTIFACT_ID}/${PV}/${ARTIFACT_ID}-${PV}-sources.jar
45
46 # Look for source jar in all listed repositories
47 for repo in ${MAVEN2_REPOSITORIES}; do
48         SRC_URI="${SRC_URI} ${repo}/${RELATIVE_SRC_URI}"
49 done
50 unset repo