Bug 57956 - New port: java/eclipse-pmd plugin
Summary: New port: java/eclipse-pmd plugin
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Pete Fritchman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-13 16:30 UTC by Bruno Van Den Bossche
Modified: 2004-01-10 04:15 UTC (History)
1 user (show)

See Also:


Attachments
pmd-port (4.76 KB, text/plain)
2003-10-13 16:30 UTC, Bruno Van Den Bossche
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Van Den Bossche 2003-10-13 16:30:10 UTC
	
	New port: PMD PMD scans Java source code and looks
	for potential problems.  PMD has plugins for multiple
	editors and IDE's.  This is the version for eclipse.
Comment 1 Pete Fritchman freebsd_committer freebsd_triage 2004-01-06 06:47:05 UTC
State Changed
From-To: open->feedback

How about we make the version 1.1.2, and replace 1.1.2 with ${PORTVERSION} 
in the Makefile and %%VERSION%% (with a PLIST_SUB) in pkg-plist?
Comment 2 Bruno Van Den Bossche 2004-01-07 10:42:26 UTC
Pete Fritchman <petef@FreeBSD.org> wrote:

> Synopsis: New port: java/eclipse-pmd plugin
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: petef
> State-Changed-When: Tue Jan 6 00:47:05 CST 2004
> State-Changed-Why: 
> How about we make the version 1.1.2, and replace 1.1.2 with
> ${PORTVERSION}

Done.

> in the Makefile and %%VERSION%% (with a PLIST_SUB) in pkg-plist?

I've added a variable PLUGIN_DIR for use in the do-install subsection,
and the PLIST_SUB variable.
It seemed an appropriate change.

> http://www.freebsd.org/cgi/query-pr.cgi?pr=57956

I wasn't sure if I needed to just reply to this mail or submit a
follow-up to the PR so I just replied to this mail.  (Feel free to
point me in the right direction if I was wrong)


The adjusted shar:


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	eclipse-pmd
#	eclipse-pmd/pkg-descr
#	eclipse-pmd/distinfo
#	eclipse-pmd/Makefile
#	eclipse-pmd/pkg-plist
#
echo c - eclipse-pmd
mkdir -p eclipse-pmd > /dev/null 2>&1
echo x - eclipse-pmd/pkg-descr
sed 's/^X//' >eclipse-pmd/pkg-descr << 'END-of-eclipse-pmd/pkg-descr'
XPMD scans Java source code and looks for potential problems like:
X
X    * Unused local variables
X    * Empty catch blocks
X    * Unused parameters
X    * Empty 'if' statements
X    * Duplicate import statements
X    * Unused private methods
X    * Classes which could be Singletons
X    * Short/long variable and method names
X
XWWW: http://pmd.sourceforge.net/
END-of-eclipse-pmd/pkg-descr
echo x - eclipse-pmd/distinfo
sed 's/^X//' >eclipse-pmd/distinfo << 'END-of-eclipse-pmd/distinfo'
XMD5 (eclipse/pmd-eclipse-bin-1.1.2.zip) = cd46079fc6c98e4bc6ff2586eb654353
END-of-eclipse-pmd/distinfo
echo x - eclipse-pmd/Makefile
sed 's/^X//' >eclipse-pmd/Makefile << 'END-of-eclipse-pmd/Makefile'
X# New ports collection makefile for:	eclipse-pmd
X# Date created:				October 3, 2003
X# Whom:					bruno.van.den.bossche@pandora.be
X#
X# $FreeBSD$
X#
X
XPORTNAME=	eclipse-pmd
XPORTVERSION=	1.1.2
XCATEGORIES=	java devel
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	pmd
XDISTNAME=	pmd-eclipse-bin-${PORTVERSION}
XDIST_SUBDIR=	eclipse
X
XMAINTAINER=	ports@FreeBSD.ORG
XCOMMENT=	PMD scans Java source code and looks for potential problems
X
XNO_BUILD=	yes
XNO_WRKSUBDIR=	yes
XUSE_ZIP=	yes
X
XPLUGIN_DIR=	"net.sourceforge.pmd.eclipse_${PORTVERSION}"
X
XPLIST_SUB+=	PLUGIN_DIR="${PLUGIN_DIR}"
X
Xdo-install:
X		@${MKDIR} ${PREFIX}/eclipse
X		@${MKDIR} ${PREFIX}/eclipse/plugins
X		@${MKDIR} ${PREFIX}/eclipse/plugins/${PLUGIN_DIR}
X		@${CP} -r ${WRKSRC}/${PLUGIN_DIR} ${PREFIX}/eclipse/plugins
X
X.include <bsd.port.mk>
END-of-eclipse-pmd/Makefile
echo x - eclipse-pmd/pkg-plist
sed 's/^X//' >eclipse-pmd/pkg-plist << 'END-of-eclipse-pmd/pkg-plist'
Xeclipse/plugins/%%PLUGIN_DIR%%/CHANGELOG.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/LICENSE.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/README.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/RELNOTES.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/TODO.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/build.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/doc.zip
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/error.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/file.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/info.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/pmd-icon-16.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/pmd-icon-32.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_1.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_2.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_3.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_4.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_5.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prj.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/remvio.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/warn.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/commons-logging.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/jaxen-core-1.0-fcs.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/log4j-1.2.8.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/pmd-1.2.1.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/saxpath-1.0-fcs.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/log4j.xml
Xeclipse/plugins/%%PLUGIN_DIR%%/messages.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/nl/fr/messages.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/plugin.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/plugin.xml
Xeclipse/plugins/%%PLUGIN_DIR%%/plugin_fr.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/pmd-eclipse.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/toc.xml
Xshare/nls/POSIX
Xshare/nls/en_US.US-ASCII
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/nl/fr
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/nl
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/lib
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/icons
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%
X@unexec rmdir %D/eclipse/plugins 2>/dev/null || true
X@unexec rmdir %D/eclipse/features 2>/dev/null || true
X@unexec rmdir %D/eclipse 2>/dev/null || true
END-of-eclipse-pmd/pkg-plist
exit


-- 
Bruno

Anthony's Law of Force:
	Don't force it; get a larger hammer.
Comment 3 petef 2004-01-08 04:14:30 UTC
* Wed, 07 Jan 2004 11:42:26 +0100 - Bruno Van Den Bossche:
| > http://www.freebsd.org/cgi/query-pr.cgi?pr=57956
| 
| I wasn't sure if I needed to just reply to this mail or submit a
| follow-up to the PR so I just replied to this mail.  (Feel free to
| point me in the right direction if I was wrong)

Yeah, cc:'ing freebsd-gnats-submit@freebsd.org (or bug-followup@freebsd.org,
same deal, different name) is good to get the conversation into the
audit-trail of the PR.

| The adjusted shar:

Ok.  A few more things I missed while looking through the first time:

* Do we have to install stuff into ${PREFIX}/eclipse?  How about ${DATADIR}?
* using ${CP} -R might have bad side effects.  perhaps cpio, like some other
  ports?

Other than that, we're looking good!

Thanks,

--pete
Comment 4 Pete Fritchman freebsd_committer freebsd_triage 2004-01-08 04:14:36 UTC
Responsible Changed
From-To: freebsd-ports-bugs->petef

I'll follow-up on this.
Comment 5 Bruno Van Den Bossche 2004-01-08 10:24:24 UTC
Pete Fritchman <petef@absolutbsd.org> wrote:

> * Wed, 07 Jan 2004 11:42:26 +0100 - Bruno Van Den Bossche:
> | > http://www.freebsd.org/cgi/query-pr.cgi?pr=57956

> | The adjusted shar:
> 
> Ok.  A few more things I missed while looking through the first time:
> 
> * Do we have to install stuff into ${PREFIX}/eclipse?  How about
> ${DATADIR}?

With DATADIR=	"${PREFIX}/eclipse" ?
If not, I'm not sure what you mean.

> * using ${CP} -R might have bad side effects.  perhaps cpio, like some
> other ports?

I originally made the port using eclipse-gef as an example, which also
uses ${CP} -R.  Should the maintainer be notified?

Changed, although I wasn't completely sure what variables for uid and
gid had to be used.
Some ports use an absolute path when defining CPIO.  Is there a reason
for this?  Because doing so gives me a warning when running portlint on
the port.

> Other than that, we're looking good!

Great, thanks!

updated shar:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	eclipse-pmd
#	eclipse-pmd/pkg-descr
#	eclipse-pmd/distinfo
#	eclipse-pmd/Makefile
#	eclipse-pmd/pkg-plist
#
echo c - eclipse-pmd
mkdir -p eclipse-pmd > /dev/null 2>&1
echo x - eclipse-pmd/pkg-descr
sed 's/^X//' >eclipse-pmd/pkg-descr << 'END-of-eclipse-pmd/pkg-descr'
XPMD scans Java source code and looks for potential problems like:
X
X    * Unused local variables
X    * Empty catch blocks
X    * Unused parameters
X    * Empty 'if' statements
X    * Duplicate import statements
X    * Unused private methods
X    * Classes which could be Singletons
X    * Short/long variable and method names
X
XWWW: http://pmd.sourceforge.net/
END-of-eclipse-pmd/pkg-descr
echo x - eclipse-pmd/distinfo
sed 's/^X//' >eclipse-pmd/distinfo << 'END-of-eclipse-pmd/distinfo'
XMD5 (eclipse/pmd-eclipse-bin-1.1.2.zip) = cd46079fc6c98e4bc6ff2586eb654353
END-of-eclipse-pmd/distinfo
echo x - eclipse-pmd/Makefile
sed 's/^X//' >eclipse-pmd/Makefile << 'END-of-eclipse-pmd/Makefile'
X# New ports collection makefile for:	eclipse-pmd
X# Date created:				October 3, 2003
X# Whom:					bruno.van.den.bossche@pandora.be
X#
X# $FreeBSD$
X#
X
XPORTNAME=	eclipse-pmd
XPORTVERSION=	1.1.2
XCATEGORIES=	java devel
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	pmd
XDISTNAME=	pmd-eclipse-bin-${PORTVERSION}
XDIST_SUBDIR=	eclipse
X
XMAINTAINER=	ports@FreeBSD.ORG
XCOMMENT=	PMD scans Java source code and looks for potential problems
X
XNO_BUILD=	yes
XNO_WRKSUBDIR=	yes
XUSE_ZIP=	yes
X
XCPIO?=		cpio --quiet -pdmu -R
X
XPLUGIN_DIR=	"net.sourceforge.pmd.eclipse_${PORTVERSION}"
XDATADIR=	"${PREFIX}/eclipse"
X
XPLIST_SUB+=	PLUGIN_DIR="${PLUGIN_DIR}"
X
Xdo-install:
X		@${MKDIR} ${DATADIR}
X		@${MKDIR} ${DATADIR}/plugins
X		@${MKDIR} ${DATADIR}/plugins/${PLUGIN_DIR}
X		cd ${WRKSRC}/${PLUGIN_DIR} && ${FIND} . \
X		  | ${CPIO} ${SHAREOWN}:${SHAREGRP} \
X		  ${DATADIR}/plugins/${PLUGIN_DIR}
X
X.include <bsd.port.mk>
END-of-eclipse-pmd/Makefile
echo x - eclipse-pmd/pkg-plist
sed 's/^X//' >eclipse-pmd/pkg-plist << 'END-of-eclipse-pmd/pkg-plist'
Xeclipse/plugins/%%PLUGIN_DIR%%/CHANGELOG.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/LICENSE.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/README.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/RELNOTES.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/TODO.txt
Xeclipse/plugins/%%PLUGIN_DIR%%/build.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/doc.zip
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/error.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/file.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/info.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/pmd-icon-16.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/pmd-icon-32.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_1.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_2.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_3.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_4.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prio_5.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/prj.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/remvio.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/icons/warn.gif
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/commons-logging.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/jaxen-core-1.0-fcs.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/log4j-1.2.8.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/pmd-1.2.1.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/lib/saxpath-1.0-fcs.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/log4j.xml
Xeclipse/plugins/%%PLUGIN_DIR%%/messages.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/nl/fr/messages.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/plugin.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/plugin.xml
Xeclipse/plugins/%%PLUGIN_DIR%%/plugin_fr.properties
Xeclipse/plugins/%%PLUGIN_DIR%%/pmd-eclipse.jar
Xeclipse/plugins/%%PLUGIN_DIR%%/toc.xml
Xshare/nls/POSIX
Xshare/nls/en_US.US-ASCII
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/nl/fr
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/nl
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/lib
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%/icons
X@dirrm eclipse/plugins/%%PLUGIN_DIR%%
X@unexec rmdir %D/eclipse/plugins 2>/dev/null || true
X@unexec rmdir %D/eclipse/features 2>/dev/null || true
X@unexec rmdir %D/eclipse 2>/dev/null || true
END-of-eclipse-pmd/pkg-plist
exit



-- 
Bruno

Every creature has within him the wild, uncontrollable urge to punt.
Comment 6 petef 2004-01-09 03:31:18 UTC
* Fri, 09 Jan 2004 00:28:06 +0100 - Bruno Van Den Bossche:
| In that case, yes it needs to be installed into ${PREFIX}/eclipse
| This port is a plugin for eclipse, and plugins have to be installed in
| the eclipse/plugins-dir

Ah, ok.  Should we depend on eclipse?  It looks like this port wouldn't
do much good without eclipse itself.

| Thus I assume the DATADIR variable should remain unchanged.

Correct.

| for completeness the port is adjusted and the shar inserted.  I believe
| this should be the last change then?

I think we're really close. :-)

Thanks,

--pete
Comment 7 Bruno Van Den Bossche 2004-01-09 10:56:29 UTC
Pete Fritchman <petef@absolutbsd.org> wrote:

> * Fri, 09 Jan 2004 00:28:06 +0100 - Bruno Van Den Bossche:
> | In that case, yes it needs to be installed into ${PREFIX}/eclipse
> | This port is a plugin for eclipse, and plugins have to be installed
> | in the eclipse/plugins-dir
> 
> Ah, ok.  Should we depend on eclipse?  It looks like this port
> wouldn't do much good without eclipse itself.

I don't think the port should depend on eclipse, since it can be run
standalone.  Basicly this plugin-version adds the necessary hooks for
eclipse to use it as a plugin.  Not preventing it to be used without
eclipse.

Thanks for helping me through the process.

-- 
Bruno

Oh, wow!  Look at the moon!
Comment 8 Pete Fritchman freebsd_committer freebsd_triage 2004-01-10 04:14:59 UTC
State Changed
From-To: feedback->closed

New port added, thanks!