# ChangeLog for dev-util/pmd
# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/pmd/ChangeLog,v 1.16 2006/11/30 16:06:11 caster Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/pmd/ChangeLog,v 1.17 2006/12/08 00:54:45 caster Exp $
+
+*pmd-3.8-r1 (08 Dec 2006)
+
+ 08 Dec 2006; Vlastimil Babka <caster@gentoo.org>
+ -files/pmd-3.1-gentoo.patch, -files/pmd-3.3-gentoo.patch,
+ +files/pmd-3.8-gentoo.patch, +files/pmd-pre, -pmd-3.1.ebuild,
+ -pmd-3.3.ebuild, -pmd-3.4.ebuild, +pmd-3.8-r1.ebuild:
+ Version bump, -r1 so that overlay users upgrade too. Tweaked deps, added
+ junit testing, using dolauncher and better docs handling.
30 Nov 2006; Vlastimil Babka <caster@gentoo.org> pmd-1.5-r1.ebuild,
pmd-3.1.ebuild, pmd-3.3.ebuild, pmd-3.4.ebuild, pmd-3.7.ebuild:
--- /dev/null
+MD5 49c4f6341d035173ba6a7d5d899bb2b1 pmd-src-3.8.zip 11032057
+RMD160 193a25fb5e2ab21bc31f52d667c2f9fa8eebd09b pmd-src-3.8.zip 11032057
+SHA256 a31247adbf06dd71b6e10231a92d04ca87206f214ee8d1ec59650cf2f108333a pmd-src-3.8.zip 11032057
--- /dev/null
+--- bin/build.xml 2006-12-07 17:11:47.000000000 +0100
++++ bin/build.xml 2006-12-07 17:17:13.000000000 +0100
+@@ -12,12 +12,7 @@
+
+ <path id="dependencies.path">
+ <pathelement location="${dir.build}" />
+- <fileset dir="${dir.lib}">
+- <include name="jaxen-1.1-beta-10.jar" />
+- <include name="jakarta-oro-2.0.8.jar" />
+- <include name="xercesImpl-2.6.2.jar" />
+- <include name="xmlParserAPIs-2.6.2.jar" />
+- </fileset>
++ <fileset dir="${dir.lib}" includes="*.jar"/>
+ </path>
+
+ <target name="delete" description="Deletes the build directory and the pmd-x.x jar file.">
+@@ -28,7 +23,7 @@
+
+ <target name="compile" description="Compiles the code">
+ <mkdir dir="${dir.build}" />
+- <javac deprecation="false" debug="true" optimize="false" srcdir="${dir.src}:${dir.regress}" destdir="${dir.build}">
++ <javac deprecation="false" debug="true" optimize="false" srcdir="${dir.src}" destdir="${dir.build}">
+ <classpath>
+ <path refid="dependencies.path" />
+ </classpath>
+@@ -60,7 +55,6 @@
+ <jar jarfile="${dir.lib}\pmd-${version}.jar" includes="net/sourceforge/pmd/**/**,test/net/sourceforge/pmd/testframework/**/**,rulesets/**" basedir="${dir.build}">
+ <manifest>
+ <attribute name="Main-Class" value="net.sourceforge.pmd.PMD" />
+- <attribute name="Class-Path" value="jaxen-1.1-beta-10.jar jakarta-oro-2.0.8.jar" />
+ </manifest>
+ </jar>
+ </target>
+@@ -87,7 +81,16 @@
+ <fail unless="junit.available" message="Could find JUnit... please place a junit.jar file in the CLASSPATH." />
+ </target>
+
+- <target name="test" depends="requires-junit,compile,copy" description="Runs the unit tests">
++ <target name="compile-tests" description="Compiles the test cases">
++ <mkdir dir="${dir.build}" />
++ <javac deprecation="false" debug="true" optimize="false" srcdir="${dir.regress}" destdir="${dir.build}">
++ <classpath>
++ <path refid="dependencies.path" />
++ </classpath>
++ </javac>
++ </target>
++
++ <target name="test" depends="requires-junit,compile-tests,copy" description="Runs the unit tests">
+ <junit printsummary="yes" haltonfailure="no" forkmode="perBatch">
+ <classpath>
+ <path refid="dependencies.path" />
--- /dev/null
+if [ -z "$3" ]; then
+ script=`basename $0`
+ echo "Usage:"
+ echo " $script <java-src-file> html|xml|text|vbhtml rulesetfile1[,rulesetfile2[,..]]"
+ exit 1
+fi
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/pmd/pmd-3.8-r1.ebuild,v 1.1 2006/12/08 00:54:45 caster Exp $
+
+inherit java-pkg-2 java-ant-2
+
+DESCRIPTION="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 ~ppc ~x86"
+IUSE="doc source test"
+
+CDEPEND="=dev-java/jaxen-1.1*
+ =dev-java/xml-commons-external-1.3*
+ >=dev-java/xerces-2.7
+ =dev-java/jakarta-oro-2.0*"
+RDEPEND=">=virtual/jre-1.4
+ ${CDEPEND}"
+DEPEND=">=virtual/jdk-1.4
+ app-arch/unzip
+ =dev-java/junit-3*
+ !test? ( dev-java/ant-core )
+ test? ( dev-java/ant )
+ source? ( app-arch/zip )
+ ${CDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+
+ rm -rf docs/apidocs docs/cgi docs/clover docs/xref*
+ cd lib
+ rm -f *.jar
+ java-pkg_jar-from jaxen-1.1
+ java-pkg_jar-from xerces-2 xercesImpl.jar
+ java-pkg_jar-from xml-commons-external-1.3 xml-apis.jar
+ java-pkg_jar-from --build-only ant-core ant.jar
+ java-pkg_jar-from jakarta-oro-2.0
+ java-pkg_jar-from --build-only junit
+}
+
+src_compile() {
+ cd "${S}/bin"
+ eant jar $(use_doc)
+}
+
+src_test() {
+ cd "${S}/bin"
+ eant test
+}
+
+src_install() {
+ java-pkg_newjar lib/${P}.jar
+ dodir /usr/share/ant-core/lib/
+ dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant-core/lib/${PN}.jar
+
+ java-pkg_dolauncher ${PN} --main net.sourceforge.pmd.PMD \
+ -pre "${FILESDIR}/${PN}-pre" --java_args -Xmx512m
+ java-pkg_dolauncher ${PN}-designer \
+ --main net.sourceforge.pmd.util.designer.Designer
+ cp -r rulesets ${D}/usr/share/${PN}
+
+ dodoc etc/readme.txt etc/changelog.txt
+
+ use doc && java-pkg_dohtml -r docs/*
+ use source && java-pkg_dosrc src/net
+}
+
+pkg_postinst() {
+ einfo ""
+ einfo "Example rulesets can be found under"
+ einfo "/usr/share/pmd/rulesets/"
+ einfo ""
+}