summaryrefslogtreecommitdiff
blob: f79f0dded21191f3d818450814e910d604fd7008 (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
86
87
88
89
90
91
92
93
94
95
96
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
JAVA_PKG_IUSE="test doc source"

inherit java-pkg-2 java-ant-2

MY_P="commons-${PN}-dist-${PV}-beta-1-src"
JCS_CORE="commons-${PN}-core"

DESCRIPTION="A distributed caching system for server-side Java applications"
HOMEPAGE="http://commons.apache.org/jcs/"
SRC_URI="http://apache.mirrors.ovh.net/ftp.apache.org/dist/commons/${PN}/source/commons-${PN}-dist-${PV}-beta-1-src.tar.gz"

LICENSE="Apache-2.0"
SLOT="2.0"
KEYWORDS="amd64 x86"
IUSE="admin"

CDEPEND="dev-java/jisp:2.5
	dev-db/hsqldb:0
	dev-java/log4j:0
	dev-java/xmlrpc:3
	dev-java/commons-lang:0
	dev-java/commons-dbcp:0
	dev-java/commons-pool:0
	dev-java/commons-logging:0
	dev-java/commons-httpclient:3
	java-virtuals/servlet-api:3.0"

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

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

JAVA_ANT_REWRITE_CLASSPATH="true"
EANT_GENTOO_CLASSPATH="
	xmlrpc-3
	hsqldb
	jisp-2.5
	log4j
	commons-lang
	commons-pool
	commons-dbcp
	commons-logging
	commons-httpclient-3
	servlet-api-3.0
"

EANT_BUILD_XML="${JCS_CORE}/build.xml"
EANT_BUILD_TARGET="package"

java_prepare() {
	cp "${FILESDIR}/${P}-build.xml" ${JCS_CORE}/build.xml

	# Disable the velocity-tools dep.
	rm -v \
		${JCS_CORE}/src/main/java/org/apache/commons/jcs/admin/servlet/JCSAdminServlet.java

	if use test; then
		# Make use of commons-collections4 not yet packaged in Gentoo
		rm -v \
			"${JCS_CORE}"/src/test/java/org/apache/commons/jcs/utils/struct/JCSvsCommonsLRUMapPerformanceTest.java \
			"${JCS_CORE}"/src/test/java/org/apache/commons/jcs/utils/struct/LRUMapPerformanceTest.java

		# Fails for some reason.
		rm -v \
			"${JCS_CORE}"/src/test/java/org/apache/commons/jcs/auxiliary/disk/AbstractDiskCacheUnitTest.java \
			"${JCS_CORE}"/src/test/java/org/apache/commons/jcs/auxiliary/disk/LRUMapJCSUnitTest.java \
			"${JCS_CORE}"/src/test/java/org/apache/commons/jcs/engine/logging/CacheEventLoggerDebugLoggerUnitTest.java \
			"${JCS_CORE}"/src/test/java/org/apache/commons/jcs/utils/struct/DoubleLinkedListUnitTest.java
	fi
}

EANT_TEST_TARGET="test"

src_test() {
	java-pkg-2_src_test
}

src_install() {
	local target="${JCS_CORE}"/target
	java-pkg_newjar "${target}"/"${JCS_CORE}-${PV}"-beta-1.jar "${JCS_CORE}".jar

	if use doc; then
		java-pkg_dojavadoc "${target}"/site/apidocs
	fi

	if use source; then
		java-pkg_dosrc "${JCS_CORE}"/src
	fi
}