| 1 | # Eclass for building dev-java/ant-* packages |
1 | # Eclass for building dev-java/ant-* packages |
| 2 | # |
2 | # |
| 3 | # Copyright 2007 Gentoo Foundation |
3 | # Copyright 2007 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.5 2008/07/07 16:48:45 betelgeuse Exp $ |
6 | # $Header: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v 1.6 2008/07/14 21:38:14 caster Exp $ |
| 7 | |
7 | |
| 8 | # we set ant-core dep ourselves, restricted |
8 | # we set ant-core dep ourselves, restricted |
| 9 | JAVA_ANT_DISABLE_ANT_CORE_DEP=true |
9 | JAVA_ANT_DISABLE_ANT_CORE_DEP=true |
| 10 | # rewriting build.xml for are the testcases has no reason atm |
10 | # rewriting build.xml for are the testcases has no reason atm |
| 11 | JAVA_PKG_BSFIX_ALL=no |
11 | JAVA_PKG_BSFIX_ALL=no |
| … | |
… | |
| 66 | # Version of ant-core this task is intended to register and thus load with. |
66 | # Version of ant-core this task is intended to register and thus load with. |
| 67 | # ----------------------------------------------------------------------------- |
67 | # ----------------------------------------------------------------------------- |
| 68 | ANT_TASK_PV="${PV}" |
68 | ANT_TASK_PV="${PV}" |
| 69 | |
69 | |
| 70 | # special care for beta/RC releases |
70 | # special care for beta/RC releases |
| 71 | if [[ ${PV} == *beta* ]]; then |
71 | if [[ ${PV} == *beta2* ]]; then |
| 72 | MY_PV=${PV/_beta/Beta} |
72 | MY_PV=${PV/_beta2/beta} |
|
|
73 | UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src" |
| 73 | SRC_URI_PREFIX="http://dev.gentoo.org/~caster/distfiles" |
74 | GENTOO_PREFIX="http://dev.gentoo.org/~caster/distfiles" |
| 74 | ANT_TASK_PV=$(get_version_component_range 1-3) |
75 | ANT_TASK_PV=$(get_version_component_range 1-3) |
| 75 | elif [[ ${PV} == *_rc* ]]; then |
76 | elif [[ ${PV} == *_rc* ]]; then |
| 76 | MY_PV=${PV/_rc/RC} |
77 | MY_PV=${PV/_rc/RC} |
| 77 | SRC_URI_PREFIX="http://dev.gentoo.org/~caster/distfiles" |
78 | UPSTREAM_PREFIX="http://dev.gentoo.org/~caster/distfiles" |
|
|
79 | GENTOO_PREFIX="http://dev.gentoo.org/~caster/distfiles" |
| 78 | ANT_TASK_PV=$(get_version_component_range 1-3) |
80 | ANT_TASK_PV=$(get_version_component_range 1-3) |
| 79 | else |
81 | else |
| 80 | # default for final releases |
82 | # default for final releases |
| 81 | MY_PV=${PV} |
83 | MY_PV=${PV} |
| 82 | SRC_URI_PREFIX="mirror://apache/ant/source" |
84 | UPSTREAM_PREFIX="mirror://apache/ant/source" |
|
|
85 | GENTOO_PREFIX="mirror://gentoo" |
| 83 | fi |
86 | fi |
| 84 | |
87 | |
| 85 | # source/workdir name |
88 | # source/workdir name |
| 86 | MY_P="apache-ant-${MY_PV}" |
89 | MY_P="apache-ant-${MY_PV}" |
| 87 | |
90 | |
| 88 | # ----------------------------------------------------------------------------- |
91 | # ----------------------------------------------------------------------------- |
| 89 | # Default values for standard ebuild variables, can be overriden from ebuild. |
92 | # Default values for standard ebuild variables, can be overriden from ebuild. |
| 90 | # ----------------------------------------------------------------------------- |
93 | # ----------------------------------------------------------------------------- |
| 91 | DESCRIPTION="Apache Ant's optional tasks depending on ${ANT_TASK_DEPNAME}" |
94 | DESCRIPTION="Apache Ant's optional tasks depending on ${ANT_TASK_DEPNAME}" |
| 92 | HOMEPAGE="http://ant.apache.org/" |
95 | HOMEPAGE="http://ant.apache.org/" |
| 93 | SRC_URI="${SRC_URI_PREFIX}/${MY_P}-src.tar.bz2 |
96 | SRC_URI="${UPSTREAM_PREFIX}/${MY_P}-src.tar.bz2 |
| 94 | mirror://gentoo/ant-${PV}-gentoo.tar.bz2" |
97 | ${GENTOO_PREFIX}/ant-${PV}-gentoo.tar.bz2" |
| 95 | LICENSE="Apache-2.0" |
98 | LICENSE="Apache-2.0" |
| 96 | SLOT="0" |
99 | SLOT="0" |
| 97 | IUSE="" |
100 | IUSE="" |
| 98 | |
101 | |
| 99 | RDEPEND=">=virtual/jre-${ANT_TASK_JREVER} |
102 | RDEPEND=">=virtual/jre-${ANT_TASK_JREVER} |
| 100 | ~dev-java/ant-core-${PV}" |
103 | ~dev-java/ant-core-${PV}" |
| 101 | DEPEND=">=virtual/jdk-${ANT_TASK_JDKVER} |
104 | DEPEND=">=virtual/jdk-${ANT_TASK_JDKVER} |
| 102 | ${RDEPEND}" |
105 | ${RDEPEND}" |
| 103 | |
106 | |
| 104 | S="${WORKDIR}/${MY_P}" |
|
|
| 105 | |
|
|
| 106 | # Would run the full ant test suite for every ant task |
107 | # Would run the full ant test suite for every ant task |
| 107 | RESTRICT="test" |
108 | RESTRICT="test" |
|
|
109 | |
|
|
110 | S="${WORKDIR}/${MY_P}" |
| 108 | |
111 | |
| 109 | # ------------------------------------------------------------------------------ |
112 | # ------------------------------------------------------------------------------ |
| 110 | # @eclass-src_unpack |
113 | # @eclass-src_unpack |
| 111 | # |
114 | # |
| 112 | # Is split into two parts, defaults to both of them ('all'). |
115 | # Is split into two parts, defaults to both of them ('all'). |
| … | |
… | |
| 132 | |
135 | |
| 133 | # ant.jar to build against |
136 | # ant.jar to build against |
| 134 | java-pkg_jar-from --build-only ant-core ant.jar;; |
137 | java-pkg_jar-from --build-only ant-core ant.jar;; |
| 135 | jar-dep) |
138 | jar-dep) |
| 136 | # get jar from the dependency package |
139 | # get jar from the dependency package |
|
|
140 | if [[ -n "${ANT_TASK_DEPNAME}" ]]; then |
| 137 | java-pkg_jar-from ${ANT_TASK_DEPNAME};; |
141 | java-pkg_jar-from ${ANT_TASK_DEPNAME} |
|
|
142 | fi;; |
| 138 | all) |
143 | all) |
| 139 | ant-tasks_src_unpack base jar-dep;; |
144 | ant-tasks_src_unpack base jar-dep;; |
| 140 | esac |
145 | esac |
| 141 | shift |
146 | shift |
| 142 | done |
147 | done |
| … | |
… | |
| 160 | # updated to newer version. |
165 | # updated to newer version. |
| 161 | # ------------------------------------------------------------------------------ |
166 | # ------------------------------------------------------------------------------ |
| 162 | ant-tasks_src_install() { |
167 | ant-tasks_src_install() { |
| 163 | java-pkg_dojar build/lib/${PN}.jar |
168 | java-pkg_dojar build/lib/${PN}.jar |
| 164 | java-pkg_register-ant-task --version "${ANT_TASK_PV}" |
169 | java-pkg_register-ant-task --version "${ANT_TASK_PV}" |
|
|
170 | |
|
|
171 | # create the compatibility symlink |
|
|
172 | if version_is_at_least 1.7.1_beta2; then |
|
|
173 | dodir /usr/share/ant/lib |
|
|
174 | dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar |
|
|
175 | fi |
| 165 | } |
176 | } |