summaryrefslogtreecommitdiff
blob: df8f60e0946b701fac4e42add63982883585669c (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/xstream/xstream-1.3.1.ebuild,v 1.3 2009/04/20 20:22:53 maekke Exp $

EAPI=1
JAVA_PKG_IUSE="doc java5 source test"

inherit java-pkg-2 java-ant-2

DESCRIPTION="A text-processing Java classes that serialize objects to XML and back again."
HOMEPAGE="http://xstream.codehaus.org/index.html"
SRC_URI="http://repository.codehaus.org/com/thoughtworks/${PN}/${PN}-distribution/${PV}/${PN}-distribution-${PV}-src.zip"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"

IUSE=""

COMMON_DEPS="
	dev-java/cglib:2.1
	dev-java/dom4j:1
	dev-java/jdom:1.0
	dev-java/joda-time:0
	dev-java/xom:0
	dev-java/xpp3:0
	dev-java/xml-commons-external:1.3
	dev-java/jettison:0
	java-virtuals/stax-api
	test? (
		dev-java/junit:0
		dev-java/xml-writer:0
		dev-java/commons-lang:2.1
		dev-java/jmock:1.0
		dev-java/jakarta-oro:2.0
		dev-java/stax:0
		dev-java/wstx:3.2
	)"

DEPEND="
	java5? ( >=virtual/jdk-1.5 )
	!java5? ( >=virtual/jdk-1.4 )
	app-arch/unzip
	${COMMON_DEPS}"
RDEPEND="
	java5? ( >=virtual/jre-1.5 )
	!java5? ( >=virtual/jre-1.4 )
	${COMMON_DEPS}"

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

JAVA_ANT_REWRITE_CLASSPATH="true"

src_unpack() {
	unpack ${A}
	cd "${S}/lib"
	rm -v *.jar || die
	rm -rf jdk1.3 || die
}

EANT_GENTOO_CLASSPATH="xpp3,jdom-1.0,xom,dom4j-1,joda-time,cglib-2.1
xml-commons-external-1.3,jettison,stax-api"

EANT_BUILD_TARGET="benchmark:compile jar"
EANT_EXTRA_ARGS="-Dversion=${PV}"

src_test(){
	EANT_GENTOO_CLASSPATH="${EANT_GENTOO_CLASSPATH}
		junit,jmock-1.0,commons-lang-2.1,xml-writer,wstx-3.2,stax,jakarta-oro-2.0" \
		ANT_TASKS="ant-junit ant-trax" eant test || die "Tests failed"
}

src_install(){
	java-pkg_newjar target/${P}.jar
	java-pkg_newjar target/${PN}-benchmark-${PV}.jar ${PN}-benchmark.jar

	use doc && java-pkg_dojavadoc target/javadoc
	use source && java-pkg_dosrc src/java/com
}

pkg_postinst(){
	elog "Major Changes from 1.2 See:"
	elog "http://xstream.codehaus.org/changes.html"
	elog "to prevent breakage ..."
}