java:portlint

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_BSD_JAVA_MK_1_0)

LEVEL: Warning (but will soon be critical)

MESSAGE: The port uses bsd.java.mk 1.0 syntax. You should consider updating it to 2.0 syntax. Please refer to the Porter's handbook for further information.

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 pbe 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.

  • java/portlint.1109642188.txt.gz
  • Last modified: 2005/03/01 01:56
  • by HerveQuiroz