Fridrich Strba 2022-03-13 13:19:51 +00:00 committed by Git OBS Bridge
parent c11dd55ff8
commit 1bc5af7ce8
13 changed files with 316 additions and 399 deletions

BIN
Rhino1_7_14_Release.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:277478f81c160953976c198beceab61a0b23b5d2633a84effd9236284aa301b1
size 3002934

View File

@ -1,39 +1,31 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.14</version>
<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.
Full jar including tools, excluding the JSR-223 Script Engine wrapper.
</description>
<url>https://mozilla.github.io/rhino/</url>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<name>Mozilla Rhino</name>
<version>1.7.7.1</version>
<packaging>jar</packaging>
<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.
</description>
<url>https://developer.mozilla.org/en/Rhino</url>
<licenses>
<license>
<name>Mozilla Public License, Version 2.0</name>
<url>http://www.mozilla.org/MPL/2.0/index.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:mozilla/rhino.git</connection>
<developerConnection>scm:git:git@github.com:mozilla/rhino.git</developerConnection>
<url>git@github.com:mozilla/rhino.git</url>
</scm>
<organization>
<name>The Mozilla Foundation</name>
<url>http://www.mozilla.org</url>

View File

@ -1,33 +0,0 @@
Index: src/manifest
===================================================================
--- src/manifest.orig
+++ src/manifest
@@ -4,3 +4,28 @@ Implementation-Version: 1.7.7.1
Implementation-Title: Mozilla Rhino 1.7.7.1
Implementation-Vendor: Mozilla Foundation
Implementation-URL: http://www.mozilla.org/rhino
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.mozilla.javascript
+Bundle-Version: 1.7.12
+Export-Package: org.mozilla.classfile,org.mozilla.javascript,org.mozil
+ la.javascript.debug,org.mozilla.javascript.jdk13,org.mozilla.javascri
+ pt.jdk15,org.mozilla.javascript.optimizer,org.mozilla.javascript.rege
+ xp,org.mozilla.javascript.serialize,org.mozilla.javascript.tools,org.
+ mozilla.javascript.tools.debugger,org.mozilla.javascript.tools.debugg
+ er.treetable,org.mozilla.javascript.tools.idswitch,org.mozilla.javasc
+ ript.tools.jsc,org.mozilla.javascript.tools.shell,org.mozilla.javascr
+ ipt.xml,org.mozilla.javascript.xml.impl.xmlbeans,org.mozilla.javascri
+ pt.xmlimpl
+Bundle-ManifestVersion: 2
+Import-Package: javax.swing;resolution:=optional,javax.swing.border;re
+ solution:=optional,javax.swing.event;resolution:=optional,javax.swing
+ .filechooser;resolution:=optional,javax.swing.table;resolution:=optio
+ nal,javax.swing.text;resolution:=optional,javax.swing.tree;resolution
+ :=optional,javax.xml.namespace;resolution:=optional,javax.xml.parsers
+ ;resolution:=optional,javax.xml.transform;resolution:=optional,javax.
+ xml.transform.dom;resolution:=optional,javax.xml.transform.stream;res
+ olution:=optional,org.w3c.dom;resolution:=optional,org.xml.sax;resolu
+ tion:=optional

View File

@ -1,175 +0,0 @@
--- examples/Matrix.java
+++ examples/Matrix.java
@@ -218,7 +218,7 @@ public class Matrix implements Scriptabl
* 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]";
}
--- examples/PrimitiveWrapFactory.java
+++ examples/PrimitiveWrapFactory.java
@@ -25,7 +25,7 @@ import org.mozilla.javascript.*;
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)
--- src/org/mozilla/javascript/WrapFactory.java
+++ src/org/mozilla/javascript/WrapFactory.java
@@ -42,7 +42,7 @@ public class WrapFactory
* @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)
--- toolsrc/org/mozilla/javascript/tools/debugger/build.xml
+++ toolsrc/org/mozilla/javascript/tools/debugger/build.xml
@@ -8,7 +8,7 @@
<target name="properties">
<property name="swing-ex-url" value="http://java.sun.com/products/jfc/tsc/articles/treetable2/downloads/src.zip"/>
- <available file="downloaded/AbstractCellEditor.java"
+ <available file="treetable/AbstractCellEditor.java"
property="swing-ex-available"/>
</target>
@@ -16,9 +16,9 @@
<!-- Download source from Sun's site, unzip it, remove
the files we don't need, and change the package
-->
- <mkdir dir="downloaded"/>
- <get src="${swing-ex-url}" dest="downloaded/swingExSrc.zip"/>
- <unzip src="downloaded/swingExSrc.zip" dest="downloaded/">
+ <mkdir dir="treetable"/>
+ <get src="${swing-ex-url}" dest="treetable/swingExSrc.zip"/>
+ <unzip src="treetable/swingExSrc.zip" dest="downloaded/">
<patternset>
<include name="AbstractCellEditor.java"/>
<include name="JTreeTable.java"/>
@@ -26,58 +26,58 @@
<include name="TreeTableModelAdapter.java"/>
</patternset>
</unzip>
- <replace file="downloaded/AbstractCellEditor.java">
+ <replace file="treetable/AbstractCellEditor.java">
<replacetoken>import java.awt.Component;</replacetoken>
<replacevalue>
-package org.mozilla.javascript.tools.debugger.downloaded;
+package org.mozilla.javascript.tools.debugger.treetable;
</replacevalue>
</replace>
- <replace file="downloaded/AbstractCellEditor.java">
+ <replace file="treetable/AbstractCellEditor.java">
<replacetoken>import java.awt.event.*;</replacetoken>
<replacevalue></replacevalue>
</replace>
- <replace file="downloaded/AbstractCellEditor.java">
+ <replace file="treetable/AbstractCellEditor.java">
<replacetoken>import java.awt.AWTEvent;</replacetoken>
<replacevalue></replacevalue>
</replace>
- <replace file="downloaded/AbstractCellEditor.java">
+ <replace file="treetable/AbstractCellEditor.java">
<replacetoken>import java.io.Serializable;</replacetoken>
<replacevalue></replacevalue>
</replace>
- <replace file="downloaded/JTreeTable.java">
+ <replace file="treetable/JTreeTable.java">
<replacetoken>import javax.swing.*;</replacetoken>
<replacevalue>
- package org.mozilla.javascript.tools.debugger.downloaded;
+ package org.mozilla.javascript.tools.debugger.treetable;
import javax.swing.*;
</replacevalue>
</replace>
- <replace file="downloaded/JTreeTable.java">
+ <replace file="treetable/JTreeTable.java">
<replacetoken>class ListToTreeSelectionModelWrapper</replacetoken>
<replacevalue>public class ListToTreeSelectionModelWrapper</replacevalue>
</replace>
- <replace file="downloaded/JTreeTable.java">
+ <replace file="treetable/JTreeTable.java">
<replacetoken>ListSelectionModel getListSelectionModel</replacetoken>
<replacevalue>public ListSelectionModel getListSelectionModel</replacevalue>
</replace>
- <replace file="downloaded/JTreeTable.java">
+ <replace file="treetable/JTreeTable.java">
<replacetoken>import java.awt.Rectangle;</replacetoken>
<replacevalue></replacevalue>
</replace>
- <replace file="downloaded/TreeTableModel.java">
+ <replace file="treetable/TreeTableModel.java">
<replacetoken>import javax.swing.tree.TreeModel;</replacetoken>
<replacevalue>
- package org.mozilla.javascript.tools.debugger.downloaded;
+ package org.mozilla.javascript.tools.debugger.treetable;
import javax.swing.tree.TreeModel;
</replacevalue>
</replace>
- <replace file="downloaded/TreeTableModelAdapter.java">
+ <replace file="treetable/TreeTableModelAdapter.java">
<replacetoken>import javax.swing.JTree;</replacetoken>
<replacevalue>
- package org.mozilla.javascript.tools.debugger.downloaded;
+ package org.mozilla.javascript.tools.debugger.treetable;
import javax.swing.JTree;
</replacevalue>
</replace>
- <delete file="downloaded/swingExSrc.zip"/>
+ <delete file="treetable/swingExSrc.zip"/>
</target>
<target name="download" depends="properties,get-swing-ex"/>
--- toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java
+++ toolsrc/org/mozilla/javascript/tools/shell/JavaPolicySecurity.java
@@ -36,7 +36,7 @@ public class JavaPolicySecurity extends
return super.defineClass(name, data, 0, data.length, domain);
}
- public void linkClass(Class<?> cl) {
+ public void linkClass(Class cl) {
resolveClass(cl);
}
}
--- xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java
+++ xmlimplsrc/org/mozilla/javascript/xmlimpl/Namespace.java
@@ -86,7 +86,7 @@ class Namespace extends IdScriptableObje
}
@Override
- public Object getDefaultValue(Class<?> hint) {
+ public Object getDefaultValue(Class hint) {
return uri();
}
--- xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java
+++ xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java
@@ -116,7 +116,7 @@ final class QName extends IdScriptableOb
}
@Override
- public Object getDefaultValue(Class<?> hint) {
+ public Object getDefaultValue(Class hint) {
return toString();
}
--- xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java
+++ xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java
@@ -105,7 +105,7 @@ abstract class XMLObjectImpl extends XML
}
@Override
- public final Object getDefaultValue(Class<?> hint) {
+ public final Object getDefaultValue(Class hint) {
return this.toString();
}

159
rhino-build.xml Normal file
View File

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="rhino" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property name="project.groupId" value="org.mozilla"/>
<property name="project.artifactId" value="rhino"/>
<property name="project.artifactId.engine" value="rhino-engine"/>
<property name="project.artifactId.runtime" value="rhino-runtime"/>
<property name="project.version" value="1.7.14"/>
<property name="compiler.source" value="1.8"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src"/>
<property name="build.srcDirTool" value="toolsrc"/>
<property name="build.srcDirXmlImpl" value="xmlimplsrc"/>
<property name="build.resourceDir" value="src"/>
<property name="build.resourceDirTool" value="toolsrc"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
nowarn="false"
debug="true"
encoding="utf-8"
optimize="false"
deprecation="true"
target="${compiler.target}"
verbose="false"
fork="false"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
<pathelement location="${build.srcDirTool}"/>
<pathelement location="${build.srcDirXmlImpl}"/>
</src>
</javac>
<copy todir="${build.outputDir}">
<fileset dir="${build.resourceDir}">
<exclude name="**/*.java"/>
</fileset>
<fileset dir="${build.resourceDirTool}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="${compiler.source}"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
encoding="utf-8"
linksource="false"
breakiterator="false">
<sourcepath>
<pathelement location="${build.srcDir}"/>
<pathelement location="${build.srcDirTool}"/>
<pathelement location="${build.srcDirXmlImpl}"/>
</sourcepath>
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${project.artifactId}-${project.version}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html, org/mozilla/javascript/engine/**, META-INF/services/**">
<manifest>
<attribute name="Automatic-Module-Name" value="org.mozilla.rhino"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-SymbolicName" value="org.mozilla.rhino"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="org.mozilla.javascript,org.mozilla.javascript.annotations,org.mozilla.javascript.ast"/>
<attribute name="Implementation-Title" value="Mozilla Rhino"/>
<attribute name="Implementation-URL" value="http://www.mozilla.org/rhino"/>
<attribute name="Implementation-Vendor" value="Mozilla Foundation"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Main-Class" value="org.mozilla.javascript.tools.shell.Main"/>
</manifest>
</jar>
<jar jarfile="${build.dir}/${project.artifactId.engine}-${project.version}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
includes="**/package.html, org/mozilla/javascript/engine/**, META-INF/services/**">
<manifest>
<attribute name="Automatic-Module-Name" value="org.mozilla.rhino.engine"/>
<attribute name="Implementation-Title" value="Mozilla Rhino ScriptEngine"/>
<attribute name="Implementation-URL" value="http://www.mozilla.org/rhino"/>
<attribute name="Implementation-Vendor" value="Mozilla Foundation"/>
<attribute name="Implementation-Version" value="${project.version}"/>
</manifest>
</jar>
<jar jarfile="${build.dir}/${project.artifactId.runtime}-${project.version}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html, org/mozilla/javascript/tools/**, org/mozilla/javascript/engine/**, META-INF/services/**">
<manifest>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-SymbolicName" value="org.mozilla.rhino-runtime"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="org.mozilla.javascript,org.mozilla.javascript.annotations,org.mozilla.javascript.ast"/>
<attribute name="Implementation-Title" value="Mozilla Rhino"/>
<attribute name="Implementation-URL" value="http://www.mozilla.org/rhino"/>
<attribute name="Implementation-Vendor" value="Mozilla Foundation"/>
<attribute name="Implementation-Version" value="${project.version}"/>
</manifest>
</jar>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

View File

@ -1,31 +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.debugger.Main
BASE_FLAGS="-Xbootclasspath/p:$(build-classpath rhino jline xmlbeans/xbean)"
BASE_JARS="rhino jline xmlbeans/xbean"
# Set parameters
set_jvm
set_classpath $BASE_JARS
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

38
rhino-engine-1.7.14.pom Normal file
View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mozilla</groupId>
<artifactId>rhino-engine</artifactId>
<version>1.7.14</version>
<description>
Rhino Javascript JSR-223 Script Engine wrapper.
</description>
<url>https://mozilla.github.io/rhino/</url>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<licenses>
<license>
<name>Mozilla Public License, Version 2.0</name>
<url>http://www.mozilla.org/MPL/2.0/index.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:mozilla/rhino.git</connection>
<developerConnection>scm:git:git@github.com:mozilla/rhino.git</developerConnection>
<url>git@github.com:mozilla/rhino.git</url>
</scm>
<organization>
<name>The Mozilla Foundation</name>
<url>http://www.mozilla.org</url>
</organization>
<dependencies>
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.14</version>
</dependency>
</dependencies>
</project>

View File

@ -1,31 +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.idswitch.Main
BASE_FLAGS="-Xbootclasspath/p:$(build-classpath rhino xmlbeans/xbean)"
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,31 +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.jsc.Main
BASE_FLAGS="-Xbootclasspath/p:$(build-classpath rhino1 xmlbeans/xbean)"
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 "$@"

31
rhino-runtime-1.7.14.pom Normal file
View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.mozilla</groupId>
<artifactId>rhino-runtime</artifactId>
<version>1.7.14</version>
<description>
Rhino JavaScript runtime jar, excludes tools &amp; JSR-223 Script Engine wrapper.
</description>
<url>https://mozilla.github.io/rhino/</url>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<licenses>
<license>
<name>Mozilla Public License, Version 2.0</name>
<url>http://www.mozilla.org/MPL/2.0/index.txt</url>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:mozilla/rhino.git</connection>
<developerConnection>scm:git:git@github.com:mozilla/rhino.git</developerConnection>
<url>git@github.com:mozilla/rhino.git</url>
</scm>
<organization>
<name>The Mozilla Foundation</name>
<url>http://www.mozilla.org</url>
</organization>
</project>

View File

@ -1,31 +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_FLAGS="-Xbootclasspath/p:$(build-classpath rhino jline1 xmlbeans/xbean)"
BASE_JARS="rhino jline 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,7 +1,7 @@
#
# spec file for package rhino
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2000-2009, JPackage Project
#
# All modifications and additions to the file contributed by third parties
@ -17,28 +17,24 @@
#
%define scm_version 1_7_7_1
%define scm_version 1_7_14
Name: rhino
Version: 1.7.7.1
Version: 1.7.14
Release: 0
Summary: JavaScript for Java
License: MPL-2.0
Group: Development/Libraries/Java
URL: https://www.mozilla.org/rhino/
Source0: https://github.com/mozilla/rhino/archive/Rhino%{scm_version}_RELEASE.tar.gz
Source0: https://github.com/mozilla/rhino/archive/Rhino%{scm_version}_Release.tar.gz
Source1: https://repo1.maven.org/maven2/org/mozilla/rhino/%{version}/rhino-%{version}.pom
Source2: rhino.script
Source3: rhino-debugger.script
Source4: rhino-idswitch.script
Source5: rhino-jsc.script
Patch0: rhino-build.patch
# Add OSGi metadata from Eclipse Orbit project
Patch1: rhino-addOrbitManifest.patch
Source2: https://repo1.maven.org/maven2/org/mozilla/rhino-engine/%{version}/rhino-engine-%{version}.pom
Source3: https://repo1.maven.org/maven2/org/mozilla/rhino-runtime/%{version}/rhino-runtime-%{version}.pom
Source10: %{name}-build.xml
BuildRequires: ant
BuildRequires: java-devel >= 1.7
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
Requires: javapackages-tools
Requires: jline1
BuildArch: noarch
%description
@ -46,6 +42,19 @@ 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 engine
Summary: Rhino Engine
Requires: %{name} = %{version}
%description engine
Rhino Javascript JSR-223 Script Engine wrapper.
%package runtime
Summary: Rhino Runtime
%description runtime
Rhino JavaScript runtime jar, excludes tools & JSR-223 Script Engine wrapper.
%package demo
Summary: Examples for %{name}
Group: Development/Libraries/Java
@ -53,30 +62,30 @@ Group: Development/Libraries/Java
%description demo
Examples for %{name}
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
API documentation for %{name}.
%prep
%setup -q -n %{name}-Rhino%{scm_version}_RELEASE
%patch0 -b .build
%patch1 -b .fixManifest
%setup -q -n %{name}-Rhino%{scm_version}_Release
cp %{SOURCE10} build.xml
cp %{SOURCE1} pom.xml
%pom_remove_parent
# Fix manifest
sed -i -e '/^Class-Path:.*$/d' src/manifest
# Add jpp release info to version
sed -i -e 's|^implementation.version: Rhino .* release .* \${implementation.date}|implementation.version: Rhino %{version} release %{release} \${implementation.date}|' build.properties
cp %{SOURCE2} pom-engine.xml
cp %{SOURCE3} pom-runtime.xml
%pom_remove_parent pom.xml pom-engine.xml pom-runtime.xml
%build
%{ant} \
-Dtarget-jvm=6 -Dsource-level=6 \
deepclean jar copy-all
%{ant} jar javadoc
pushd examples
export CLASSPATH=../build/%{name}%{version}/js.jar
SOURCEPATH=../build/%{name}%{version}/src
%javac -sourcepath ${SOURCEPATH} -source 6 -target 6 *.java
%jar cvf ../build/%{name}%{version}/%{name}-examples.jar *.class
export CLASSPATH=../target/%{name}-%{version}.jar
SOURCEPATH=../src
%javac -sourcepath ${SOURCEPATH} -source 8 -target 8 *.java
%jar cvf ../target/%{name}-examples-%{version}.jar *.class
popd
@ -87,40 +96,60 @@ mkdir -p %{buildroot}%{_mandir}/man1/
install -m 644 man/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
# jars
mkdir -p %{buildroot}%{_javadir}
cp -a build/%{name}%{version}/js.jar %{buildroot}%{_javadir}/%{name}.jar
install -dm 0755 %{buildroot}%{_javadir}
install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
ln -s %{name}.jar %{buildroot}%{_javadir}/js.jar
install -pm 0644 target/%{name}-engine-%{version}.jar %{buildroot}%{_javadir}/%{name}-engine.jar
install -pm 0644 target/%{name}-runtime-%{version}.jar %{buildroot}%{_javadir}/%{name}-runtime.jar
# pom
mkdir -p %{buildroot}%{_mavenpomdir}
cp -a pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
install -dm 0755 %{buildroot}%{_mavenpomdir}
install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a "rhino:js"
install -pm 0644 pom-engine.xml %{buildroot}%{_mavenpomdir}/%{name}-engine.pom
%add_maven_depmap %{name}-engine.pom %{name}-engine.jar -f engine
install -pm 0644 pom-runtime.xml %{buildroot}%{_mavenpomdir}/%{name}-runtime.pom
%add_maven_depmap %{name}-runtime.pom %{name}-runtime.jar -f runtime
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}
# scripts
mkdir -p %{buildroot}%{_bindir}
install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{name}
install -m 0755 %{SOURCE3} %{buildroot}%{_bindir}/%{name}-debugger
install -m 0755 %{SOURCE4} %{buildroot}%{_bindir}/%{name}-idswitch
install -m 0755 %{SOURCE5} %{buildroot}%{_bindir}/%{name}-jsc
%jpackage_script org.mozilla.javascript.tools.shell.Main "" "" rhino rhino true
%jpackage_script org.mozilla.javascript.tools.debugger.Main "" "" rhino rhino-debugger true
%jpackage_script org.mozilla.javascript.tools.jsc.Main "" "" rhino rhino-jsc true
# examples
mkdir -p %{buildroot}%{_datadir}/%{name}
install -dm 0755 %{buildroot}%{_datadir}/%{name}
cp -a examples/* %{buildroot}%{_datadir}/%{name}
cp -a build/%{name}%{version}/%{name}-examples.jar %{buildroot}%{_javadir}/%{name}-examples.jar
find %{buildroot}%{_datadir}/%{name} -name '*.build' -delete
install -pm 0644 target/%{name}-examples-%{version}.jar %{buildroot}%{_javadir}/%{name}-examples.jar
%fdupes -s %{buildroot}%{_datadir}/%{name}
%files -f .mfiles
%license LICENSE.txt
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}-debugger
%attr(0755,root,root) %{_bindir}/%{name}-idswitch
%attr(0755,root,root) %{_bindir}/%{name}-jsc
%{_javadir}/js.jar
%{_javadir}/%{name}-examples.jar
%{_mandir}/man1/%{name}.1%{?ext_man}
%license LICENSE.txt NOTICE.txt NOTICE-tools.txt
%doc README.md CODE_OF_CONDUCT.md RELEASE-NOTES.md
%files engine -f .mfiles-engine
%license LICENSE.txt
%doc README.md CODE_OF_CONDUCT.md RELEASE-NOTES.md
%files runtime -f .mfiles-runtime
%license LICENSE.txt NOTICE.txt
%doc README.md CODE_OF_CONDUCT.md RELEASE-NOTES.md
%files demo
%{_datadir}/%{name}
%files javadoc
%license LICENSE.txt
%{_javadocdir}/%{name}
%changelog