summaryrefslogtreecommitdiff
blob: 0c0896df34dad0e6aa2021ac957cb4a2ef9c3cdf (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-java/joda-time/joda-time-1.4.ebuild,v 1.5 2007/03/11 00:02:49 betelgeuse Exp $

inherit java-pkg-2 java-ant-2

MY_P="${P}-src"

DESCRIPTION="A quality open-source replacement for the Java Date and Time classes."
HOMEPAGE="http://joda-time.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="doc source test"

COMMON_DEP="
	elibc_glibc? ( >=sys-libs/timezone-data-2007c )
"

DEPEND=">=virtual/jdk-1.4
	source? ( app-arch/zip )
	test? (
		dev-java/junit
		dev-java/ant
	)
	${COMMON_DEP}"
RDEPEND=">=virtual/jre-1.4
	${COMMON_DEP}"

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

src_unpack() {
	unpack ${A}
	cd "${S}"
	rm -v ${P}.jar
}

src_compile() {
	# chokes on static inner class making instance of non-static inner class
	java-pkg_filter-compiler jikes
	# little trick so it doesn't try to download junit
	eant -Djunit.ant=1 -Djunit.present=1 jar $(use_doc)
}

src_test() {
	if has_version "<sys-libs/timezone-data-2007c"; then
		ewarn "Tests are known to fail with older versions of"
		ewarn "sys-libs/timezone-data. Please update to the latest stable"
		ewarn "version. We don't force it because not all libc"
		ewarn "implementations use that package. See bugzilla for details:"
		ewarn "https://bugs.gentoo.org/show_bug.cgi?id=170189"
	fi

	eant -Djunit.jar="$(java-pkg_getjars junit)" test
}

src_install() {
	java-pkg_newjar build/${P}.jar ${PN}.jar

	dodoc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt ToDo.txt
	use doc && java-pkg_dojavadoc build/docs
	use source && java-pkg_dosrc src/java
}