Permalink
Browse files

Convert the Java related packages to use the alternatives system. To do

this, we only need some simple logic in java-env.mk to automatically
generate an ALTERNATIVES file for us.

There are two exceptions, though: fastjar and jikes (pointed out by tv@),
which do not use this file; they have to be handled manually.

Bump PKGREVISION for all affected packages.

While doing this, remove the java-wrapper package, obsoleted by the new
functionality provided by pkg_alternatives.
  • Loading branch information...
1 parent 8f504be commit 5955fc7f893db7770e5479559435356b93966d4c jmmv committed Jan 30, 2005
View
1 archivers/fastjar/ALTERNATIVES
@@ -0,0 +1 @@
+bin/jar @PREFIX@/bin/fastjar
View
4 archivers/fastjar/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.11 2004/10/03 00:13:04 tv Exp $
+# $NetBSD: Makefile,v 1.12 2005/01/30 23:18:38 jmmv Exp $
#
DISTNAME= fastjar-0.93
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= archivers
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=fastjar/}
EXTRACT_SUFX= .tgz
View
15 doc/CHANGES
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.8980 2005/01/30 21:57:44 wiz Exp $
+$NetBSD: CHANGES,v 1.8981 2005/01/30 23:18:37 jmmv Exp $
Changes to the packages collection and infrastructure in 2005:
@@ -670,3 +670,16 @@ Changes to the packages collection and infrastructure in 2005:
Updated python24 to 2.4nb3 [jmmv 2005-01-30]
Removed python [jmmv 2005-01-30]
Updated mixminion to 0.0.7.1nb1 [wiz 2005-01-30]
+ Updated fastjar to 0.93nb2 [jmmv 2005-01-30]
+ Updated jdk to 1.1.8nb8 [jmmv 2005-01-30]
+ Updated jikes to 1.22nb2 [jmmv 2005-01-30]
+ Updated kaffe to 1.1.4nb6 [jmmv 2005-01-30]
+ Updated sablevm to 1.1.3nb5 [jmmv 2005-01-30]
+ Updated sun-jdk13 to 1.0.15nb1 [jmmv 2005-01-30]
+ Updated sun-jdk14 to 2.7nb1 [jmmv 2005-01-30]
+ Updated sun-jdk15 to 5.0.1nb1 [jmmv 2005-01-30]
+ Updated sun-jre13 to 1.0.15nb1 [jmmv 2005-01-30]
+ Updated sun-jre14 to 2.7nb1 [jmmv 2005-01-30]
+ Updated sun-jre15 to 5.0.1nb2 [jmmv 2005-01-30]
+ Updated win32-jdk to 0.1nb1 [jmmv 2005-01-30]
+ Removed java-wrapper [jmmv 2005-01-30]
View
3 lang/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.207 2005/01/23 22:58:08 recht Exp $
+# $NetBSD: Makefile,v 1.208 2005/01/30 23:18:37 jmmv Exp $
#
COMMENT= Programming languages
@@ -67,7 +67,6 @@ SUBDIR+= japhar
SUBDIR+= jasmin
SUBDIR+= java-lang-spec
SUBDIR+= java-vm-spec
-SUBDIR+= java-wrapper
SUBDIR+= jbuilder-jit
SUBDIR+= jdk
SUBDIR+= jdk-openjit
View
2 lang/java-wrapper/DESCR
@@ -1,2 +0,0 @@
-java-wrapper is a small wrapper that overrides the most common Java programs.
-It executes the right Java implementation based on user's preference.
View
56 lang/java-wrapper/Makefile
@@ -1,56 +0,0 @@
-# $NetBSD: Makefile,v 1.3 2004/10/05 22:03:42 tv Exp $
-#
-
-DISTNAME= java-wrapper-1.2
-CATEGORIES= lang
-MASTER_SITES= # empty
-DISTFILES= # empty
-
-MAINTAINER= jmmv@NetBSD.org
-COMMENT= Runs different Java implementations transparently
-
-NO_BUILDLINK= YES
-NO_CHECKSUM= YES
-NO_CONFIGURE= YES
-USE_PKGINSTALL= YES
-WRKSRC= ${WRKDIR}
-
-EGDIR= ${PREFIX}/share/examples/java-wrapper
-CONF_FILES= ${EGDIR}/java-wrapper.conf \
- ${PKG_SYSCONFDIR}/java-wrapper.conf
-
-SUBST_CLASSES+= build
-SUBST_STAGE.build= do-build
-SUBST_MESSAGE.build= Setting up paths.
-SUBST_FILES.build= java-wrapper.1
-SUBST_FILES.build+= java-wrapper.conf
-SUBST_FILES.build+= java-wrapper.sh
-SUBST_SED.build= -e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g'
-SUBST_SED.build+= -e 's|@PREFIX@|${PREFIX}|g'
-SUBST_SED.build+= -e 's|@SH@|${SH}|g'
-SUBST_SED.build+= -e 's|@TR@|${TR}|g'
-
-INSTALLATION_DIRS= bin man/man1
-
-do-extract:
- ${CP} ${FILESDIR}/java-wrapper.1 ${WRKSRC}
- ${CP} ${FILESDIR}/java-wrapper.conf ${WRKSRC}
- ${CP} ${FILESDIR}/java-wrapper.sh ${WRKSRC}
-
-do-build:
- @${DO_NADA}
-
-# Not all implemetations supply all of the following programs, but these
-# comprise the majority of useful tools available with most JVMs:
-do-install:
-.for f in appletviewer apt extcheck idlj jar jarsigner java javac javadoc \
- javah javakey javap javaws jdb keytool policytool rmic rmid \
- rmiregistry serialver servertool tnameserv
- ${INSTALL_SCRIPT} ${WRKSRC}/java-wrapper.sh ${PREFIX}/bin/${f}
-.endfor
-.undef f
- ${INSTALL_DATA} ${WRKSRC}/java-wrapper.1 ${PREFIX}/man/man1
- ${INSTALL_DATA_DIR} ${EGDIR}
- ${INSTALL_DATA} ${WRKSRC}/java-wrapper.conf ${EGDIR}
-
-.include "../../mk/bsd.pkg.mk"
View
26 lang/java-wrapper/PLIST
@@ -1,26 +0,0 @@
-@comment $NetBSD: PLIST,v 1.3 2004/10/05 22:03:42 tv Exp $
-bin/appletviewer
-bin/apt
-bin/extcheck
-bin/idlj
-bin/jar
-bin/jarsigner
-bin/java
-bin/javac
-bin/javadoc
-bin/javah
-bin/javakey
-bin/javap
-bin/javaws
-bin/jdb
-bin/keytool
-bin/policytool
-bin/rmic
-bin/rmid
-bin/rmiregistry
-bin/serialver
-bin/servertool
-bin/tnameserv
-man/man1/java-wrapper.1
-share/examples/java-wrapper/java-wrapper.conf
-@dirrm share/examples/java-wrapper
View
106 lang/java-wrapper/files/java-wrapper.1
@@ -1,106 +0,0 @@
-.\" $NetBSD: java-wrapper.1,v 1.1.1.1 2004/06/04 16:35:07 jmmv Exp $
-.\"
-.\" java-wrapper - Runs different Java implementations transparently.
-.\" Copyright (c) 2004 Julio M. Merino Vidal <jmmv@NetBSD.org>
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\" 3. Neither the name of author nor the names of its contributors may
-.\" be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd June 4, 2004
-.Dt JAVA-WRAPPER 1
-.Os
-.Sh NAME
-.Nm java-wrapper
-.Nd runs different Java implementations transparently
-.Sh SYNOPSIS
-.Nm appletviewer
-.Op Ar arg1 .. argN
-.Nm jar
-.Op Ar arg1 .. argN
-.Nm java
-.Op Ar arg1 .. argN
-.Nm javac
-.Op Ar arg1 .. argN
-.Nm javadoc
-.Op Ar arg1 .. argN
-.Nm javah
-.Op Ar arg1 .. argN
-.Nm javap
-.Op Ar arg1 .. argN
-.Sh DESCRIPTION
-.Nm
-is a small wrapper that overrides the most common Java programs.
-It executes the right Java implementation based on user's preference.
-.Pp
-A configuration file is used to specify which Java implementation is chosen.
-The wrapper first tries to read
-.Pa ~/.java-wrapper.conf ,
-falling back to
-.Pa @PKG_SYSCONFDIR@/java-wrapper.conf
-if not found (note that one of them must exist; otherwise it will simply
-abort execution).
-.Pp
-The configuration file simply defines some variables that map Java programs
-to Java implementations.
-Each variable contains the name of an implementation, installed from pkgsrc,
-like
-.Sq sun14
-or
-.Sq kaffe .
-Variables doing this mapping have the same name as the Java program, but in
-uppercase letters:
-.Va APPLETVIEWER ,
-.Va JAR ,
-.Va JAVA ,
-.Va JAVAC ,
-.Va JAVADOC ,
-.Va JAVAH ,
-and
-.Va JAVAP .
-Even though, there is an special variable called
-.Va DEFAULT .
-This one sets the name of the implementation used in case any of the specific
-variables are unset or empty.
-.Pp
-The real binary is then searched in
-.Pa @PREFIX@/bin/,
-using the name given in the variable, followed by a dash, followed by the
-Java program.
-For example, if you set
-.Sq JAVA=sun14 ,
-whenever you run
-.Nm java ,
-you will be really executing
-.Pa @PREFIX@/bin/sun14-java .
-.Sh FILES
-.Bl -tag -width @PKG_SYSCONFDIR@/java-wrapper.conf -compact
-.It Pa @PREFIX@/bin/
-Location of real Java binaries.
-.It Pa @PKG_SYSCONFDIR@/java-wrapper.conf
-System wide configuration file.
-.It Pa ~/.java-wrapper.conf
-User specific configuration file.
-.El
-.Sh AUTHORS
-.An Julio M. Merino Vidal Aq jmmv@NetBSD.org
View
42 lang/java-wrapper/files/java-wrapper.conf
@@ -1,42 +0,0 @@
-# $NetBSD: java-wrapper.conf,v 1.3 2004/10/05 22:03:42 tv Exp $
-#
-# @PKG_SYSCONFDIR@/java-wrapper.conf
-#
-# System wide configuration file for java-wrapper.
-# See java-wrapper(1) for more information.
-#
-
-# Default Java implementation to use. I.e., 'sun14', 'wonka', etc.
-# This should be set to something, else most of these programs will not run!
-#
-DEFAULT=
-
-# Override the above setting on a command basis.
-#
-#APPLETVIEWER=
-#APT=
-#EXTCHECK=
-#IDLJ=
-#JAR=
-#JARSIGNER=
-#JAVA=
-#JAVAC=
-#JAVADOC=
-#JAVAH=
-#JAVAKEY=
-#JAVAP=
-#JAVAWS=
-#JDB=
-#KEYTOOL=
-#POLICYTOOL=
-#RMIC=
-#RMID=
-#RMIREGISTRY=
-#SERIALVER=
-#SERVERTOOL=
-#TNAMESERV=
-
-# Or, override the command line explicitly for a given command.
-#
-#JAR_CMD=${PREFIX}/bin/fastjar
-#JAVAC_CMD="${PREFIX}/bin/jikes -Xstdout -bootclasspath $(echo ${PREFIX}/java/jdk-1.3.1/jre/lib/*.jar | tr ' ' ':')"
View
70 lang/java-wrapper/files/java-wrapper.sh
@@ -1,70 +0,0 @@
-#! @SH@
-#
-# $NetBSD: java-wrapper.sh,v 1.2 2004/08/11 14:45:31 tv Exp $
-#
-# java-wrapper - Runs different Java implementations transparently.
-# Copyright (c) 2004 Julio M. Merino Vidal <jmmv@NetBSD.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in
-# the documentation and/or other materials provided with the
-# distribution.
-# 3. Neither the name of author nor the names of its contributors may
-# be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-
-PREFIX="@PREFIX@"
-PKG_SYSCONFDIR="@PKG_SYSCONFDIR@"
-TR="@TR@"
-
-progname=${0##*/}
-
-err() {
- echo "${progname}: $*" 1>&2
- echo "${progname}: See java-wrapper(1) for more information." 1>&2
- exit 1
-}
-
-if [ -f ${HOME}/.java-wrapper.conf ]; then
- . ${HOME}/.java-wrapper.conf
-elif [ -f ${PKG_SYSCONFDIR}/java-wrapper.conf ]; then
- . ${PKG_SYSCONFDIR}/java-wrapper.conf
-else
- err "cannot open configuration file."
-fi
-
-varname=$(echo ${progname} | ${TR} a-z A-Z)
-eval cmd=\"\$${varname}_CMD\"
-eval impl=\"\$${varname}\"
-
-if [ -z "${cmd}" -a -z "${impl}" -a -z "${DEFAULT}" ]; then
- err "no mapping defined (${varname}_CMD, ${varname}, and DEFAULT are empty)."
-fi
-
-if [ -z "${cmd}" ]; then
- cmd=${PREFIX}/bin/${impl:-${DEFAULT}}-${progname}
-
- if [ ! -f ${cmd} ]; then
- err "cannot locate ${cmd} (incorrect mapping or missing package)."
- fi
-fi
-
-exec ${cmd} "$@"
View
4 lang/jdk/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.41 2004/10/11 14:07:37 tv Exp $
+# $NetBSD: Makefile,v 1.42 2005/01/30 23:18:38 jmmv Exp $
#
VERSION= 1.1.8
PKGNAME= jdk-${VERSION}
-PKGREVISION= 7
+PKGREVISION= 8
CATEGORIES= lang java
MASTER_SITES= ftp://ftp.NetBSD.org/pub/NetBSD/misc/java/i386/${VERSION}/ \
ftp://ftp.de.NetBSD.org/pub/NetBSD/misc/java/i386/${VERSION}/
View
1 lang/jikes/ALTERNATIVES
@@ -0,0 +1 @@
+bin/javac @PREFIX@/bin/jikes
View
4 lang/jikes/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.29 2004/11/13 22:04:53 jlam Exp $
+# $NetBSD: Makefile,v 1.30 2005/01/30 23:18:38 jmmv Exp $
#
DISTNAME= jikes-1.22
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang java
MASTER_SITES= http://oss.software.ibm.com/pub/${DISTNAME:S,-,/,}/
EXTRACT_SUFX= .tar.bz2
View
4 lang/kaffe/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.57 2004/10/17 15:34:56 tv Exp $
+# $NetBSD: Makefile,v 1.58 2005/01/30 23:18:38 jmmv Exp $
#
.include "Makefile.common"
-PKGREVISION= 5
+PKGREVISION= 6
CONFLICTS+= kaffe-nox11-[0-9]*
View
4 lang/sablevm/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2004/10/28 11:53:50 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2005/01/30 23:18:38 jmmv Exp $
#
DISTNAME= sablevm-1.1.3
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=sablevm/} \
http://devel.sablevm.org/download/1.1.3/
View
3 lang/sun-jdk13/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.33 2005/01/25 18:06:44 jschauma Exp $
+# $NetBSD: Makefile,v 1.34 2005/01/30 23:18:38 jmmv Exp $
DISTNAME= j2sdk-1_3_1_15-linux-i586
PKGNAME= sun-jdk13-1.0.15
+PKGREVISION= 1
MASTER_SITES= # empty
COMMENT= Sun's Java(tm) Development Kit 1.3.1
View
3 lang/sun-jdk14/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.23 2005/01/25 17:37:37 jschauma Exp $
+# $NetBSD: Makefile,v 1.24 2005/01/30 23:18:38 jmmv Exp $
DISTNAME= j2sdk-1_4_2_07-linux-i586
PKGNAME= sun-jdk14-2.7
+PKGREVISION= 1
MASTER_SITES= # empty
COMMENT= Sun's Java(tm) 2 SDK, Standard Edition 1.4.2
View
3 lang/sun-jdk15/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.4 2005/01/15 21:56:46 jmmv Exp $
+# $NetBSD: Makefile,v 1.5 2005/01/30 23:18:38 jmmv Exp $
DISTNAME= jdk-1_5_0_01-linux-i586
PKGNAME= sun-jdk15-5.0.1
+PKGREVISION= 1
MASTER_SITES= # empty
COMMENT= Sun's Java(tm) 2 SDK, Standard Edition 1.5.0
View
3 lang/sun-jre13/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.38 2005/01/25 18:06:44 jschauma Exp $
+# $NetBSD: Makefile,v 1.39 2005/01/30 23:18:38 jmmv Exp $
DISTNAME= j2re-1_3_1_15-linux-i586
PKGNAME= sun-jre13-1.0.15
+PKGREVISION= 1
MASTER_SITES= # empty
COMMENT= Sun's Java(tm) Runtime Environment 1.3.1
View
3 lang/sun-jre14/Makefile
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.22 2005/01/25 17:37:37 jschauma Exp $
+# $NetBSD: Makefile,v 1.23 2005/01/30 23:18:38 jmmv Exp $
# Note: Regen distinfo with SUN_JRE14_USE_JCE=YES
DISTNAME= j2re-1_4_2_07-linux-i586
PKGNAME= sun-jre14-2.7
+PKGREVISION= 1
MASTER_SITES= # empty
COMMENT= Sun's Java(tm) 2 Runtime Environment 1.4.2
View
4 lang/sun-jre15/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.11 2005/01/17 16:17:24 jmmv Exp $
+# $NetBSD: Makefile,v 1.12 2005/01/30 23:18:38 jmmv Exp $
# Note: Regen distinfo with SUN_JRE15_USE_JCE=YES
DISTNAME= jre-1_5_0_01-linux-i586
PKGNAME= sun-jre15-5.0.1
-PKGREVISION= 1
+PKGREVISION= 2
MASTER_SITES= # empty
COMMENT= Sun's Java(tm) 2 Runtime Environment 1.5.0
View
3 lang/win32-jdk/Makefile
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.1.1.1 2004/10/11 13:37:10 tv Exp $
+# $NetBSD: Makefile,v 1.2 2005/01/30 23:18:38 jmmv Exp $
#
# Interix-only "JDK" for pkgsrc, implemented as a script wrapper around the
# Win32 Sun JDK/JRE.
#
DISTNAME= win32-jdk-0.1
+PKGREVISION= 1
CATEGORIES= lang java
MASTER_SITES= # empty
DISTFILES= # empty
View
9 mk/java-env.mk
@@ -1,4 +1,4 @@
-# $NetBSD: java-env.mk,v 1.3 2004/05/23 10:29:43 jmmv Exp $
+# $NetBSD: java-env.mk,v 1.4 2005/01/30 23:18:38 jmmv Exp $
#
# This Makefile fragment handles Java wrappers and is meant to be included
# by packages that provide a Java build-time and/or run-time environment.
@@ -39,6 +39,13 @@ JAVA_WRAPPERS?= # empty
INSTALLATION_DIRS+= bin
.endif
+ALTERNATIVES_SRC= ${WRKDIR}/.ALTERNATIVES
+${WRKDIR}/.ALTERNATIVES:
+.for w in ${JAVA_WRAPPERS}
+ @${ECHO} 'bin/${w} ${PREFIX}/bin/${JAVA_NAME}-${w}' \
+ >>${WRKDIR}/.ALTERNATIVES
+.endfor
+
.for w in ${JAVA_WRAPPERS}
JAVA_WRAPPER_BIN.${w}?= ${JAVA_HOME}/bin/${w}

0 comments on commit 5955fc7

Please sign in to comment.