# New ports collection makefile for: jdk12 # Date created: 10 October 2000 # Whom: Maxim Sobolev # # $FreeBSD$ # PORTNAME= jdk PORTVERSION= ${JDK_VERSION}p${JDK_PATCHSET_VERSION} CATEGORIES= java devel MASTER_SITES= # http://www.sun.com/software/java2/download.html # http://www.eyesbeyond.com/freebsddom/java/jdk.html DISTFILES= ${PORTNAME}${JDK_VERSION:S/./_/g}-src${EXTRACT_SUFX} \ freebsd-jdk122-patches-${JDK_PATCHSET_VERSION}.tar.gz MAINTAINER= glewis@FreeBSD.org BUILD_DEPENDS= gm4:${PORTSDIR}/devel/m4 \ zip:${PORTSDIR}/archivers/zip \ ${JDK11DIR}/bin/javac:${PORTSDIR}/java/jdk11 \ ${X11BASE}/lib/libXm.so:${PORTSDIR}/x11-toolkits/open-motif \ ${NONEXISTENT}:${PORTSDIR}/java/jfc:extract .if !defined(NATIVE_BOOTSTRAP) BUILD_DEPENDS+= ${JDK12DIR}/bin/javac:${PORTSDIR}/java/linux-sun-jdk12 .endif LIB_DEPENDS= odbc.1:${PORTSDIR}/databases/unixODBC RUN_DEPENDS= javavm:${PORTSDIR}/java/javavmwrapper \ ${X11BASE}/lib/libXm.so:${PORTSDIR}/x11-toolkits/open-motif \ ${X11BASE}/lib/X11/fonts/URW/fonts.dir:${PORTSDIR}/x11-fonts/urwfonts WRKSRC= ${WRKDIR}/build/freebsd JDK_VERSION= 1.2.2 JDK_PATCHSET_VERSION= 10 JDK11DIR?= ${LOCALBASE}/jdk1.1.8 JFC11DIR?= ${WRKDIRPREFIX}${.CURDIR}/../../java/jfc/work/swing-1.1.1fcs .if defined(NATIVE_BOOTSTRAP) JDK12DIR?= ${LOCALBASE}/jdk${JDK_VERSION} .else JDK12DIR?= ${LOCALBASE}/linux-sun-jdk${JDK_VERSION} .endif ONLY_FOR_ARCHS= i386 USE_GMAKE= yes RESTRICTED= "Redistribution of pre-compiled binaries isn't permitted" MAKEFILE= GNUmakefile MAKE_ENV= HAVE_DPS="no" \ ALT_BOOTDIR="${JDK12DIR}" \ ALT_ODBCDIR="${LOCALBASE}" \ ALT_MOTIF_DIR="${X11BASE}" \ OPENWINHOME="${X11BASE}" \ _JDK11DIR="${JDK11DIR}" \ SYS_CFLAGS="${CFLAGS}" \ CLASSPATH="" \ JAVA_COMPILER="" ALL_TARGET= release-images PATCH_CMD= ${PATCH} -p1 -s < PLIST_SUB+= JDK_VERSION=${JDK_VERSION} JDKIMAGEDIR= ${WRKSRC}/jdk-image-i386 JDKIMAGEDIR_G= ${WRKSRC}/jdk-debug-image-i386 JREIMAGEDIR= ${WRKSRC}/jre-image-i386 CPIO?= /usr/bin/cpio .if defined(NODEBUG) PLIST_SUB+= DEBUG:="@comment " PKGNAMESUFFIX= -nodebug .else PLIST_SUB+= DEBUG:="" .endif .if defined(BATCH) || defined(PACKAGE_BUILDING) IGNORE= "You can not legally distribute pre-compiled binaries" .endif .include .for file in ${DISTFILES} .if !exists(${DISTDIR}/${file}) IGNORE=You must manually fetch the source distribution and FreeBSD patches (${DISTFILES}) from http://www.sun.com/software/java2/download.html and http://www.eyesbeyond.com/freebsddom/java/jdk.html, place it in ${DISTDIR} and then run make again .endif .endfor pre-patch: @${MKDIR} ${WRKSRC} .for dir in build src ext/i18n/build ext/i18n/src ext/iiimp/build @cd ${WRKDIR}/${dir} && ${RM} -rf freebsd && ${CP} -R solaris freebsd .endfor @cd ${WRKSRC} && ${PATCH_CMD} ${WRKDIR}/build.patches && \ cd ../share && ${PATCH_CMD} ${WRKDIR}/buildshare.patches && \ cd ../../src/freebsd && ${PATCH_CMD} ${WRKDIR}/src.patches && \ cd ../share && ${PATCH_CMD} ${WRKDIR}/srcshare.patches && \ cd ../../ext && ${PATCH_CMD} ${WRKDIR}/ext.patches @${MKDIR} ${WRKSRC}/1.1_libs @${CP} ${JFC11DIR}/*.jar ${WRKSRC}/1.1_libs .if !defined(NATIVE_BOOTSTRAP) pre-build: @if [ "$${WRKDIRPREFIX}" -a \ -L "/compat/linux/$${WRKDIRPREFIX}" -a \ x`ls -ld "/compat/linux/$${WRKDIRPREFIX}" 2>/dev/null | awk '/->/{print $$NF;exit 0}END{exit 1}'` = x"$${WRKDIRPREFIX}" ]; \ then \ ${ECHO_MSG} "Please set WRKDIRPREFIX to something which doesn't"; \ ${ECHO_MSG} "have a matching symbolic link in /compat/linux."; \ ${ECHO_MSG} "This is known to cause problems during bootstrapping."; \ exit 1; \ fi @if [ `sysctl -n compat.linux.osname` != "Linux" ]; \ then \ ${ECHO_MSG} "Please set the value of the sysctl compat.linux.osname"; \ ${ECHO_MSG} "to 'Linux' with the command:"; \ ${ECHO_MSG} " sysctl compat.linux.osname=Linux"; \ ${ECHO_MSG} "Having it set to other values, such as 'FreeBSD',"; \ ${ECHO_MSG} "is known to cause problems during bootstrapping."; \ exit 1; \ fi .endif post-build: for dir in ${JDKIMAGEDIR} ${JDKIMAGEDIR_G} ${JREIMAGEDIR}; do \ for file in `${FIND} $${dir} -type f -name "*.so"`; do \ if [ -f $${file}.${JDK_VERSION} ]; then \ ${RM} $${file}.${JDK_VERSION}; \ ${LN} -sf `${BASENAME} $${file}` $${file}.${JDK_VERSION}; \ fi; \ done; \ done for dir in ${JDKIMAGEDIR} ${JREIMAGEDIR}; do \ find $${dir} -type f | xargs file | ${GREP} 'not stripped$$' | \ ${SED} 's|:.*$$||' | xargs strip; \ done .if !defined(NODEBUG) pre-install: @${ECHO_MSG} @${ECHO_MSG} "Please use \`make -DNODEBUG' if you don't want to install libraries and binaries" @${ECHO_MSG} "with debugging support." @${ECHO_MSG} .endif do-install: ${MKDIR} ${PREFIX}/jdk${JDK_VERSION} cd ${JDKIMAGEDIR} && ${FIND} . \ | ${CPIO} -pdmu -R ${LIBOWN}:${LIBGRP} ${PREFIX}/jdk${JDK_VERSION} .if !defined(NODEBUG) cd ${JDKIMAGEDIR_G} && ${FIND} . \ | ${CPIO} -pdmu -R ${LIBOWN}:${LIBGRP} ${PREFIX}/jdk${JDK_VERSION} .endif post-install: ${LOCALBASE}/bin/registervm "${PREFIX}/jdk${JDK_VERSION}/bin/java # JDK${JDK_VERSION}" .include