Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2001 22:22:30 -0700 (PDT)
From:      John Merryweather Cooper <jmcoopr@webmail.bmi.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/30217: [PATCH] Improve functionality of NetRexx 1.60 port
Message-ID:  <200108300522.f7U5MU205734@johncoop.MSHOME>

next in thread | raw e-mail | index | archive | help

>Number:         30217
>Category:       ports
>Synopsis:       [PATCH] Improve functionality of NetRexx 1.60 port
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 29 22:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     John Merryweather Cooper
>Release:        FreeBSD 4.4-RC i386
>Organization:
>Environment:
System: FreeBSD johncoop.MSHOME 4.4-RC FreeBSD 4.4-RC #26: Tue Aug 28 14:53:37 PDT 2001 jmcoopr@johncoop.MSHOME:/usr/obj/usr/src/sys/JOHNCOOP i386


	
>Description:
	In its present form the NetRexx port installs a few useless and/or
	duplicate files, NetRexxC.cmd will not work even with the Rexx
	port installed from the command line without a little help, and
	no clues are given as to how to obtain a working configuration.

	I've extensively modified NetRexxC.cmd.  It will now work from the
	command line making Rexx-IMC a suitable RUN_DEPENDS.  I've
	symlinked NetRexxC.cmd in the installation directory to nrc.  I've
	deleted the DOS-only *.bat files and the OS/2-only nrc.cmd file
	(which is not really a Rexx file).  I've deleted the duplicate
	hello.nrx because:  1) a copy is installed with the documentation;
	and 2) you can't compile it from the same directory java is in
	(unless  you have . in your PATH).

	Finally, NetRexxC.cmd will choke if the proper environment variables
	aren't at least set, and will display some suggested values that
	should work with a little tinkering.

	I'll even volunteer to maintain it.  :)

>How-To-Repeat:
	N/A

>Fix:

diff -ruN netrexx/Makefile netrexx.new/Makefile
--- netrexx/Makefile	Tue Apr 11 23:14:56 2000
+++ netrexx.new/Makefile	Wed Aug 29 22:06:08 2001
@@ -2,19 +2,21 @@
 # Date created:		Feb 8, 1999
 # Whom:			Pedro Giffuni
 #
-# $FreeBSD: ports/java/netrexx/Makefile,v 1.4 2000/04/12 06:14:56 obrien Exp $
+# $FreeBSD$
 #
 
 PORTNAME=	netrexx
 PORTVERSION=	1.160
+PORTREVISION=	1
 CATEGORIES=	java lang
 MASTER_SITES=	http://www.ibm.com/technology/NetRexx/
 DISTNAME=	NetRexx
 EXTRACT_SUFX=	.tar.Z
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	jmcoopr@webmail.bmi.net
 
-RUN_DEPENDS=	${PREFIX}/jdk${JDK_VERSION}/bin/java:${PORTSDIR}/java/jdk
+RUN_DEPENDS=	${PREFIX}/jdk${JDK_VERSION}/bin/java:${PORTSDIR}/java/jdk \
+		${PREFIX}/bin/rexx:${PORTSDIR}/lang/rexx-imc
 
 NO_BUILD=	yes
 # pkg/PLIST depends on the JDK_VERSION
@@ -25,6 +27,13 @@
 	-${MV} ${WRKSRC}/nrtools.tar.Z ${WRKSRC}/.foo.Z
 	uncompress -c ${WRKSRC}/.foo.Z | \
 	    tar -xvf - -C ${PREFIX}/jdk${JDK_VERSION}
+	${RM} -f ${PREFIX}/jdk${JDK_VERSION}/bin/NetRexxC.bat
+	${RM} -f ${PREFIX}/jdk${JDK_VERSION}/bin/nrc.bat
+	${RM} -f ${PREFIX}/jdk${JDK_VERSION}/bin/nrc.cmd
+	${RM} -f ${PREFIX}/jdk${JDK_VERSION}/bin/hello.nrx
+	${CP} ${FILESDIR}/NetRexxC.cmd.new ${PREFIX}/jdk${JDK_VERSION}/bin/NetRexxC.cmd
+	${LN} -sf ${PREFIX}/jdk${JDK_VERSION}/bin/NetRexxC.cmd \
+		  ${PREFIX}/jdk${JDK_VERSION}/bin/nrc
 .if !defined(NOPORTDOCS)
 	${MKDIR} ${PREFIX}/share/doc/NetRexx
 	${CP} -R ${WRKSRC}/* ${PREFIX}/share/doc/NetRexx/
diff -ruN netrexx/files/NetRexxC.cmd.new netrexx.new/files/NetRexxC.cmd.new
--- netrexx/files/NetRexxC.cmd.new	Wed Dec 31 16:00:00 1969
+++ netrexx.new/files/NetRexxC.cmd.new	Wed Aug 29 21:19:59 2001
@@ -0,0 +1,109 @@
+/*usr/bin/true; exec rexx "$0" "$@" # REXX program */
+/* Translate and compile a NetRexx program             */
+/*                                                     */
+/* use as:  NetRexxC hello [file2]...                  */
+/*                                                     */
+/*   which will use the NetRexx translator to          */
+/*     translate hello.nrx to hello.java               */
+/*   then will use javac to compile hello.java         */
+/*                                                     */
+/* Any OPTIONS keywords, indicated by a prefix '-',    */
+/* may be added before, after, or between file         */
+/* specification(s), along with the following extra    */
+/*flags:                                               */
+/*                                                     */
+/*   -run       = run class after compilation          */
+/*   -keep      = keep the java file after successful  */
+/*                compilation (as xxx.java.keep)       */
+/*   -nocompile = only translate, do not compile       */
+/*                                                     */
+/* Multiple programs may be specified; in this case    */
+/* they are all run (if requested) after all compiles. */
+/*                                                     */
+/* ----------                                          */
+/* 1996.09.02 -- handle Warnings from NetRexxC (rc=1)  */
+/* 1996.12.14 -- use COM.ibm.netrexx.process           */
+/* 1998.05.25 -- pass NETREXX_JAVA setting to java.exe */
+
+parse arg args
+w=wordpos('-run', args)
+if w>0 then do; run=1;   args=delword(args,w,1); end; else run=0
+w=wordpos('-nocompile', args)
+if w>0 then do; noc=1; end; else noc=0
+
+/* ----- Translate & Compile ----- */
+parse source system .
+select                             /* system-specific options */
+  when system='OS/2' then do
+    '@echo off'
+    /* Add option -norestart for OS/2s 1.0.2+ java.exe, for better display */
+    'java -version 2>&1|rxqueue'; parse pull '1.' subv ' '
+    if subv>=0.2 then javaopts='-norestart'; else javaopts='-noasyncgc'
+
+    /* Add any options from NETREXX_JAVA environment variable */
+    nrjava=value('NETREXX_JAVA',,'OS2ENVIRONMENT')
+    if nrjava\='' then javaopts=javaopts nrjava
+    end
+  otherwise
+    /* Add any options from NETREXX_JAVA environment variable */
+    javaopts=value('NETREXX_JAVA',,'ENVIRONMENT')
+
+    /* JAVAVM MUST be set to the native jdk 1.1.8 */
+    /* it might work with a later, native jdk */
+    /* it will NOT work with a linux jdk */
+    javavm=value('JAVAVM',,'ENVIRONMENT')
+    if javavm = "" then
+      do
+        say "NetRexx will not function unless:  "
+        say ""
+        say "   JAVAVM is set to"
+        say ""
+        say "      /usr/local/jdk1.1.8/bin/java"
+        say ""
+        say "and"
+        say ""
+        say "   CLASSPATH is set to"
+        say ""
+        say "      .:/usr/local/jdk1.1.8/lib/classes.zip:/usr/local/jdk1.1.8/lib/NetRexxC.zip"
+        say ""
+        say "or"
+        say ""
+        say "   NETREXX_JAVA is set to"
+        say ""
+        say "      -classpath <and the above-pathes>"
+        exit
+    end
+  end
+
+/* NOTE:  This won't work if NetRexx.cmd or nrc is executed from the */
+/* same directory as java is located in */
+'java -ms4M' javaopts 'COM.ibm.netrexx.process.NetRexxC' args
+
+/* ----- Run ----- */
+if rc<=1 & run then do
+  if noc then say 'Run option ignored as -nocompile specified'
+   else do
+    do forever /* find the file parameters */
+      parse var args file args
+      if file='' then leave
+      if left(file,1)='-' then iterate
+      filename=filespec('n', file); parse var filename fn '.' fe
+      /* Now determine the exact case of the class, for java commands */
+      file=fn'.class'
+      'ls -l' file ' | rxstack'    /* use ls to get exact case */
+      if queued()<>1 then do
+        if queued()=0 then say 'Cannot find file:' file
+        if queued()>1 then do; do queued(); parse pull .; end
+          say 'File "'file'" is not a unique specification'
+          end
+        exit 1; end
+      parse pull file                         /* is now correct case */
+      parse var file fn '.' fe
+      say 'Running' fn '...'
+      'java' fn
+      end
+    end
+  end
+
+exit rc
+
diff -ruN netrexx/pkg-plist netrexx.new/pkg-plist
--- netrexx/pkg-plist	Fri Nov 26 12:46:09 1999
+++ netrexx.new/pkg-plist	Wed Aug 29 22:07:01 2001
@@ -1,8 +1,5 @@
-jdk%%JDK_VERSION%%/bin/NetRexxC.bat
 jdk%%JDK_VERSION%%/bin/NetRexxC.cmd
-jdk%%JDK_VERSION%%/bin/hello.nrx
-jdk%%JDK_VERSION%%/bin/nrc.bat
-jdk%%JDK_VERSION%%/bin/nrc.cmd
+jdk%%JDK_VERSION%%/bin/nrc
 jdk%%JDK_VERSION%%/lib/NetRexxC.zip
 jdk%%JDK_VERSION%%/lib/NetRexxR.zip
 share/doc/NetRexx/ArchText.class
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108300522.f7U5MU205734>