/[gentoo-x86]/eclass/ant-tasks.eclass
Gentoo

Diff of /eclass/ant-tasks.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.16
1# Eclass for building dev-java/ant-* packages 1# Eclass for building dev-java/ant-* packages
2# 2#
3# Copyright 1999-2013 Gentoo Foundation 3# Copyright 1999-2013 Gentoo Foundation
4# Distributed under the terms of the GNU General Public License, v2 or later 4# Distributed under the terms of the GNU General Public License, v2 or later
5# Author Vlastimil Babka <caster@gentoo.org> 5# Author Vlastimil Babka <caster@gentoo.org>
6# $Header: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v 1.15 2013/08/28 21:28:33 tomwij Exp $ 6# $Header: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v 1.16 2013/10/05 12:07:01 caster Exp $
7
8# @ECLASS: ant-tasks.eclass
9# @MAINTAINER:
10# java@gentoo.org
11# @AUTHOR:
12# Vlastimil Babka <caster@gentoo.org>
13# @BLURB: Eclass for building dev-java/ant-* packages
14# @DESCRIPTION:
15# This eclass provides functionality and default ebuild variables for building
16# dev-java/ant-* packages easily.
17
7 18
8# we set ant-core dep ourselves, restricted 19# we set ant-core dep ourselves, restricted
9JAVA_ANT_DISABLE_ANT_CORE_DEP=true 20JAVA_ANT_DISABLE_ANT_CORE_DEP=true
10# rewriting build.xml for are the testcases has no reason atm 21# rewriting build.xml for are the testcases has no reason atm
11JAVA_PKG_BSFIX_ALL=no 22JAVA_PKG_BSFIX_ALL=no
12inherit versionator java-pkg-2 java-ant-2 23inherit versionator java-pkg-2 java-ant-2
13 24
14EXPORT_FUNCTIONS src_unpack src_compile src_install 25EXPORT_FUNCTIONS src_unpack src_compile src_install
15 26
16# ----------------------------------------------------------------------------- 27# @ECLASS-VARIABLE: ANT_TASK_JDKVER
17# @eclass-begin 28# @DESCRIPTION:
18# @eclass-shortdesc Eclass for building dev-java/ant-* packages
19# @eclass-maintainer java@gentoo.org
20#
21# This eclass provides functionality and default ebuild variables for building
22# dev-java/ant-* packages easily.
23#
24# -----------------------------------------------------------------------------
25
26# -----------------------------------------------------------------------------
27# @variable-preinherit ANT_TASK_JDKVER
28# @variable-default 1.5
29#
30# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.5, can 29# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.5, can
31# be overriden from ebuild BEFORE inheriting this eclass. 30# be overriden from ebuild BEFORE inheriting this eclass.
32# -----------------------------------------------------------------------------
33ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.5} 31ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.5}
34 32
35# ----------------------------------------------------------------------------- 33# @ECLASS-VARIABLE: ANT_TASK_JREVER
36# @variable-preinherit ANT_TASK_JREVER 34# @DESCRIPTION:
37# @variable-default 1.5
38#
39# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.5, can 35# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.5, can
40# be overriden from ebuild BEFORE inheriting this eclass. 36# be overriden from ebuild BEFORE inheriting this eclass.
41# -----------------------------------------------------------------------------
42ANT_TASK_JREVER=${ANT_TASK_JREVER-1.5} 37ANT_TASK_JREVER=${ANT_TASK_JREVER-1.5}
43 38
44# ----------------------------------------------------------------------------- 39# @ECLASS-VARIABLE: ANT_TASK_NAME
45# @variable-internal ANT_TASK_NAME 40# @DESCRIPTION:
46# @variable-default the rest of $PN after "ant-"
47#
48# The name of this ant task as recognized by ant's build.xml, derived from $PN. 41# The name of this ant task as recognized by ant's build.xml, derived from $PN
49# ----------------------------------------------------------------------------- 42# by removing the ant- prefix. Read-only.
50ANT_TASK_NAME="${PN#ant-}" 43ANT_TASK_NAME="${PN#ant-}"
51 44
52# ----------------------------------------------------------------------------- 45# @ECLASS-VARIABLE: ANT_TASK_DEPNAME
53# @variable-preinherit ANT_TASK_DEPNAME 46# @DESCRIPTION:
54# @variable-default $ANT_TASK_NAME
55#
56# Specifies JAVA_PKG_NAME (PN{-SLOT} used with java-pkg_jar-from) of the package 47# Specifies JAVA_PKG_NAME (PN{-SLOT} used with java-pkg_jar-from) of the package
57# that this one depends on. Defaults to the name of ant task, ebuild can 48# that this one depends on. Defaults to the name of ant task, ebuild can
58# override it before inheriting this eclass. 49# override it before inheriting this eclass.
59# -----------------------------------------------------------------------------
60ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} 50ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}}
61 51
62# ----------------------------------------------------------------------------- 52# @ECLASS-VARIABLE: ANT_TASK_DISABLE_VM_DEPS
63# @variable-preinherit ANT_TASK_DISABLE_VM_DEPS 53# @DEFAULT_UNSET
64# @variable-default unset 54# @DESCRIPTION:
65#
66# If set, no JDK/JRE deps are added. 55# If set, no JDK/JRE deps are added.
67# -----------------------------------------------------------------------------
68 56
69# ----------------------------------------------------------------------------- 57# @VARIABLE: ANT_TASK_PV
70# @variable-internal ANT_TASK_PV 58# @INTERNAL
71# @variable-default Just the number in $PV without any beta/RC suffixes
72#
73# Version of ant-core this task is intended to register and thus load with. 59# Version of ant-core this task is intended to register and thus load with.
74# -----------------------------------------------------------------------------
75ANT_TASK_PV="${PV}" 60ANT_TASK_PV="${PV}"
76 61
77# special care for beta/RC releases 62# special care for beta/RC releases
78if [[ ${PV} == *beta2* ]]; then 63if [[ ${PV} == *beta2* ]]; then
79 MY_PV=${PV/_beta2/beta} 64 MY_PV=${PV/_beta2/beta}
103fi 88fi
104 89
105# source/workdir name 90# source/workdir name
106MY_P="apache-ant-${MY_PV}" 91MY_P="apache-ant-${MY_PV}"
107 92
108# -----------------------------------------------------------------------------
109# Default values for standard ebuild variables, can be overriden from ebuild. 93# Default values for standard ebuild variables, can be overriden from ebuild.
110# -----------------------------------------------------------------------------
111DESCRIPTION="Apache Ant's optional tasks depending on ${ANT_TASK_DEPNAME}" 94DESCRIPTION="Apache Ant's optional tasks depending on ${ANT_TASK_DEPNAME}"
112HOMEPAGE="http://ant.apache.org/" 95HOMEPAGE="http://ant.apache.org/"
113SRC_URI="${UPSTREAM_PREFIX}/${MY_P}-src.tar.bz2 96SRC_URI="${UPSTREAM_PREFIX}/${MY_P}-src.tar.bz2
114 ${GENTOO_PREFIX}/ant-${PV}-gentoo.tar.bz2" 97 ${GENTOO_PREFIX}/ant-${PV}-gentoo.tar.bz2"
115LICENSE="Apache-2.0" 98LICENSE="Apache-2.0"
131# Would run the full ant test suite for every ant task 114# Would run the full ant test suite for every ant task
132RESTRICT="test" 115RESTRICT="test"
133 116
134S="${WORKDIR}/${MY_P}" 117S="${WORKDIR}/${MY_P}"
135 118
136# ------------------------------------------------------------------------------ 119# @FUNCTION: ant-tasks_src_unpack
137# @eclass-src_unpack 120# @USAGE: [ base ] [ jar-dep ] [ all ]
121# @DESCRIPTION:
122# The function Is split into two parts, defaults to both of them ('all').
138# 123#
139# Is split into two parts, defaults to both of them ('all').
140# base: performs the unpack, build.xml replacement and symlinks ant.jar from 124# base: performs the unpack, build.xml replacement and symlinks ant.jar from
141# ant-core 125# ant-core
126#
142# jar-dep: symlinks the jar file(s) from dependency package 127# jar-dep: symlinks the jar file(s) from dependency package
143# ------------------------------------------------------------------------------
144ant-tasks_src_unpack() { 128ant-tasks_src_unpack() {
145 [[ -z "${1}" ]] && ant-tasks_src_unpack all 129 [[ -z "${1}" ]] && ant-tasks_src_unpack all
146 130
147 while [[ -n "${1}" ]]; do 131 while [[ -n "${1}" ]]; do
148 case ${1} in 132 case ${1} in
170 shift 154 shift
171 done 155 done
172 156
173} 157}
174 158
175# ------------------------------------------------------------------------------ 159# @FUNCTION: ant-tasks_src_compile
176# @eclass-src_compile 160# @DESCRIPTION:
177#
178# Compiles the jar with installed ant-core. 161# Compiles the jar with installed ant-core.
179# ------------------------------------------------------------------------------
180ant-tasks_src_compile() { 162ant-tasks_src_compile() {
181 ANT_TASKS="none" eant -Dbuild.dep=${ANT_TASK_NAME} jar-dep 163 ANT_TASKS="none" eant -Dbuild.dep=${ANT_TASK_NAME} jar-dep
182} 164}
183 165
184# ------------------------------------------------------------------------------ 166# @FUNCTION: ant-tasks_src_install
185# @eclass-src_install 167# @DESCRIPTION:
186#
187# Installs the jar and registers its presence for the ant launcher script. 168# Installs the jar and registers its presence for the ant launcher script.
188# Version param ensures it won't get loaded (thus break) when ant-core is 169# Version param ensures it won't get loaded (thus break) when ant-core is
189# updated to newer version. 170# updated to newer version.
190# ------------------------------------------------------------------------------
191ant-tasks_src_install() { 171ant-tasks_src_install() {
192 java-pkg_dojar build/lib/${PN}.jar 172 java-pkg_dojar build/lib/${PN}.jar
193 java-pkg_register-ant-task --version "${ANT_TASK_PV}" 173 java-pkg_register-ant-task --version "${ANT_TASK_PV}"
194 174
195 # create the compatibility symlink 175 # create the compatibility symlink

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20