summaryrefslogtreecommitdiff
blob: 70a328b0447e28d4cb7e651c850b10f433f9fc68 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-util/pmd/pmd-3.1.ebuild,v 1.2 2005/05/20 18:49:28 luckyduck Exp $

inherit java-pkg eutils

DESCRIPTION="PMD is a Java source code analyzer. It finds unused variables, empty catch blocks, unnecessary object creation and so forth."
HOMEPAGE="http://pmd.sourceforge.net"
SRC_URI="mirror://sourceforge/pmd/${PN}-src-${PV}.zip"

LICENSE="pmd"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~ppc ~sparc"
IUSE="doc jikes source"

DEPEND=">=virtual/jdk-1.3
	app-arch/unzip
	dev-java/ant-core
	source? ( app-arch/zip )"
RDEPEND=">=virtual/jre-1.3
	=dev-java/jaxen-1.0*
	dev-java/junit
	dev-java/saxpath
	=dev-java/xerces-2.6*"

src_unpack() {
	unpack ${A}

	cd ${S}
	epatch ${FILESDIR}/${P}-gentoo.patch

	cd ${S}/lib/
	rm -f *.jar
	java-pkg_jar-from saxpath
	java-pkg_jar-from jaxen
	java-pkg_jar-from xerces-2
}

src_compile() {
	cd ${S}/bin

	local antflags="dist"
	use jikes && antflags="${antflags} -Dbuild.compiler=jikes"
	ant ${antflags} || die "died on ant"
}

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

	newbin bin/pmd.sh pmd
	newbin bin/designer.sh pmd-designer
	cp -r rulesets ${D}/usr/share/${PN}

	use doc && java-pkg_dohtml -r docs/*
	use source && java-pkg_dosrc src/*
}

pkg_postinst() {
	einfo ""
	einfo "Various example rulesets can be found under"
	einfo "/usr/share/pmd/rulesets/"
	einfo ""
}