aboutsummaryrefslogtreecommitdiff
blob: 71a4d5828fd8ba124b570428389da82f30d62dd7 (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
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

JAVA_PKG_IUSE="doc source test"
inherit eutils java-pkg-2 java-ant-2

DESCRIPTION="StatSVN is a metrics-analysis tool for charting software evolution through analysis of Subversion source repositories."
HOMEPAGE="http://www.statsvn.org/"
SRC_URI="mirror://sourceforge/${PN}/${P}-source.zip"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

COMMON_DEPEND="
	>=dev-util/statcvs-0.3
	>=dev-java/backport-util-concurrent-3.0"

DEPEND=">=virtual/jdk-1.4
	app-arch/zip
	test?
	(
		=dev-java/junit-3.8*
		>=dev-java/jfreechart-1.0
		>=dev-java/jcommon-1.0
	)
	${COMMON_DEPEND}"

RDEPEND=">=virtual/jre-1.4
	>=dev-util/subversion-1.3.0
	${COMMON_DEPEND}"

EANT_GENTOO_CLASSPATH="statcvs,backport-util-concurrent"
EANT_BUILD_TARGET="dist"
JAVA_ANT_CLASSPATH_TAGS="javac java javadoc"

src_unpack() {
	unpack ${A}

	# patches tests so they do not attempt to create cache in /root/.statsvn
	#cd ${S}/tests-src/net/sf/statsvn/input
	cd "${S}" || die
	einfo "Removing bundled jars."
	find . -name "*.jar" -print -delete
	rm -r "${S}"/bin/*
	epatch "${FILESDIR}"/${P}-build.xml.patch
	epatch "${FILESDIR}"/${P}-fixstatcvsusage.patch
	java-ant_rewrite-classpath
}

src_test() {
	ewarn "Note that the tests require you to be online."
	#java-pkg_jar-from --into lib junit
	eant -Dgentoo.classpath=$(java-pkg_getjars statcvs,backport-util-concurrent):$(java-pkg_getjars --build-only junit,jfreechart-1.0,jcommon-1.0) test
}

src_install() {
	java-pkg_dojar dist/${PN}.jar

	# jfreechart pulls in gnu-jaxp which doesn't work for statsvn so we need
	# to force another SAXParserFactory and DocumentBuilderFactory
	java-pkg_dolauncher statsvn --main net.sf.statsvn.Main \
		--java_args '-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl'

	use doc && java-pkg_dojavadoc doc
	use source && java-pkg_dosrc src/*
}

pkg_postinst() {
	elog "For instractions on how to use StatSVN see"
	elog "http://svn.statsvn.org/statsvnwiki/index.php/Main_Page"
	elog "You need to regenerate statistics"
	elog "if you update dev-java/jtreemap"
}