dev-java/icedtea-bin: ppc64 stable wrt bug #720690
[gentoo.git] / dev-java / commons-validator / commons-validator-1.4.1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 JAVA_PKG_IUSE="examples source test" # doc
7
8 inherit java-pkg-2 java-ant-2
9
10 MY_P=${P}-src
11
12 DESCRIPTION="Commons component to validate user input, or data input"
13 HOMEPAGE="http://commons.apache.org/validator/"
14 SRC_URI="mirror://apache/commons/validator/source/${P}-src.tar.gz"
15
16 LICENSE="Apache-2.0"
17 SLOT="0"
18 KEYWORDS="~amd64 ~ppc64 ~x86"
19
20 RDEPEND=">=virtual/jre-1.6
21         >=dev-java/commons-digester-1.6:0
22         >=dev-java/commons-collections-3.1:0
23         >=dev-java/commons-logging-1.0.4:0
24         dev-java/commons-beanutils:1.7"
25
26 DEPEND=">=virtual/jdk-1.6
27         test? ( dev-java/junit:0 )
28         ${RDEPEND}"
29
30 S="${WORKDIR}/${MY_P}"
31
32 java_prepare() {
33         epatch "${FILESDIR}"/validator-1.4.build.xml.patch
34
35         JAVA_ANT_CLASSPATH_TAGS="javac java" java-ant_rewrite-classpath
36
37         echo "commons-digester.jar=$(java-pkg_getjars commons-digester)" >> build.properties
38         echo "commons-beanutils.jar=$(java-pkg_getjars commons-beanutils-1.7)" >> build.properties
39         echo "commons-logging.jar=$(java-pkg_getjar commons-logging commons-logging.jar)" >> build.properties
40         echo "commons-collections.jar=$(java-pkg_getjars commons-collections)" >> build.properties
41 }
42
43 EANT_JAVA_REWRITE_CLASSPATH="true"
44 EANT_GENTOO_CLASSPATH="commons-beanutils-1.7,commons-collections"
45 EANT_TEST_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH},commons-digester,commons-logging,junit"
46
47 EANT_BUILD_TARGET="compile"
48 EANT_EXTRA_ARGS="-Dskip.download=true"
49
50 src_compile() {
51         java-pkg-2_src_compile
52         jar -cf ${PN}.jar -C target/classes/ . || die "Could not create jar."
53
54         if use test ; then
55                 eant compile.tests ${EANT_EXTRA_ARGS} -Dgentoo.classpath="$(java-pkg_getjars --build-only --with-dependencies ${EANT_TEST_GENTOO_CLASSPATH})"
56                 jar -cf ${PN}-test.jar -C target/tests/ . || die "Could not create test jar."
57         fi
58 }
59
60 # Missing test suite org.apache.commons.validator.ValidatorTestSuite;
61 # therefore, tests can't be run.
62
63 # See https://issues.apache.org/jira/browse/VALIDATOR-323 for a bug report about this.
64 RESTRICT="test"
65
66 src_test() {
67         echo "junit.jar=$(java-pkg_getjars junit)" >> build.properties
68         eant test ${EANT_EXTRA_ARGS} -Dgentoo.classpath="$(java-pkg_getjars --build-only --with-dependencies ${EANT_TEST_GENTOO_CLASSPATH}):${PN}.jar:${PN}-test.jar"
69 }
70
71 src_install() {
72         java-pkg_dojar ${PN}.jar
73
74         dodoc NOTICE.txt RELEASE-NOTES.txt
75
76         # Docs are no longer generated, as they have commented them out;
77         # probably on purpose, since this is the start of a new branch.
78         # use doc && java-pkg_dojavadoc dist/docs/apidocs
79         use examples && java-pkg_doexamples src/example
80         use source && java-pkg_dosrc src/main/java/*
81 }