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_JAVA) && "${CATEGORIES:Mjava}"==""

LEVEL: Warning

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

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.txt
  • Last modified: 2017/09/18 06:51
  • by KubilayKocak