This is an old revision of the document!


My wishlist of Java related checks in portlint

I am no Perl hacker nor I have time to learn Perl for now. Still there are many Java related sanity checks that could be performed by portlint. I will list them here just in case some volunteer shows up…

WHEN: !defined(USE_JAVA) && (defined(JAVA_VERSION) || defined(JAVA_OS) || defined(JAVA_VENDOR) || defined(USE_ANT) || defined(JAVA_RUN) || defined(JAVA_BUILD) || defined(USE_JIKES))

LEVEL: Critical

MESSAGE: The port uses Java features but USE_JAVA is not defined.

WHEN: defined(USE_ANT) && defined(USE_GMAKE)

LEVEL: Warning

MESSAGE: A port shall not define both USE_ANT and USE_GMAKE.

WHEN: defined(USE_ANT) && target(do-build)

LEVEL: Critical

MESSAGE: USE_ANT is intended only for ports that build with Ant. You should not override 'do-build' when also defining USE_ANT.

WHEN: defined(USE_JAVA) && "${CATEGORIES:Mjava}"==""

LEVEL: Warning

MESSAGE: The port uses Java but is not part of the 'java' category.

WHEN: "${CATEGORIES:Mjava}" == "${CATEGORIES}"

LEVEL: Critical

MESSAGE: The java category shall not be the only one for a port.

WHEN: echo “${CATEGORIES}” | grep -q '^java'

LEVEL: Warning

MESSAGE: Save for ports directly related to the Java language, porters are also encouraged not to use java as the main category of a port.

NOTE: This check is only to be performed for new ports

WHEN: defined(NO_BUILD) && defined(JAVA_BUILD)

LEVEL: Critical

MESSAGE: JAVA_BUILD and NO_BUILD cannot be set at the same time.

NOTE: This check is already performed by bsd.java.mk but I would prefer it to be in portlint to speedup index build (and cleanup bsd.*.mk).

WHEN: grep -q '\${PREFIX}/share/java/classes' Makefile

LEVEL: Critical

MESSAGE: You should use ${JAVAJARDIR} rather than ${PREFIX}/share/java/classes

WHEN: grep -q '\${PREFIX}/share/java' Makefile

LEVEL: Critical

MESSAGE: You should use ${JAVASHAREDIR} rather than ${PREFIX}/share/java

WHEN: make PREFIX=XXX -V BUILD_DEPENDS -V RUN_DEPENDS | grep -q 'XXX/share/java/classes'

LEVEL: Critical

MESSAGE: You should use ${JAVALIBDIR} in BUILD_DEPENDS/RUN_DEPENDS to define dependencies on JAR files installed in ${JAVAJARDIR}.

WHEN: grep -q 'javavm' ${FILESDIR}/*

LEVEL: Warning

MESSAGE: Since javavmwrapper 2.0, the 'javavm' command to invoke a JVM is deprecated. Use 'java' instead.


Now that 1.0 syntax support, was removed from bsd.java.mk, here is a set of new tests to be performed by portlint:

WHEN: USE_JAVA is not of the form 1\.[0-9]+?( 1\.[0-9]+?)* (e.g. “1.2”, “1.1 1.4+”, “1.1 1.2 1.3 1.4”)

LEVEL: Critical

MESSAGE: USE_JAVA should be of the form 1.[0-9]+?( 1\.[0-9]+?)*

WHEN: pkg-plist contains share/java/classes

LEVEL: Critical

MESSAGE: Consider using %%JAVAJARDIR%% rather than “share/java/classes” in pkg-plist

WHEN: some file as ${FILESDIR}/*.sh.in contains share/java/classes

LEVEL: Warning

MESSAGE: Consider using %%JAVAJARDIR%% rather than “share/java/classes” in <filename>

  • java/portlint.1213738669.txt.gz
  • Last modified: 2008/06/17 21:37
  • by 127.0.0.1