summaryrefslogtreecommitdiff
blob: 02a082f1c8f2ea54152da9828a422d67eba89390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/commons-io/commons-io-1.3.ebuild,v 1.6 2007/03/12 17:55:32 corsair Exp $

JAVA_PKG_IUSE="doc source"

inherit java-pkg-2 java-ant-2 eutils

MY_P="${P}-src"
DESCRIPTION="Commons-IO contains utility classes, stream implementations, file filters, and endian classes."
HOMEPAGE="http://jakarta.apache.org/commons/io"
SRC_URI="mirror://apache/jakarta/commons/io/source/${MY_P}.tar.gz"

LICENSE="Apache-1.1"
SLOT="1"
KEYWORDS="amd64 ~ppc ppc64 x86 ~x86-fbsd"
IUSE="test"

DEPEND=">=virtual/jdk-1.4
	source? ( app-arch/zip )
	test? (
		=dev-java/junit-3.8*
		dev-java/ant
	)
	!test? ( dev-java/ant-core )"
RDEPEND=">=virtual/jre-1.4"

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${A}

	cd "${S}"
	rm *.jar
	epatch ${FILESDIR}/${P}-build.xml.patch
	java-ant_ignore-system-classes
	java-ant_rewrite-classpath
}

src_test() {
	if hasq userpriv ${FEATURES}; then
		#By default libdir is ${HOME}/.maven so it can be /root/.maven
		ANT_OPTS="-Djava.io.tmpdir=${T}" eant test \
			-Dgentoo.classpath="$(java-pkg_getjars junit)" \
			-Dlibdir="libdir"
	else
		elog "Tests require userpriv in FEATURES because they test"
		elog "accessing files which always succeeds for root."
	fi
}

src_install() {
	java-pkg_newjar build/${P}.jar ${PN}.jar

	dodoc RELEASE-NOTES.txt NOTICE.txt || die
	use doc && java-pkg_dojavadoc build/dist-build/${P}/docs
	use source && java-pkg_dosrc src/java/*
}