Annotation of pkgsrc/mk/java-env.mk, revision 1.1

1.1     ! jmmv        1: # $NetBSD$
        !             2: #
        !             3: # This Makefile fragment handles Java wrappers and is meant to be included
        !             4: # by packages that provide a Java build-time and/or run-time environment.
        !             5: #
        !             6: # The following variables can be defined in package Makefiles to tune the
        !             7: # behavior of this file:
        !             8: #
        !             9: #      JAVA_CLASSPATH  Classpath that will be prepended on all invocations
        !            10: #                      to this implementation.  Optional.
        !            11: #
        !            12: #      JAVA_HOME       Path to the directory holding the Java implementation.
        !            13: #                      Required.
        !            14: #
        !            15: #      JAVA_NAME       Base name of the Java implementation.  This will be
        !            16: #                      used as part of wrappers' names.  Required.
        !            17: #
        !            18: #      JAVA_UNLIMIT    List of resources to be unlimited at runtime.
        !            19: #                      Can include any of cmdsize, datasize and stacksize.
        !            20: #                      Optional.
        !            21: #
        !            22: #      JAVA_WRAPPERS   List of wrappers to be created under ${PREFIX}/bin,
        !            23: #                      pointing to binaries under ${JAVA_HOME}/bin.  The
        !            24: #                      names must match files in the later directory.
        !            25: #                      Required (if empty, the inclusion of this file is
        !            26: #                      useless).
        !            27: #
        !            28: 
        !            29: .if !defined(JAVA_ENV_MK)
        !            30: JAVA_ENV_MK=           # defined
        !            31: 
        !            32: JAVA_NAME?=            # undefined
        !            33: JAVA_HOME?=            # undefined
        !            34: JAVA_CLASSPATH?=       # empty
        !            35: JAVA_UNLIMIT?=         # empty
        !            36: JAVA_WRAPPERS?=                # empty
        !            37: 
        !            38: .for w in ${JAVA_WRAPPERS}
        !            39: 
        !            40: post-build:            ${WRKDIR}/${w}
        !            41: 
        !            42: .PHONY:                        install-java-wrapper-${w}
        !            43: post-install:          install-java-wrapper-${w}
        !            44: 
        !            45: .  if !target(${WRKDIR}/${w})
        !            46: ${WRKDIR}/${w}:
        !            47:        @${ECHO} 'Generating ${w} wrapper...'
        !            48:        @${ECHO} '#! ${SH}' >${WRKDIR}/${w}
        !            49:        @${ECHO} 'PATH=${JAVA_HOME}/bin:$${PATH}; export PATH' >>${WRKDIR}/${w}
        !            50:        @${ECHO} 'JAVA_HOME=${JAVA_HOME}; export JAVA_HOME' >>${WRKDIR}/${w}
        !            51:        @${ECHO} 'JVM_HOME=${JAVA_HOME}; export JVM_HOME' >>${WRKDIR}/${w}
        !            52: .    if !empty(JAVA_CLASSPATH)
        !            53:        @${ECHO} 'CLASSPATH=${JAVA_CLASSPATH}:$${CLASSPATH}; export CLASSPATH' \
        !            54:                >>${WRKDIR}/${w}
        !            55: .    endif
        !            56: .    for f in ${JAVA_UNLIMIT}
        !            57:        @${ECHO} '${ULIMIT_CMD_${f}}' >>${WRKDIR}/${w}
        !            58: .    endfor
        !            59: .    undef f
        !            60:        @${ECHO} '${JAVA_HOME}/bin/${w} "$$@"' >>${WRKDIR}/${w}
        !            61: .  endif
        !            62: 
        !            63: install-java-wrapper-${w}:
        !            64:        ${INSTALL_SCRIPT} ${WRKDIR}/${w} ${PREFIX}/bin/${JAVA_NAME}-${w}
        !            65: 
        !            66: .endfor
        !            67: .undef w
        !            68: 
        !            69: # Handle the ${PREFIX}/java shared directory automatically.
        !            70: USE_PKGINSTALL=                YES
        !            71: MAKE_DIRS+=            ${PREFIX}/java
        !            72: PRINT_PLIST_AWK+=      /^@dirrm java$$/ { next; }
        !            73: 
        !            74: .endif # JAVA_ENV_MK

CVSweb <webmaster@jp.NetBSD.org>