blob: 76dcf19c1d4e56da13ea79404ad0e1714e6af090 (
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
|
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
JAVA_PKG_IUSE="source test"
#JAVA_PKG_IUSE="doc source test"
inherit java-pkg-2
DESCRIPTION="Java API to manipulate XML data"
SRC_URI="http://www.jdom.org/dist/binary/${P}.zip"
HOMEPAGE="http://www.jdom.org"
LICENSE="JDOM"
SLOT="2"
KEYWORDS="amd64 ppc ppc64 x86"
COMMON_DEP="dev-java/iso-relax
dev-java/jaxen:1.1
dev-java/xalan
dev-java/xml-commons-external:1.4"
RDEPEND="${COMMON_DEP}
>=virtual/jre-1.6"
DEPEND="${COMMON_DEP}
app-arch/unzip
test? ( dev-java/junit:0 )
>=virtual/jdk-1.6"
IUSE=""
S="${WORKDIR}"
src_unpack() {
unpack ${A}
unpack ./${P}-sources.jar
}
java_prepare() {
find "${S}" -name '*.jar' -delete || die
mkdir "${S}"/classes "${S}"/docs
}
src_compile() {
find org -name "*.java" > "${T}"/src.list
local cp="$(java-pkg_getjars iso-relax,jaxen-1.1,xalan,xml-commons-external-1.4)"
if use test ; then
cp="${cp}:junit.jar"
else
sed -i 's/PerfTest/PerfTemp/' "${T}"/src.list || die "Failed to rename PerfTest"
sed -i '/test/Id' "${T}"/src.list || die "Failed to remove test classes"
sed -i 's/PerfTemp/PerfTest/' "${T}"/src.list || die "Failed to rename PerfTest"
fi
ejavac -d "${S}"/classes -cp ${cp} "@${T}"/src.list
# Disabled for the time being.
# if use doc; then
# ejavadoc -d "${S}"/docs -classpath ${cp} "@${T}"/src.list -quiet || die "javadoc failed"
# fi
cd "${S}"/classes
jar -cf "${S}"/${PN}.jar * || die "failed to create jar"
}
src_install() {
java-pkg_dojar ${PN}.jar
# Disabled for the time being.
# if use doc; then
# java-pkg_dojavadoc docs
# fi
dodoc README.txt LICENSE.txt || die
use source && java-pkg_dosrc org
}
|