Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2004 14:16:26 +0200 (CEST)
From:      Herve Quiroz <hq@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        dglo@ssec.wisc.edu
Subject:   ports/73284: [PATCH] java/java-checkstyle: Install 'checkstyle' script and improvements
Message-ID:  <200410291216.i9TCGQf6064780@arabica.esil.univ-mrs.fr>
Resent-Message-ID: <200410291220.i9TCKPr6044072@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         73284
>Category:       ports
>Synopsis:       [PATCH] java/java-checkstyle: Install 'checkstyle' script and improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 29 12:20:25 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Herve Quiroz
>Release:        FreeBSD 5.2.1-RELEASE-p11 i386
>Organization:
>Environment:
System: FreeBSD arabica.esil.univ-mrs.fr 5.2.1-RELEASE-p11 FreeBSD 5.2.1-RELEASE-p11 #8: Fri Oct 15 15:12:37 CEST 2004
>Description:

- Install 'checkstyle' script [1]
- Update to bsd.java.mk 2.0
- Use USE_ANT
- Cleanup unused variables
- Do not remove JAVAJARDIR
- Remove some sed magic in dynamic plist process (make will perform most of
  these substitutions)
- Use PLIST_FILES and %%JAVAJARDIR%% to reduce plist build process
- Bumped PORTREVISION as a new file is installed

[1] Suggested by Ernst in java/43947

Added file(s):
- files/checkstyle.sh

NOTE: I was also thinking about having samples installed in ${EXAMPLESDIR} but
I'll let that to the maintainer's appreciation.

Port maintainer (dglo@ssec.wisc.edu) is cc'd.

Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:

--- java-checkstyle-3.4_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /var/fcvs/ports/java/java-checkstyle/Makefile,v
retrieving revision 1.11
diff -u -u -r1.11 Makefile
--- Makefile	2 May 2004 17:13:53 -0000	1.11
+++ Makefile	29 Oct 2004 12:06:58 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	checkstyle
 PORTVERSION=	3.4
+PORTREVISION=	1
 CATEGORIES=	java devel
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -16,59 +17,53 @@
 MAINTAINER=	dglo@ssec.wisc.edu
 COMMENT=	Java style checker
 
-BUILD_DEPENDS=	${LOCALBASE}/bin/ant:${PORTSDIR}/devel/apache-ant
+RUN_DEPENDS=	javavm:${PORTSDIR}/java/javavmwrapper
 
-USE_JAVA=	1.4+
+USE_JAVA=	yes
+JAVA_VERSION=	1.4+
+USE_ANT=	yes
+ALL_TARGET=	build.bindist
 
 PLIST=	${WRKDIR}/PLIST
 
-JAVALIBNAME=	${PORTNAME}-${PORTVERSION}
 STYLEDIR=	${JAVASHAREDIR}/${PORTNAME}
 
+PLIST_FILES=	bin/checkstyle %%JAVAJARDIR%%/${PORTNAME}.jar %%JAVAJARDIR%%/${PORTNAME}-optional.jar
 .if !defined(NOPORTDOCS)
-BUILTDOCSDIR=	${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}
-BUILTDOCS=	README LICENSE* TODO RIGHTS* docs
-PORTDOCS=	*
+BUILDDIR=	${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}
+PORTDOCS=	README LICENSE* TODO RIGHTS* docs
 .endif
 
-do-build:
-	@cd ${WRKSRC} && \
-		${SETENV} JAVA_HOME=${JAVA_HOME} ant build.bindist
+do-configure:
+	@${SED} -e 's,%%LOCALBASE%%,${LOCALBASE},g ; s,%%JAVAJARDIR%%,${JAVAJARDIR},g' \
+		${FILESDIR}/checkstyle.sh > ${WRKSRC}/checkstyle
 
 pre-install:
 	@${RM} -f ${PLIST}
 	@${TOUCH} ${PLIST}
-	@${ECHO} ${JAVAJARDIR}/${PORTNAME}.jar | \
-		${SED} "s,${PREFIX}/*,," >> ${PLIST}
-	@${ECHO} ${JAVAJARDIR}/${PORTNAME}-optional.jar | \
-		${SED} "s,${PREFIX}/*,," >> ${PLIST}
-	@${ECHO} "@unexec ${RMDIR} ${JAVAJARDIR} 2>/dev/null || true" | \
-		${SED} "s,${PREFIX}/*,," >> ${PLIST}
-	@${FIND} ${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/contrib/ \
-		-type f -print | \
-		${SED} "s,${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/contrib/,${STYLEDIR}/," | \
-		${SED} "s,${PREFIX}/*,," >> ${PLIST}
-	@${FIND} ${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/contrib/ \
-		-type d -print | ${SORT} -r | \
-		${SED} "s,${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/contrib/,${STYLEDIR}/," | \
-		${SED} -e "s,${PREFIX}/*,," -e "s,^,@dirrm ,g" >> ${PLIST}
+	@${FIND} ${BUILDDIR}/contrib/ -type f -print | \
+		${SED} "s,^${BUILDDIR}/contrib,${STYLEDIR:S,${PREFIX}/,,}," >> ${PLIST}
+	@${FIND} ${BUILDDIR}/contrib/ -type d -print | ${SORT} -r | \
+		${SED} -e "s,^${BUILDDIR}/contrib,@dirrm ${STYLEDIR:S,${PREFIX}/,,}," >> ${PLIST}
 
 do-install: do-install-jar do-install-data do-install-apidocs
+	@${INSTALL_SCRIPT} ${WRKSRC}/checkstyle ${PREFIX}/bin/checkstyle
 
 do-install-jar:
 	@${MKDIR} ${JAVAJARDIR}
-	@${INSTALL_DATA} ${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/${PORTNAME}-all-${PORTVERSION}.jar ${JAVAJARDIR}/${PORTNAME}.jar
-	@${INSTALL_DATA} ${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/${PORTNAME}-optional-${PORTVERSION}.jar ${JAVAJARDIR}/${PORTNAME}-optional.jar
+	@${INSTALL_DATA} ${BUILDDIR}/${PORTNAME}-all-${PORTVERSION}.jar ${JAVAJARDIR}/${PORTNAME}.jar
+	@${INSTALL_DATA} ${BUILDDIR}/${PORTNAME}-optional-${PORTVERSION}.jar ${JAVAJARDIR}/${PORTNAME}-optional.jar
 
 do-install-data:
 	@${MKDIR} ${STYLEDIR}
-	@${CP} -r ${WRKSRC}/target/dist/${PORTNAME}-${PORTVERSION}/contrib/* ${STYLEDIR}
+	@${CP} -r ${BUILDDIR}/contrib/* ${STYLEDIR}
+	@${CHOWN} -h -R ${SHAREOWN}:${SHAREGRP} ${STYLEDIR}
 
 do-install-apidocs:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
-.for DOCFILE in ${BUILTDOCS}
-	@${CP} -r ${BUILTDOCSDIR}/${DOCFILE} ${DOCSDIR}/
+.for DOCFILE in ${PORTDOCS}
+	@${CP} -r ${BUILDDIR}/${DOCFILE} ${DOCSDIR}/
 .endfor
 	@${CHOWN} -h -R ${SHAREOWN}:${SHAREGRP} ${DOCSDIR}
 .endif
Index: files/checkstyle.sh
===================================================================
RCS file: files/checkstyle.sh
diff -N files/checkstyle.sh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/checkstyle.sh	29 Oct 2004 12:06:12 -0000
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# $FreeBSD$
+
+%%LOCALBASE%%/bin/javavm -cp "%%JAVAJARDIR%%/checkstyle.jar:%%JAVAJARDIR%%/checkstyle-optional.jar" com.puppycrawl.tools.checkstyle.Main $@
--- java-checkstyle-3.4_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410291216.i9TCGQf6064780>