summaryrefslogtreecommitdiff
blob: 0f301ce780b7e9d7afcd9a874b91a48b5723eab7 (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
59
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/xmlunit/xmlunit-1.0-r2.ebuild,v 1.2 2007/05/07 16:56:01 caster Exp $

JAVA_PKG_IUSE="doc source test"
inherit java-pkg-2 java-ant-2

DESCRIPTION="XMLUnit extends JUnit and NUnit to enable unit testing of XML."
SRC_URI="mirror://sourceforge/${PN}/${P/-/}.zip"
HOMEPAGE="http://xmlunit.sourceforge.net/"
LICENSE="BSD"
SLOT="1"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""
# We depend on jdk-1.4 as tests fail with jdk > 1.4
# see http://sourceforge.net/tracker/index.php?func=detail&aid=1614984&group_id=23187&atid=377768
# Also docs cannot be built with jdk > 1.5
CDEPEND="=dev-java/junit-3*"
DEPEND="=virtual/jdk-1.4*
	app-arch/unzip
	test? (
		dev-java/ant-junit
		dev-java/ant-trax
	)
	${CDEPEND}"
RDEPEND="=virtual/jre-1.4*
	${CDEPEND}"

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

src_unpack() {
	unpack ${A}
	cd "${S}"

	epatch "${FILESDIR}/${PN}-${PVR}-build.xml.patch"
	rm -v ${S}/lib/*.jar || die
	
	java-ant_rewrite-classpath
}

EANT_DOC_TARGET="docs"
EANT_GENTOO_CLASSPATH="junit"

src_test() {
	ANT_TASKS="ant-junit ant-trax" eant test
}

src_install() {
	java-pkg_newjar lib/${PN}${PV}.jar

	dodoc README.txt
	use doc && java-pkg_dojavadoc doc
	use source && java-pkg_dosrc src/java/org
}

pkg_postinst() {
	elog "Please note that ${PN} has some problems with JDKs > 1.4. For details see:"
	elog "http://sourceforge.net/tracker/index.php?func=detail&aid=1614984&group_id=23187&atid=377768"
}