summaryrefslogtreecommitdiff
blob: 17153ec4366a201f47cdac486f7058fd923008f7 (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
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

MY_P="JDOM-${PV}"
JAVA_PKG_IUSE="doc source"

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

DESCRIPTION="Java API to manipulate XML data"
SRC_URI="https://github.com/hunterhacker/${PN}/archive/${MY_P}.tar.gz"
HOMEPAGE="http://www.jdom.org"
LICENSE="Apache-1.1"
SLOT="2"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="test"

CDEPEND="dev-java/iso-relax:0
	dev-java/jaxen:1.1
	dev-java/xalan:0"

RDEPEND="${CDEPEND}
	>=virtual/jre-1.6"

DEPEND="${CDEPEND}
	>=virtual/jdk-1.6
	test? ( dev-java/ant-junit:0 )"

JAVA_ANT_REWRITE_CLASSPATH="true"
EANT_BUILD_TARGET="jars"
EANT_TEST_TARGET="junit"
EANT_GENTOO_CLASSPATH="iso-relax,jaxen-1.1,xalan"
S="${WORKDIR}/${PN}-${MY_P}"

java_prepare() {
	epatch "${FILESDIR}/build-xml-2.patch"
	find -name "*.jar" -delete || die

	# Remove Android stuff to avoid junit RDEPEND.
	rm -vr contrib/src/java/org/jdom2/contrib/android || die
}

src_install() {
	java-pkg_newjar build/package/${PN}-${SLOT}.x-????.??.??.??.??.jar ${PN}.jar
	java-pkg_newjar build/package/${PN}-${SLOT}.x-????.??.??.??.??-contrib.jar ${PN}-contrib.jar

	dodoc {CHANGES,COMMITTERS,README,TODO}.txt
	use doc && java-pkg_dojavadoc build/apidocs
	use source && java-pkg_dosrc {contrib,core}/src/java/*
}

src_test() {
	java-pkg-2_src_test
}