summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/win32-jdk/DESCR8
-rw-r--r--lang/win32-jdk/Makefile48
-rw-r--r--lang/win32-jdk/PLIST49
-rw-r--r--lang/win32-jdk/buildlink2.mk16
-rw-r--r--lang/win32-jdk/buildlink3.mk18
-rw-r--r--lang/win32-jdk/files/java.sh113
6 files changed, 252 insertions, 0 deletions
diff --git a/lang/win32-jdk/DESCR b/lang/win32-jdk/DESCR
new file mode 100644
index 00000000000..7d0a67e5892
--- /dev/null
+++ b/lang/win32-jdk/DESCR
@@ -0,0 +1,8 @@
+This package is a wrapper around the standard Win32 Java(tm) 2 Development
+Kit (or optionally the Java(tm) 2 Runtime Environment, if no development
+tools are needed). This package will install correctly whether or not there
+is a working JDK/JRE on the system; it is up to the user to make sure it
+is correctly installed on the Win32 side.
+
+This package will attempt path conversion, but it is simplistic and flimsy.
+This support will be improved in future package versions.
diff --git a/lang/win32-jdk/Makefile b/lang/win32-jdk/Makefile
new file mode 100644
index 00000000000..875e5006021
--- /dev/null
+++ b/lang/win32-jdk/Makefile
@@ -0,0 +1,48 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/10/11 13:37:10 tv Exp $
+#
+# Interix-only "JDK" for pkgsrc, implemented as a script wrapper around the
+# Win32 Sun JDK/JRE.
+#
+
+DISTNAME= win32-jdk-0.1
+CATEGORIES= lang java
+MASTER_SITES= # empty
+DISTFILES= # empty
+
+MAINTAINER= tv@duh.org
+HOMEPAGE= http://www.java.com/
+COMMENT= Interix wrapper package for Win32 Sun Java(tm) 2
+
+WRKSRC= ${WRKDIR}
+EXTRACT_ONLY= # empty
+USE_LANGUAGES= # empty
+NO_CHECKSUM= yes
+
+USE_PKGINSTALL= yes
+OWN_DIRS= ${JAVA_HOME}
+
+ONLY_FOR_PLATFORM= Interix-*-*
+
+JAVA_NAME= win32
+JAVA_HOME= ${LOCALBASE}/java/win32
+NO_MTREE= yes # since we change PREFIX below
+
+JAVA_WRAPPERS= appletviewer extcheck idlj jar jarsigner \
+ java javac javadoc javah javap jdb keytool \
+ orbd policytool rmic serialver rmid \
+ rmiregistry servertool tnameserv
+
+JAVA_EXTRA= HtmlConverter kinit klist ktab native2ascii
+
+do-build:
+
+do-install:
+ ${INSTALL_SCRIPT_DIR} ${JAVA_HOME}/bin
+ ${INSTALL_SCRIPT} ${FILESDIR}/java.sh ${JAVA_HOME}/bin/java
+ ${LN} -sf . ${JAVA_HOME}/jre
+.for f in ${JAVA_WRAPPERS:Njava} ${JAVA_EXTRA}
+ ${LN} -sf java ${JAVA_HOME}/bin/$f
+.endfor
+
+.include "../../mk/java-env.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lang/win32-jdk/PLIST b/lang/win32-jdk/PLIST
new file mode 100644
index 00000000000..0c549a6e9d3
--- /dev/null
+++ b/lang/win32-jdk/PLIST
@@ -0,0 +1,49 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2004/10/11 13:37:10 tv Exp $
+bin/win32-appletviewer
+bin/win32-extcheck
+bin/win32-idlj
+bin/win32-jar
+bin/win32-jarsigner
+bin/win32-java
+bin/win32-javac
+bin/win32-javadoc
+bin/win32-javah
+bin/win32-javap
+bin/win32-jdb
+bin/win32-keytool
+bin/win32-orbd
+bin/win32-policytool
+bin/win32-rmic
+bin/win32-rmid
+bin/win32-rmiregistry
+bin/win32-serialver
+bin/win32-servertool
+bin/win32-tnameserv
+java/win32/bin/HtmlConverter
+java/win32/bin/appletviewer
+java/win32/bin/extcheck
+java/win32/bin/idlj
+java/win32/bin/jar
+java/win32/bin/jarsigner
+java/win32/bin/java
+java/win32/bin/javac
+java/win32/bin/javadoc
+java/win32/bin/javah
+java/win32/bin/javap
+java/win32/bin/jdb
+java/win32/bin/keytool
+java/win32/bin/kinit
+java/win32/bin/klist
+java/win32/bin/ktab
+java/win32/bin/native2ascii
+java/win32/bin/orbd
+java/win32/bin/policytool
+java/win32/bin/rmic
+java/win32/bin/rmid
+java/win32/bin/rmiregistry
+java/win32/bin/serialver
+java/win32/bin/servertool
+java/win32/bin/tnameserv
+@exec ${LN} -sf . %D/java/win32/jre
+@unexec ${RM} -f %D/java/win32/jre
+@dirrm java/win32/bin
diff --git a/lang/win32-jdk/buildlink2.mk b/lang/win32-jdk/buildlink2.mk
new file mode 100644
index 00000000000..bffb757b342
--- /dev/null
+++ b/lang/win32-jdk/buildlink2.mk
@@ -0,0 +1,16 @@
+# $NetBSD: buildlink2.mk,v 1.1.1.1 2004/10/11 13:37:10 tv Exp $
+
+.if !defined(WIN32_JDK_BUILDLINK2_MK)
+WIN32_JDK_BUILDLINK2_MK= # defined
+
+BUILDLINK_PACKAGES+= win32-jdk
+BUILDLINK_DEPENDS.win32-jdk?= win32-jre>=0.1
+BUILDLINK_PKGSRCDIR.win32-jdk?= ../../lang/win32-jre
+
+EVAL_PREFIX+= BUILDLINK_PREFIX.win32-jdk=win32-jre
+BUILDLINK_PREFIX.win32-jdk_DEFAULT= ${LOCALBASE}
+BUILDLINK_TARGETS+= win32-jdk-buildlink
+
+win32-jdk-buildlink: _BUILDLINK_USE
+
+.endif # WIN32_JDK_BUILDLINK2_MK
diff --git a/lang/win32-jdk/buildlink3.mk b/lang/win32-jdk/buildlink3.mk
new file mode 100644
index 00000000000..ade59e1ffde
--- /dev/null
+++ b/lang/win32-jdk/buildlink3.mk
@@ -0,0 +1,18 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2004/10/11 13:37:10 tv Exp $
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+WIN32_JDK_BUILDLINK3_MK:= ${WIN32_JRE_BUILDLINK3_MK}+
+
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= win32-jdk
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nwin32-jdk}
+BUILDLINK_PACKAGES+= win32-jdk
+
+.if !empty(WIN32_JDK_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.win32-jdk+= win32-jre>=0.1
+BUILDLINK_PKGSRCDIR.win32-jdk?= ../../lang/win32-jre
+.endif # WIN32_JDK_BUILDLINK3_MK
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/lang/win32-jdk/files/java.sh b/lang/win32-jdk/files/java.sh
new file mode 100644
index 00000000000..f41cb1f595c
--- /dev/null
+++ b/lang/win32-jdk/files/java.sh
@@ -0,0 +1,113 @@
+#!/bin/ksh
+# $NetBSD: java.sh,v 1.1.1.1 2004/10/11 13:37:10 tv Exp $
+#
+# Wrapper for Java under Interix. While this is mostly useful, particularly
+# if using relative pathnames, it can still fail if attempting to use
+# absolute paths. So this attempts to fixup absolute paths.
+#
+# That too can be a problem if options are supposed to be specified "/opt",
+# but this is rare to nonexistent, so we don't currently handle that case.
+#
+
+if [ "$SYSTEMROOT" != "" ]; then
+ windir="$SYSTEMROOT"
+elif [ "$WINDIR" != "" ]; then
+ windir="$WINDIR"
+else
+ echo "Cannot find %SYSTEMROOT% or %WINDIR% -- did you clear then environment?" >&2
+ exit 2
+fi
+
+JAVA=$(ntpath2posix -c $windir'\system32\java.exe')
+
+if [ ! -x $JAVA ]; then
+ echo >&2
+ echo "Cannot find $(posixpath2nt $JAVA) -- please install the" >&2
+ echo 'Sun Java(tm) 2 Runtime Environment and/or Development Kit, available' >&2
+ echo 'from: http://www.java.com/' >&2
+ echo >&2
+ exit 1
+fi
+
+convert_path () {
+ (IFS=:
+ for dir in $1; do
+ printf '%s' "$(posixpath2nt $dir);"
+ done) | sed 's,;$,,'
+}
+
+do_java () {
+ export CLASSPATH="$(convert_path "$CLASSPATH")"
+
+ set -A jvmargs
+ set -A args
+
+ for arg in "$@"; do
+ case "$arg" in
+ /*) arg="$(convert_path "$arg")";;
+ *) ;;
+ esac
+
+ case "$arg" in
+ -J*) jvmargs[${#jvmargs}]="$(printf '%s' "$arg" | sed s,^-J,,)";;
+ *) args[${#args}]="$arg";;
+ esac
+ done
+
+ exec $JAVA "${jvmargs[@]}" "${args[@]}"
+}
+
+do_jdk () {
+ if [ "$JDK_HOME" = "" ]; then
+ echo >&2
+ echo 'Cannot find the Java 2 SDK (JDK) in C:\j2sdk*. Please install the JDK' >&2
+ echo 'in this standard location, or else set the environment variable JDK_HOME' >&2
+ echo 'to the Windows pathname of the JDK.' >&2
+ echo >&2
+ exit 2
+ fi
+
+ posix_jdk_home="$(ntpath2posix -c "$JDK_HOME")"
+ CLASSPATH="$posix_jdk_home/lib/tools.jar:$posix_jdk_home/lib/dt.jar${CLASSPATH+:$CLASSPATH}"
+
+ do_java "$@"
+}
+
+# Find the JDK class jars, if they exist.
+if [ "$JDK_HOME" = "" ]; then
+ for f in $(/bin/ls -1dr /dev/fs/C/j2sdk* 2>/dev/null); do
+ if [ -r $f/lib/tools.jar ]; then
+ JDK_HOME=$(posixpath2nt $f)
+ break
+ fi
+ done
+fi
+
+case $(basename $0) in
+HtmlConverter) do_jdk -jar $jdk_home/lib/htmlconverter.jar "$@";;
+appletviewer) do_jdk sun.applet.Main "$@";;
+extcheck) do_jdk com.sun.tools.extcheck.Main "$@";;
+idlj) do_jdk com.sun.tools.corba.se.idl.toJavaPortable.Compile "$@";;
+jar) do_jdk sun.tools.jar.Main "$@";;
+jarsigner) do_jdk sun.security.tools.JarSigner "$@";;
+javac) do_jdk com.sun.tools.javac.Main "$@";;
+javadoc) do_jdk com.sun.tools.javadoc.Main "$@";;
+javah) do_jdk com.sun.tools.javah.Main "$@";;
+javap) do_jdk sun.tools.javap.Main "$@";;
+jdb) do_jdk com.sun.tools.example.debug.tty.TTY "$@";;
+keytool) do_java sun.security.tools.KeyTool "$@";;
+kinit) do_java sun.security.krb5.internal.tools.Kinit "$@";;
+klist) do_java sun.security.krb5.internal.tools.Klist "$@";;
+ktab) do_java sun.security.krb5.internal.tools.Ktab "$@";;
+native2ascii) do_jdk sun.tools.native2ascii.Main "$@";;
+orbd) do_java com.sun.corba.se.internal.Activation.ORBD "$@";;
+policytool) do_java sun.security.tools.PolicyTool "$@";;
+rmic) do_jdk sun.rmi.rmic.Main "$@";;
+rmid) do_java sun.rmi.server.Activation "$@";;
+rmiregistry) do_java sun.rmi.registry.RegistryImpl "$@";;
+serialver) do_jdk sun.tools.serialver.SerialVer "$@";;
+servertool) do_java com.sun.corba.se.internal.Activation.ServerTool "$@";;
+tnameserv) do_java com.sun.corba.se.internal.CosNaming.TransientNameServer "$@";;
+
+*) do_java "$@";;
+esac