update to 1.7.14 [release 1.7.14-1mamba;Thu Aug 18 2022]

This commit is contained in:
Silvan Calarco 2024-01-06 00:10:24 +01:00
parent 03620ced1d
commit 7767bffd15
10 changed files with 194 additions and 250 deletions

View File

@ -1,11 +0,0 @@
--- ./build.xml.sav 2007-03-07 15:06:11.000000000 -0500
+++ ./build.xml 2007-03-07 15:06:25.000000000 -0500
@@ -73,7 +73,7 @@
<target name="compile" depends="init">
<ant antfile="src/build.xml" target="compile"/>
- <ant antfile="toolsrc/build.xml" target="compile"/>
+ <!-- <ant antfile="toolsrc/build.xml" target="compile"/> -->
<antcall target="xmlimplsrc-compile" />
</target>

View File

@ -1,94 +0,0 @@
diff -ur rhino1_7R2pre.orig/examples/Matrix.java rhino1_7R2pre/examples/Matrix.java
--- rhino1_7R2pre.orig/examples/Matrix.java 2008-07-28 10:45:22.000000000 -0400
+++ rhino1_7R2pre/examples/Matrix.java 2008-08-11 00:06:20.483267501 -0400
@@ -249,7 +249,7 @@
* Use the convenience method from Context that takes care of calling
* toString, etc.
*/
- public Object getDefaultValue(Class<?> typeHint) {
+ public Object getDefaultValue(Class typeHint) {
return "[object Matrix]";
}
diff -ur rhino1_7R2pre.orig/examples/PrimitiveWrapFactory.java rhino1_7R2pre/examples/PrimitiveWrapFactory.java
--- rhino1_7R2pre.orig/examples/PrimitiveWrapFactory.java 2008-07-28 10:45:22.000000000 -0400
+++ rhino1_7R2pre/examples/PrimitiveWrapFactory.java 2008-08-11 00:07:30.546266985 -0400
@@ -57,7 +57,7 @@
public class PrimitiveWrapFactory extends WrapFactory {
@Override
public Object wrap(Context cx, Scriptable scope, Object obj,
- Class<?> staticType)
+ Class staticType)
{
if (obj instanceof String || obj instanceof Number ||
obj instanceof Boolean)
diff -ur rhino1_7R2pre.orig/src/org/mozilla/javascript/WrapFactory.java rhino1_7R2pre/src/org/mozilla/javascript/WrapFactory.java
--- rhino1_7R2pre.orig/src/org/mozilla/javascript/WrapFactory.java 2008-07-28 10:45:14.000000000 -0400
+++ rhino1_7R2pre/src/org/mozilla/javascript/WrapFactory.java 2008-08-11 00:07:57.706710143 -0400
@@ -75,7 +75,7 @@
* @return the wrapped value.
*/
public Object wrap(Context cx, Scriptable scope,
- Object obj, Class<?> staticType)
+ Object obj, Class staticType)
{
if (obj == null || obj == Undefined.instance
|| obj instanceof Scriptable)
diff -ur rhino1_7R2pre.orig/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java rhino1_7R2pre/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java
--- rhino1_7R2pre.orig/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java 2008-07-28 10:45:18.000000000 -0400
+++ rhino1_7R2pre/toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java 2008-08-11 00:06:20.483267501 -0400
@@ -67,7 +67,7 @@
return super.defineClass(name, data, 0, data.length, domain);
}
- public void linkClass(Class<?> cl) {
+ public void linkClass(Class cl) {
resolveClass(cl);
}
}
diff -ur rhino1_7R2pre.orig/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java rhino1_7R2pre/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java
--- rhino1_7R2pre.orig/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java 2008-07-28 10:45:20.000000000 -0400
+++ rhino1_7R2pre/xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java 2008-08-11 00:06:20.483267501 -0400
@@ -115,7 +115,7 @@
}
@Override
- public Object getDefaultValue(Class<?> hint) {
+ public Object getDefaultValue(Class hint) {
return uri();
}
diff -ur rhino1_7R2pre.orig/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java rhino1_7R2pre/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java
--- rhino1_7R2pre.orig/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java 2008-07-28 10:45:20.000000000 -0400
+++ rhino1_7R2pre/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java 2008-08-11 00:06:20.484267636 -0400
@@ -145,7 +145,7 @@
}
@Override
- public Object getDefaultValue(Class<?> hint) {
+ public Object getDefaultValue(Class hint) {
return toString();
}
diff -ur rhino1_7R2pre.orig/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java rhino1_7R2pre/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java
--- rhino1_7R2pre.orig/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java 2008-07-28 10:45:20.000000000 -0400
+++ rhino1_7R2pre/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java 2008-08-11 00:06:20.498268536 -0400
@@ -165,7 +165,7 @@
}
@Override
- public final Object getDefaultValue(Class<?> hint) {
+ public final Object getDefaultValue(Class hint) {
return this.toString();
}
--- rhino1_7R2pre.orig/xmlimplsrc/buildorig 2009-02-13 14:17:57.000000000 -0500
+++ rhino1_7R2pre/xmlimplsrc/build.xml 2009-02-13 14:29:42.000000000 -0500
@@ -67,6 +67,7 @@
<target name="e4x-compile" if="jdk1.5?">
<javac
+ bootclasspath="/usr/lib/jvm/java-openjdk/jre/lib/rt.jar"
srcdir="xmlimplsrc"
destdir="${classes}"
deprecation="on"

View File

@ -1,30 +0,0 @@
#!/bin/sh
#
# rhino script
# JPackage Project <http://www.jpackage.org/>
# Source functions library
. /usr/share/java-utils/java-functions
# Source system prefs
if [ -f /etc/rhino.conf ] ; then
. /etc/rhino.conf
fi
# Source user prefs
if [ -f $HOME/.rhinorc ] ; then
. $HOME/.rhinorc
fi
# Configuration
MAIN_CLASS=org.mozilla.javascript.tools.shell.Main
BASE_JARS="rhino xmlbeans/xbean"
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

View File

@ -1,176 +1,105 @@
%define pkgver 1_7R2-RC4
%define buildver 1_7R2
%define api_version 1.7
%define javahome %{_jvmdir}/jdk
Name: java-rhino
Version: 1.7rc4
Release: 3mamba
Epoch: 1
Version: 1.7.14
Release: 1mamba
Summary: Rhino - JavaScript for Java
Group: Development/Libraries/Java
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.mozilla.org/rhino/
Source0: ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino%{pkgver}.zip
#Source1: http://java.sun.com/products/jfc/tsc/articles/treetable2/downloads/src.zip
Source2: java-rhino.script
Patch0: java-rhino-1.7R2-RC3-disabledebuggertool.patch
Patch1: java-rhino-1_7R2pre-build.patch
URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino
Source0: https://github.com/mozilla/rhino/releases/download/Rhino1_7_14_Release/rhino-1.7.14.zip
Source1: rhino
Source2: rhino-debugger
Source3: rhino-idswitch
Source4: rhino-jsc
Source5: rhino-debugger.1
Source6: rhino-jsc.1
License: GPL, MPL 1.1
BuildRequires: apache-ant
%if "%{stage1}" != "1"
BuildRequires: apache-xmlbeans
BuildRequires: java-backport-util-concurrent
BuildRequires: java-bea-stax-api
BuildRequires: java-retrotranslator
%endif
BuildRequires: jpackage-utils
%if "%{stage1}" != "1"
Requires: apache-xmlbeans
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
BuildRequires: javapackages
Requires: javapackages
%description
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.
%package demo
Group: Documentation
Summary: Examples for %{name}
%description demo
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.
This package contains examples for %{name}.
#%package manual
#Group: Documentation
#Summary: Manual for %{name}
#%description manual
#Rhino is an open-source implementation of JavaScript written entirely
#in Java. It is typically embedded into Java applications to provide
#scripting to end users.
#This package contains documentation for %{name}.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.
This package contains javadoc for %{name}.
%prep
%setup -q -n rhino1_7R2
%patch1 -p1
%patch0 -b .sav
for j in $(find . -name "*.jar"); do
mv $j ${j}.no
done
perl -pi -e 's|.*<get.*src=.*>\n||' build.xml testsrc/build.xml toolsrc/org/mozilla/javascript/tools/debugger/build.xml xmlimplsrc/build.xml
#install -D -p -m 644 %{S;1} toolsrc/org/mozilla/javascript/tools/debugger/downloaded/swingExSrc.zip
perl -pi -e 's|^Class-Path:.*\n||g' src/manifest
perl -pi -e 's|^implementation.version: Rhino .* release .* \${implementation.date}|implementation.version: Rhino %{version} release %{release} \${implementation.date}|' build.properties
cp -pr toolsrc/org/mozilla/javascript/tools src/org/mozilla/javascript
cp -pr xmlimplsrc/org/mozilla/javascript/xmlimpl src/org/mozilla/javascript
%setup -q -n rhino%{version}
%build
#:<< EOF
export JAVA_HOME=%javahome
%if "%{stage1}" != "1"
export CLASSPATH=$(build-classpath bea-stax-api backport-util-concurrent retrotranslator-runtime retrotranslator-transformer)
%endif
ant \
-Dxbean.jar=$(build-classpath xmlbeans/xbean) \
-Djsr173.jar=$(build-classpath bea-stax-api) \
deepclean jar smalljar copy-all javadoc
#EOF
pushd examples
mkdir -p target/classes
export CLASSPATH=../build/rhino%{buildver}/js.jar:$(build-classpath xmlbeans/xbean)
%javahome/bin/javac -d target/classes `find . -name '*.java'`
%javahome/bin/jar cf ../build/rhino%{buildver}/rhino-examples-%{api_version}.jar target/classes
popd
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}
install -pm 644 build/rhino%{buildver}/js.jar \
%{buildroot}%{_javadir}/rhino-%{api_version}.jar
install -pm 644 build/rhino%{buildver}/smalljs.jar\
%{buildroot}%{_javadir}/rhino-small-%{api_version}.jar
install -pm 644 build/rhino%{buildver}/rhino-examples-%{api_version}.jar \
%{buildroot}%{_javadir}/rhino-examples-%{api_version}.jar
install -pm 644 lib/rhino-%{version}.jar \
%{buildroot}%{_javadir}/rhino-%{version}.jar
install -pm 644 lib/rhino-engine-%{version}.jar\
%{buildroot}%{_javadir}/rhino-engine-%{version}.jar
install -pm 644 lib/rhino-runtime-%{version}.jar\
%{buildroot}%{_javadir}/rhino-runtime-%{version}.jar
(
cd %{buildroot}%{_javadir}
ln -s rhino-%{api_version}.jar js-%{api_version}.jar
ln -s rhino-small-%{api_version}.jar smalljs-%{api_version}.jar
ln -s rhino-%{version}.jar js-%{version}.jar
)
(
cd %{buildroot}%{_javadir}
for jar in *-%{api_version}*; do
ln -s ${jar} `echo $jar| sed "s|-%{api_version}||g"`
for jar in *-%{version}*; do
ln -s ${jar} `echo $jar| sed "s|-%{version}||g"`
done
)
mkdir -p %{buildroot}%{_javadocdir}/rhino-%{version}
cp -a build/rhino%{buildver}/javadoc/* %{buildroot}%{_javadocdir}/rhino-%{version}
cp -a docs/* %{buildroot}%{_javadocdir}/rhino-%{version}
ln -s rhino-%{version} %{buildroot}%{_javadocdir}/rhino
find %{buildroot}%{_javadocdir}/rhino-%{version} -type f -name '*.html' | %{_bindir}/xargs %{__perl} -pi -e 's/\r$//g'
mkdir -p %{buildroot}%{_bindir}
install -m 755 %{S:2} %{buildroot}%{_bindir}/rhino
install -D -m0755 %{S:1} %{buildroot}%{_bindir}/rhino
install -D -m0755 %{S:2} %{buildroot}%{_bindir}/rhino-debugger
install -D -m0755 %{S:3} %{buildroot}%{_bindir}/rhino-idswitch
install -D -m0755 %{S:4} %{buildroot}%{_bindir}/rhino-jsc
mkdir -p %{buildroot}%{_datadir}/rhino-%{version}
cp -a build/rhino%{buildver}/examples/* %{buildroot}%{_datadir}/rhino-%{version}
install -D -m0644 man/rhino.1 %{buildroot}%{_mandir}/man1/rhino.1
install -D -m0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/rhino-debugger.1
install -D -m0644 %{SOURCE6} %{buildroot}%{_mandir}/man1/rhino-jsc.1
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_bindir}/rhino
%{_javadir}/js-%{api_version}.jar
%{_bindir}/rhino*
%{_javadir}/js-%{version}.jar
%{_javadir}/js.jar
%{_javadir}/rhino-%{api_version}.jar
%{_javadir}/rhino-%{version}.jar
%{_javadir}/rhino.jar
%{_javadir}/rhino-small-%{api_version}.jar
%{_javadir}/rhino-small.jar
%{_javadir}/smalljs-%{api_version}.jar
%{_javadir}/smalljs.jar
%{_javadir}/rhino-engine-%{version}.jar
%{_javadir}/rhino-engine.jar
%{_javadir}/rhino-runtime-%{version}.jar
%{_javadir}/rhino-runtime.jar
%{_mandir}/man1/rhino*.1*
%doc LICENSE.txt
%files demo
%defattr(-,root,root)
%{_javadir}/rhino-examples-%{api_version}.jar
%{_javadir}/rhino-examples.jar
%{_datadir}/rhino-%{version}
#%files manual
#%defattr(-,root,root)
#%doc build/rhino%{buildver}/docs/*
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/rhino-%{version}
%{_javadocdir}/rhino
%changelog
* Thu Aug 18 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 1.7.14-1mamba
- update to 1.7.14
* Fri Mar 25 2011 gil <puntogil@libero.it> 1.7rc4-3mamba
- rebuilt with java-openjdk support

5
rhino Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
/usr/bin/java \
-jar /usr/share/java/js.jar \
"$@"

6
rhino-debugger Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
/usr/bin/java \
-classpath /usr/share/java/js.jar \
org.mozilla.javascript.tools.debugger.Main \
"$@"

60
rhino-debugger.1 Normal file
View File

@ -0,0 +1,60 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH RHINO-DEBUGGER 1 "Friday 17, 2009"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
rhino-debugger \- invokes the rhino JavaScript debugger GUI
.SH SYNOPSIS
.B rhino-debugger
.I [options]
.I script_filename_or_url
.I [script_arguments]
.SH DESCRIPTION
This manual page documents briefly the
.B rhino-debugger
command.
This manual page was written for the Debian distribution because the original
program does not have a manual page. It is written according to the html documentation.
.PP
\fBrhino-debugger\fP is a start script for the rhino JavaScript debugger. The Rhino JavaScript debugger is a GUI that allows debugging of interpreted JavaScript scripts run in Rhino. Note that this debugger will not work with JavaScript scripts run in the mozilla browser since Rhino is not the engine used in such environments.
.SH OPTIONS
.IP -e\ \fIscript_source\fP
Executes script_source as a JavaScript script.
.IP -f\ \fIscript_filename_or_url\fP
Reads script_filename_or_url content and execute it as a JavaScript script.
.IP -opt,\ -O\ \fIoptLevel\fP
Optimizes at level optLevel, which must be an integer between 0 and 9.
.IP -version\ \fIversionNumber\fP
Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions.
.IP -strict
Enable strict mode.
.SH EXAMPLE
Example debugging the NervousText.js applet written in JavaScript. The example is provided in the librhino-java-doc package.
$ rhino-debugger NervousText.js
.SH SEE ALSO
The online documentation under http://www.mozilla.org/rhino/debugger.html
.SH AUTHOR
This manual page was written by Damien Raude-Morvan <drazzib@debian.org>,
for the Debian project (but may be used by others).

6
rhino-idswitch Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
/usr/bin/java \
-classpath /usr/share/java/js.jar \
org.mozilla.javascript.tools.idswitch.Main \
"$@"

6
rhino-jsc Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
/usr/bin/java \
-classpath /usr/share/java/js.jar \
org.mozilla.javascript.tools.jsc.Main \
"$@"

67
rhino-jsc.1 Normal file
View File

@ -0,0 +1,67 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH RHINO-JSC 1 "February 12, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
rhino-jsc \- invokes the rhino JavaScript compiler
.SH SYNOPSIS
.B rhino-jsc
.I [options]
.I file1.js
.I [file2.js\&.\&.\&.]
.SH DESCRIPTION
This manual page documents briefly the
.B rhino-jsc
command.
This manual page was written for the Debian distribution because the original
program does not have a manual page. It is written according to the html documentation.
.PP
\fBrhino-jsc\fP is a start script for the rhino JavaScript compiler. The JavaScript compiler translates JavaScript source into Java class files. The resulting Java class files can then be loaded and executed at another time, providing a convenient method for transferring JavaScript, and for avoiding translation cost.
Note that the top-level functions available to the shell (such as print) are not available to compiled scripts when they are run outside the shell.
.SH OPTIONS
.IP -extends\ \fIjava_class_name\fP
Specifies that a java class extending the Java class java_class_name should be generated from the incoming JavaScript source file. Each global function in the source file is made a method of the generated class, overriding any methods in the base class by the same name.
.IP -implements\ \fIjava_intf_name\fP
Specifies that a java class implementing the Java interface java_intf_name should be generated from the incoming JavaScript source file. Each global function in the source file is made a method of the generated class, implementing any methods in the interface by the same name.
.IP -debug,\ -g
Specifies that debug information should be generated. May not be combined with optimization at an optLevel greater than zero.
.IP -nosource
Does not save the source in the class file. Functions and scripts compiled this way cannot be decompiled. This option can be used to avoid distributing source or simply to save space in the resulting class file.
.IP -o\ \fIoutputFile\fP
Writes the class file to the given file (which should end in .class). The string outputFile must be a writable filename.
.IP -opt,\ -O\ \fIoptLevel\fP
Optimizes at level optLevel, which must be an integer between 0 and 9.
.IP -package\ \fIpackageName\fP
Specifies the package to generate the class into. The string packageName must be composed of valid identifier characters optionally separated by periods.
.IP -version\ \fIversionNumber\fP
Specifies the language version to compile with. The string versionNumber must be one of 100, 110, 120, 130, or 140. See JavaScript Language Versions for more information on language versions.
.SH EXAMPLE
Example compiling the NervousText.js applet written in JavaScript. The example is provided in the librhino-java-doc package.
$ rhino-jsc \-extends java.applet.Applet \-implements java.lang.Runnable NervousText.js
.SH SEE ALSO
The online documentation under http://www.mozilla.org/rhino/jsc.html
.SH AUTHOR
This manual page was written by Wolfgang Baer <WBaer@gmx.de>,
for the Debian project (but may be used by others).