dev-java/jboss-marshalling: update homepage
[gentoo.git] / dev-java / commons-io / commons-io-2.4.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 JAVA_PKG_IUSE="doc source"
6
7 inherit java-pkg-2 java-ant-2 eutils
8
9 MY_P=${P}-src
10 DESCRIPTION="Utility classes, stream implementations, file filters, and endian classes"
11 HOMEPAGE="http://commons.apache.org/io/"
12 SRC_URI="mirror://apache/commons/io/source/${MY_P}.tar.gz"
13
14 LICENSE="Apache-2.0"
15 SLOT="1"
16 KEYWORDS="amd64 ~arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
17 IUSE="test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND=">=virtual/jre-1.6"
21 DEPEND=">=virtual/jdk-1.6
22         test? (
23                 dev-java/ant-junit:0
24                 dev-java/junit:4
25         )"
26
27 S=${WORKDIR}/${MY_P}
28
29 EANT_EXTRA_ARGS="-Dcomponent.version=${PV}"
30 JAVA_ANT_REWRITE_CLASSPATH="yes"
31 JAVA_ANT_ENCODING="ISO-8859-1"
32
33 java_prepare() {
34         # Setting java.io.tmpdir doesn't have effect unless we do this because the vm is forked
35         java-ant_xml-rewrite -f build.xml --change -e junit -a clonevm -v "true"
36 }
37
38 src_test() {
39         if [[ ${EUID} -ne 0 ]] ; then
40                 ANT_OPTS="-Dskip.download=1 -Djava.io.tmpdir=${T} -Duser.home=${T}" \
41                 ANT_TASKS="ant-junit" \
42                         eant test \
43                         -Dgentoo.classpath="$(java-pkg_getjars junit-4):${S}/src/test/resources" \
44                         -Dlibdir="libdir" \
45                         -Djava.io.tmpdir="${T}"
46         else
47                 elog "Tests fail unless userpriv is enabled because they test for"
48                 elog "file permissions which doesn't work when run as root."
49         fi
50 }
51
52 src_install() {
53         java-pkg_newjar target/${P}.jar
54
55         dodoc RELEASE-NOTES.txt
56         use doc && java-pkg_dojavadoc target/apidocs
57         use source && java-pkg_dosrc src/main/java/*
58 }