aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerve Quiroz <hq@FreeBSD.org>2006-07-12 05:28:04 +0000
committerHerve Quiroz <hq@FreeBSD.org>2006-07-12 05:28:04 +0000
commitf6fd335784be47c5ca1a64006cd2bb756f5a6263 (patch)
tree78ec005f5ce2b07296e9181bfda7f473fa340273
parent358c8cf282a69865f99dcfdce17d8bebf26a6f6f (diff)
downloadports-f6fd335784be47c5ca1a64006cd2bb756f5a6263.tar.gz
ports-f6fd335784be47c5ca1a64006cd2bb756f5a6263.zip
Notes
-rw-r--r--devel/Makefile1
-rw-r--r--devel/pmd/Makefile58
-rw-r--r--devel/pmd/distinfo3
-rw-r--r--devel/pmd/files/patch-bgastviewer.sh18
-rw-r--r--devel/pmd/files/patch-cpd.sh41
-rw-r--r--devel/pmd/files/patch-designer.sh41
-rw-r--r--devel/pmd/files/patch-pmd.sh47
-rw-r--r--devel/pmd/pkg-descr10
-rw-r--r--devel/pmd/pkg-plist11
9 files changed, 230 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index c6d676e21787..ea4be300095a 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1499,6 +1499,7 @@
SUBDIR += plan9port
SUBDIR += ply
SUBDIR += pmake
+ SUBDIR += pmd
SUBDIR += pmk
SUBDIR += popt
SUBDIR += portcheckout
diff --git a/devel/pmd/Makefile b/devel/pmd/Makefile
new file mode 100644
index 000000000000..cec2e38edc49
--- /dev/null
+++ b/devel/pmd/Makefile
@@ -0,0 +1,58 @@
+# New ports collection makefile for: pmd
+# Date created: 2006-06-07
+# Whom: Alex Varju <freebsd-ports@varju.ca>
+#
+# $FreeBSD$
+#
+
+PORTNAME= pmd
+PORTVERSION= 3.7
+CATEGORIES= devel java
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+MASTER_SITE_SUBDIR= pmd
+DISTNAME= ${PORTNAME}-src-${PORTVERSION}
+
+MAINTAINER= freebsd-ports@varju.ca
+COMMENT= Static analysis tool for Java source code
+
+BUILD_DEPENDS= ${JAVALIBDIR}/junit.jar:${PORTSDIR}/java/junit
+
+USE_ZIP= yes
+USE_JAVA= yes
+JAVA_VERSION= 1.3+
+USE_ANT= yes
+
+MAKE_ARGS= -cp ${JAVALIBDIR}/junit.jar
+
+DATADIR= ${JAVASHAREDIR}/${PORTNAME}
+
+.include <bsd.port.pre.mk>
+
+WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+BUILD_WRKSRC= ${WRKSRC}/bin
+
+.if !defined(NOPORTDOCS)
+PORTDOCS= *
+.endif
+
+do-install:
+.for script in bgastviewer.sh cpd.sh designer.sh pmd.sh
+ ${REINPLACE_CMD} -e "s|%%DATADIR%%|${DATADIR}|" \
+ -e "s|%%JAVA_VERSION%%|${JAVA_VERSION}|" \
+ -e "s|%%LOCALBASE%%|${LOCALBASE}|" \
+ ${INSTALL_WRKSRC}/bin/${script}
+.endfor
+ ${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/bin/bgastviewer.sh ${PREFIX}/bin/bgastviewer
+ ${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/bin/cpd.sh ${PREFIX}/bin/cpd
+ ${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/bin/designer.sh ${PREFIX}/bin/pmd_designer
+ ${INSTALL_SCRIPT} ${INSTALL_WRKSRC}/bin/pmd.sh ${PREFIX}/bin/pmd
+ ${MKDIR} ${DATADIR}
+ cd ${INSTALL_WRKSRC}/lib \
+ && ${FIND} . -type f -exec ${INSTALL_DATA} \{} ${DATADIR}/ \;
+.if !defined(NOPORTDOCS)
+ cd ${INSTALL_WRKSRC}/docs \
+ && ${FIND} . -type d -exec ${MKDIR} ${DOCSDIR}/\{} \; \
+ && ${FIND} . -type f -exec ${INSTALL_DATA} \{} ${DOCSDIR}/\{} \;
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/devel/pmd/distinfo b/devel/pmd/distinfo
new file mode 100644
index 000000000000..3b649c89c608
--- /dev/null
+++ b/devel/pmd/distinfo
@@ -0,0 +1,3 @@
+MD5 (pmd-src-3.7.zip) = 0d4390017f2467345ca7b91b1437fef9
+SHA256 (pmd-src-3.7.zip) = a35de76cd8049fd91b3c4e2031b7b03f849e03e2facba1e32ea1cb27cacdb5ff
+SIZE (pmd-src-3.7.zip) = 10756798
diff --git a/devel/pmd/files/patch-bgastviewer.sh b/devel/pmd/files/patch-bgastviewer.sh
new file mode 100644
index 000000000000..de89ce0ce5ad
--- /dev/null
+++ b/devel/pmd/files/patch-bgastviewer.sh
@@ -0,0 +1,18 @@
+$FreeBSD$
+
+. Use JARs from ${DATADIR}
+. Use javavmwrapper
+
+--- bin/bgastviewer.sh.orig Fri May 26 05:37:58 2006
++++ bin/bgastviewer.sh Fri Jul 7 21:46:32 2006
+@@ -1 +1,9 @@
+-java -cp ../build:../lib/jakarta-oro-2.0.8.jar:../lib/pmd-3.7.jar:../lib/xercesImpl-2.6.2.jar:../lib/xmlParserAPIs-2.6.2.jar:../lib/jaxen-1.1-beta-7.jar net.sourceforge.pmd.util.viewer.Viewer
++#!/bin/sh
++
++JARS=`/bin/ls -1 %%DATADIR%%/*jar`
++CLASSPATH=""
++for jar in $JARS; do
++ CLASSPATH="$CLASSPATH:$jar"
++done
++
++JAVA_VERSION="%%JAVA_VERSION%%" exec "%%LOCALBASE%%/bin/java" -cp $CLASSPATH net.sourceforge.pmd.util.viewer.Viewer
diff --git a/devel/pmd/files/patch-cpd.sh b/devel/pmd/files/patch-cpd.sh
new file mode 100644
index 000000000000..e26966e52dc1
--- /dev/null
+++ b/devel/pmd/files/patch-cpd.sh
@@ -0,0 +1,41 @@
+$FreeBSD$
+
+. Use JARs from ${DATADIR}
+. Use javavmwrapper
+
+--- bin/cpd.sh.orig Mon Apr 17 23:28:11 2006
++++ bin/cpd.sh Tue Jul 11 07:47:13 2006
+@@ -20,26 +20,8 @@
+ exit 1
+ fi
+
+-
+-SCRIPT_DIR=`dirname $0`
+-CWD="$PWD"
+-
+-cd "$SCRIPT_DIR/../lib"
+-LIB_DIR=`pwd -P`
+-
+ classpath=$CLASSPATH
+-
+-build_dir="$SCRIPT_DIR/../build"
+-
+-if [ -d "$build_dir" ]; then
+- cd "$build_dir"
+- build_dir=`pwd -P`
+- classpath=$classpath:$build_dir
+-fi
+-
+-cd "$CWD"
+-
+-for jarfile in `ls $LIB_DIR/*.jar`; do
++for jarfile in `ls %%DATADIR%%/*.jar`; do
+ classpath=$classpath:$jarfile
+ done
+
+@@ -62,4 +44,4 @@
+
+ # echo "CLASSPATH: $classpath"
+
+-java $HEAPSIZE -cp $classpath net.sourceforge.pmd.cpd.CPD --minimum-tokens $MINIMUM_TOKENS --files $DIRECTORY --language $LANGUAGE
++JAVA_VERSION="%%JAVA_VERSION%%" exec "%%LOCALBASE%%/bin/java" $HEAPSIZE -cp $classpath net.sourceforge.pmd.cpd.CPD --minimum-tokens $MINIMUM_TOKENS --files $DIRECTORY --language $LANGUAGE
diff --git a/devel/pmd/files/patch-designer.sh b/devel/pmd/files/patch-designer.sh
new file mode 100644
index 000000000000..563f15a132bd
--- /dev/null
+++ b/devel/pmd/files/patch-designer.sh
@@ -0,0 +1,41 @@
+$FreeBSD$
+
+. Use /bin/sh rather than /bin/bash
+. Use JARs from ${DATADIR}
+. Use javavmwrapper
+
+--- bin/designer.sh.orig Fri Jan 28 17:13:49 2005
++++ bin/designer.sh Tue Jul 11 08:00:06 2006
+@@ -1,24 +1,7 @@
+-#!/bin/bash
+-
+-SCRIPT_DIR=`dirname $0`
+-CWD="$PWD"
+-
+-cd "$SCRIPT_DIR/../lib"
+-LIB_DIR=`pwd -P`
++#!/bin/sh
+
+ classpath=$CLASSPATH
+-
+-build_dir="$SCRIPT_DIR/../build"
+-
+-if [ -d "$build_dir" ]; then
+- cd "$build_dir"
+- build_dir=`pwd -P`
+- classpath=$classpath:$build_dir
+-fi
+-
+-cd "$CWD"
+-
+-for jarfile in `ls $LIB_DIR/*.jar`; do
++for jarfile in `ls %%DATADIR%%/*.jar`; do
+ classpath=$classpath:$jarfile
+ done
+
+@@ -31,4 +14,4 @@
+
+ # echo "CLASSPATH: $classpath"
+
+-java -cp $classpath net.sourceforge.pmd.util.designer.Designer
++JAVA_VERSION="%%JAVA_VERSION%%" exec "%%LOCALBASE%%/bin/java" -cp $classpath net.sourceforge.pmd.util.designer.Designer
diff --git a/devel/pmd/files/patch-pmd.sh b/devel/pmd/files/patch-pmd.sh
new file mode 100644
index 000000000000..0bcdf128e96e
--- /dev/null
+++ b/devel/pmd/files/patch-pmd.sh
@@ -0,0 +1,47 @@
+$FreeBSD$
+
+. Use /bin/sh rather than /bin/bash
+. Use JARs from ${DATADIR}
+. Use javavmwrapper
+
+--- bin/pmd.sh.orig Fri Jan 28 17:13:49 2005
++++ bin/pmd.sh Tue Jul 11 08:00:10 2006
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ if [ -z "$3" ]; then
+ script=`basename $0`
+@@ -7,25 +7,8 @@
+ exit 1
+ fi
+
+-SCRIPT_DIR=`dirname $0`
+-CWD="$PWD"
+-
+-cd "$SCRIPT_DIR/../lib"
+-LIB_DIR=`pwd -P`
+-
+ classpath=$CLASSPATH
+-
+-build_dir="$SCRIPT_DIR/../build"
+-
+-if [ -d "$build_dir" ]; then
+- cd "$build_dir"
+- build_dir=`pwd -P`
+- classpath=$classpath:$build_dir
+-fi
+-
+-cd "$CWD"
+-
+-for jarfile in `ls $LIB_DIR/*.jar`; do
++for jarfile in `ls %%DATADIR%%/*.jar`; do
+ classpath=$classpath:$jarfile
+ done
+
+@@ -38,4 +21,4 @@
+
+ # echo "CLASSPATH: $classpath"
+
+-java -cp $classpath net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES
++JAVA_VERSION="%%JAVA_VERSION%%" exec "%%LOCALBASE%%/bin/java" -cp $classpath net.sourceforge.pmd.PMD $FILE $FORMAT $RULESETFILES
diff --git a/devel/pmd/pkg-descr b/devel/pmd/pkg-descr
new file mode 100644
index 000000000000..2838dd145b4d
--- /dev/null
+++ b/devel/pmd/pkg-descr
@@ -0,0 +1,10 @@
+PMD scans Java source code and looks for potential problems like:
+
+ * Possible bugs - empty try/catch/finally/switch statements
+ * Dead code - unused local variables, parameters and private methods
+ * Suboptimal code - wasteful String/StringBuffer usage
+ * Overcomplicated expressions - unnecessary if statements, for loops
+ that could be while loops
+ * Duplicate code - copied/pasted code means copied/pasted bugs
+
+WWW: http://pmd.sourceforge.net/
diff --git a/devel/pmd/pkg-plist b/devel/pmd/pkg-plist
new file mode 100644
index 000000000000..0ee5d5aac4a3
--- /dev/null
+++ b/devel/pmd/pkg-plist
@@ -0,0 +1,11 @@
+bin/bgastviewer
+bin/cpd
+bin/pmd
+bin/pmd_designer
+%%DATADIR%%/jakarta-oro-2.0.8.jar
+%%DATADIR%%/jaxen-1.1-beta-7.jar
+%%DATADIR%%/pmd-3.7.jar
+%%DATADIR%%/pmd-src-3.7.jar
+%%DATADIR%%/xercesImpl-2.6.2.jar
+%%DATADIR%%/xmlParserAPIs-2.6.2.jar
+@dirrm %%DATADIR%%