This commit is contained in:
commit
4bdc2fcc33
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
3
bsh-2.0b1-src.jar
Normal file
3
bsh-2.0b1-src.jar
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5a7c237b6547882dbbf2f4539a120dc26c9e6980884d7aebaa89514f5a3d475c
|
||||
size 930187
|
38
bsh2-asm.patch
Normal file
38
bsh2-asm.patch
Normal file
@ -0,0 +1,38 @@
|
||||
--- BeanShell/src/bsh/ClassGeneratorUtil.java~ 2004-01-23 15:27:23.000000000 -0500
|
||||
+++ BeanShell/src/bsh/ClassGeneratorUtil.java 2004-01-23 15:30:17.000000000 -0500
|
||||
@@ -297,7 +297,7 @@
|
||||
static void generateField(
|
||||
String fieldName, String type, int modifiers, ClassWriter cw )
|
||||
{
|
||||
- cw.visitField( modifiers, fieldName, type, null/*value*/ );
|
||||
+ cw.visitField( modifiers, fieldName, type, null, null );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -321,7 +321,7 @@
|
||||
|
||||
// Generate method body
|
||||
CodeVisitor cv = cw.visitMethod(
|
||||
- modifiers, methodName, methodDescriptor, exceptions );
|
||||
+ modifiers, methodName, methodDescriptor, exceptions, null );
|
||||
|
||||
if ( (modifiers & ACC_ABSTRACT) != 0 )
|
||||
return;
|
||||
@@ -399,7 +399,7 @@
|
||||
|
||||
// Create this constructor method
|
||||
CodeVisitor cv =
|
||||
- cw.visitMethod( modifiers, "<init>", methodDescriptor, exceptions );
|
||||
+ cw.visitMethod( modifiers, "<init>", methodDescriptor, exceptions, null );
|
||||
|
||||
// Generate code to push arguments as an object array
|
||||
generateParameterReifierCode( paramTypes, false/*isStatic*/, cv );
|
||||
@@ -601,7 +601,7 @@
|
||||
|
||||
// Add method body
|
||||
CodeVisitor cv = cw.visitMethod(
|
||||
- modifiers, "_bshSuper"+methodName, methodDescriptor, exceptions );
|
||||
+ modifiers, "_bshSuper"+methodName, methodDescriptor, exceptions, null );
|
||||
|
||||
cv.visitVarInsn(ALOAD, 0);
|
||||
// Push vars
|
54
bsh2-build.patch
Normal file
54
bsh2-build.patch
Normal file
@ -0,0 +1,54 @@
|
||||
--- BeanShell/build.xml.orig 2004-01-20 19:12:20.888557245 -0500
|
||||
+++ BeanShell/build.xml 2004-01-20 19:13:36.150184282 -0500
|
||||
@@ -103,50 +103,7 @@
|
||||
value="docs/manual/bshcommands-bshdoc.xml"/>
|
||||
|
||||
<!-- Begin Targets -->
|
||||
-
|
||||
- <!-- The javacc targets could be smarter... -->
|
||||
- <target name="checkjjt">
|
||||
- <uptodate property="jjtree.notRequired"
|
||||
- targetfile="${src-dir}/bsh/bsh.jj"
|
||||
- >
|
||||
- <srcfiles dir="${src-dir}/bsh" includes="bsh.jjt"/>
|
||||
- </uptodate>
|
||||
- </target>
|
||||
- <target name="checkjj">
|
||||
- <uptodate property="javacc.notRequired"
|
||||
- targetfile="${src-dir}/bsh/Parser.java"
|
||||
- >
|
||||
- <srcfiles dir="${src-dir}/bsh" includes="bsh.jj"/>
|
||||
- </uptodate>
|
||||
- </target>
|
||||
-
|
||||
- <!-- Create bsh.jj when bsh.jjt changes. -->
|
||||
- <target name="jjtree" unless="jjtree.notRequired" depends="checkjjt">
|
||||
- <java classname="jjtree"
|
||||
- fork="yes"
|
||||
- failonerror="yes" >
|
||||
- <arg
|
||||
- line="-OUTPUT_DIRECTORY=${src-dir}/bsh ${src-dir}/bsh/bsh.jjt"/>
|
||||
- <classpath>
|
||||
- <fileset refid="lib-fileset"/>
|
||||
- </classpath>
|
||||
- </java>
|
||||
- </target>
|
||||
-
|
||||
- <!-- Create Parser.java when bsh.jj changes. -->
|
||||
- <target name="javacc" unless="javacc.notRequired" depends="checkjj">
|
||||
- <java classname="javacc"
|
||||
- fork="yes"
|
||||
- failonerror="yes" >
|
||||
- <!-- classpath="${javacc-lib}" -->
|
||||
- <arg line="-OUTPUT_DIRECTORY=${src-dir}/bsh ${src-dir}/bsh/bsh.jj"/>
|
||||
- <classpath>
|
||||
- <fileset refid="lib-fileset"/>
|
||||
- </classpath>
|
||||
- </java>
|
||||
- </target>
|
||||
-
|
||||
- <target name="compile" depends="jjtree,javacc,builddir">
|
||||
+ <target name="compile" depends="builddir">
|
||||
<!-- exclude the ${excludes} as well as anything under a "bak" dir -->
|
||||
<!--compiler="${build-compiler}"-->
|
||||
<javac srcdir="${src-dir}:${test-src-dir}:${bsf-src-dir}"
|
15
bsh2-crosslink.patch
Normal file
15
bsh2-crosslink.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- BeanShell/build.xml~ 2005-02-06 01:01:16.972239864 -0500
|
||||
+++ BeanShell/build.xml 2005-02-06 01:02:38.549077772 -0500
|
||||
@@ -205,7 +205,11 @@
|
||||
windowtitle="BeanShell"
|
||||
doctitle="<h1>BeanShell<h1>"
|
||||
bottom="<em>© 2000 pat@pat.net :-)</em>"
|
||||
- />
|
||||
+ >
|
||||
+ <link href="${java.javadoc}" />
|
||||
+ <link href="${asm.javadoc}" />
|
||||
+ <link href="${bsf.javadoc}" />
|
||||
+ </javadoc>
|
||||
</target>
|
||||
|
||||
<!-- Jar target setup -->
|
12
bsh2-java14compat.patch
Normal file
12
bsh2-java14compat.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -Naur ../BeanShell.orig/build.xml ./build.xml
|
||||
--- ../BeanShell.orig/build.xml 2003-09-03 20:14:44.000000000 +0200
|
||||
+++ ./build.xml 2006-09-25 15:07:18.000000000 +0200
|
||||
@@ -167,6 +167,8 @@
|
||||
debug="off"
|
||||
includes="**/*.java"
|
||||
excludes="${excludes},**/bak/**"
|
||||
+ source="1.4"
|
||||
+ target="1.4"
|
||||
>
|
||||
<classpath>
|
||||
<fileset refid="lib-fileset"/>
|
13
bsh2-java15.patch
Normal file
13
bsh2-java15.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- BeanShell/src/bsh/ClassGeneratorUtil.java~ 2005-02-06 00:59:29.935574806 -0500
|
||||
+++ BeanShell/src/bsh/ClassGeneratorUtil.java 2005-02-06 00:59:42.395022497 -0500
|
||||
@@ -34,7 +34,9 @@
|
||||
package bsh;
|
||||
|
||||
import bsh.org.objectweb.asm.*;
|
||||
-import java.lang.reflect.*;
|
||||
+import java.lang.reflect.Constructor;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
159
bsh2-jedit.patch
Normal file
159
bsh2-jedit.patch
Normal file
@ -0,0 +1,159 @@
|
||||
diff -ur BeanShell.orig/src/bsh/BshMethod.java BeanShell/src/bsh/BshMethod.java
|
||||
--- BeanShell.orig/src/bsh/BshMethod.java 2003-09-03 19:53:04.000000000 -0400
|
||||
+++ BeanShell/src/bsh/BshMethod.java 2004-01-28 00:05:47.000000000 -0500
|
||||
@@ -163,13 +163,13 @@
|
||||
Note: this form of invoke() uses a null Node for the caller and a null
|
||||
node for the CallStack. This method is for scripts performing
|
||||
relective style access to scripted methods.
|
||||
+ */
|
||||
public Object invoke(
|
||||
Object[] argValues, Interpreter interpreter, CallStack callstack )
|
||||
throws EvalError
|
||||
{
|
||||
return invoke( argValues, interpreter, callstack, null, false );
|
||||
}
|
||||
- */
|
||||
|
||||
public Object invoke(
|
||||
Object[] argValues, Interpreter interpreter, CallStack callstack,
|
||||
diff -ur BeanShell.orig/src/bsh/NameSpace.java BeanShell/src/bsh/NameSpace.java
|
||||
--- BeanShell.orig/src/bsh/NameSpace.java 2003-09-03 19:53:06.000000000 -0400
|
||||
+++ BeanShell/src/bsh/NameSpace.java 2004-01-28 00:08:51.000000000 -0500
|
||||
@@ -238,6 +238,11 @@
|
||||
return getNameResolver( name ).toObject( callstack, interpreter );
|
||||
}
|
||||
|
||||
+ public void setVariable(String name, Object value) throws UtilEvalError
|
||||
+ {
|
||||
+ setVariable(name,value,false);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
Set the variable through this namespace.
|
||||
This method obeys the LOCALSCOPING property to determine how variables
|
||||
@@ -302,8 +307,12 @@
|
||||
variables = new Hashtable();
|
||||
|
||||
// primitives should have been wrapped
|
||||
- if ( value == null )
|
||||
- throw new InterpreterError("null variable value");
|
||||
+ if ( value == null ) {
|
||||
+ // don't break jEdit core and plugins by throwing InterpreterError!
|
||||
+ //throw new InterpreterError("null variable value");
|
||||
+ unsetVariable(name);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
// Locate the variable definition if it exists.
|
||||
Variable existing = getVariableImpl( name, recurse );
|
||||
@@ -876,6 +885,75 @@
|
||||
nameSpaceChanged();
|
||||
}
|
||||
|
||||
+ static class CommandPathEntry
|
||||
+ {
|
||||
+ String path;
|
||||
+ Class clas;
|
||||
+
|
||||
+ CommandPathEntry(String path, Class clas)
|
||||
+ {
|
||||
+ this.path = path;
|
||||
+ this.clas = clas;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ Adds a URL to the command path.
|
||||
+ */
|
||||
+ public void addCommandPath(String path, Class clas)
|
||||
+ {
|
||||
+ if(importedCommands == null)
|
||||
+ importedCommands = new Vector();
|
||||
+
|
||||
+ if(!path.endsWith("/"))
|
||||
+ path = path + "/";
|
||||
+ importedCommands.addElement(new CommandPathEntry(path,clas));
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ Remove a URLfrom the command path.
|
||||
+ */
|
||||
+ public void removeCommandPath(String path, Class clas)
|
||||
+ {
|
||||
+ if(importedCommands == null)
|
||||
+ return;
|
||||
+
|
||||
+ for(int i = 0; i < importedCommands.size(); i++)
|
||||
+ {
|
||||
+ CommandPathEntry entry = (CommandPathEntry)importedCommands
|
||||
+ .elementAt(i);
|
||||
+ if(entry.path.equals(path) && entry.clas == clas)
|
||||
+ {
|
||||
+ importedCommands.removeElementAt(i);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ Looks up a command.
|
||||
+ */
|
||||
+ public InputStream getCommand(String name)
|
||||
+ {
|
||||
+ if(importedCommands != null)
|
||||
+ {
|
||||
+ String extName = name + ".bsh";
|
||||
+ for(int i = importedCommands.size() - 1; i >= 0; i--)
|
||||
+ {
|
||||
+ CommandPathEntry entry = (CommandPathEntry)importedCommands
|
||||
+ .elementAt(i);
|
||||
+ InputStream in = entry.clas.getResourceAsStream(entry.path + extName);
|
||||
+ if(in != null)
|
||||
+ return in;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if(parent == null)
|
||||
+ return null;
|
||||
+ else
|
||||
+ return parent.getCommand(name);
|
||||
+ }
|
||||
+
|
||||
/**
|
||||
A command is a scripted method or compiled command class implementing a
|
||||
specified method signature. Commands are loaded from the classpath
|
||||
@@ -915,6 +993,16 @@
|
||||
// loop backwards for precedence
|
||||
for(int i=importedCommands.size()-1; i>=0; i--)
|
||||
{
|
||||
+ InputStream in;
|
||||
+
|
||||
+ if (importedCommands.elementAt(i) instanceof CommandPathEntry) {
|
||||
+ in = getCommand(name);
|
||||
+
|
||||
+ if ( in != null )
|
||||
+ return loadScriptedCommand(
|
||||
+ in, name, argTypes, ((CommandPathEntry) importedCommands.elementAt(i)).path + (((CommandPathEntry) importedCommands.elementAt(i)).path.startsWith("/") ? "" : "/") + name + ".bsh", interpreter );
|
||||
+ } else {
|
||||
+
|
||||
String path = (String)importedCommands.elementAt(i);
|
||||
|
||||
String scriptPath;
|
||||
@@ -925,8 +1013,7 @@
|
||||
|
||||
Interpreter.debug("searching for script: "+scriptPath );
|
||||
|
||||
- InputStream in = bcm.getResourceAsStream( scriptPath );
|
||||
-
|
||||
+ in = bcm.getResourceAsStream( scriptPath );
|
||||
if ( in != null )
|
||||
return loadScriptedCommand(
|
||||
in, name, argTypes, scriptPath, interpreter );
|
||||
@@ -943,6 +1030,7 @@
|
||||
if ( clas != null )
|
||||
return clas;
|
||||
}
|
||||
+ }
|
||||
}
|
||||
|
||||
if ( parent != null )
|
151
bsh2-readline.patch
Normal file
151
bsh2-readline.patch
Normal file
@ -0,0 +1,151 @@
|
||||
--- BeanShell/src/bsh/Interpreter.java~ 2003-09-03 19:56:58.000000000 -0400
|
||||
+++ BeanShell/src/bsh/Interpreter.java 2004-01-25 09:59:41.730059108 -0500
|
||||
@@ -38,6 +38,13 @@
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
+import bsh.util.BshCompleter;
|
||||
+import bsh.util.NameCompletionTable;
|
||||
+import bsh.classpath.ClassManagerImpl;
|
||||
+import org.gnu.readline.Readline;
|
||||
+import org.gnu.readline.ReadlineLibrary;
|
||||
+import org.gnu.readline.ReadlineReader;
|
||||
+
|
||||
/**
|
||||
The BeanShell script interpreter.
|
||||
|
||||
@@ -394,10 +401,59 @@
|
||||
else
|
||||
src = System.in;
|
||||
|
||||
- Reader in = new CommandLineReader( new InputStreamReader(src));
|
||||
- Interpreter interpreter =
|
||||
- new Interpreter( in, System.out, System.err, true );
|
||||
- interpreter.run();
|
||||
+ Reader in = null;
|
||||
+ boolean usingReadline = false;
|
||||
+ String backingLib = System.getProperty("bsh.console.readlinelib"); System.out.println("backingLib is " + backingLib);
|
||||
+ if (backingLib != null && backingLib.length() > 0) {
|
||||
+ try {
|
||||
+ File history = new File(System.getProperty("user.home") +
|
||||
+ File.separator + ".bsh_history");
|
||||
+ if (!history.exists()) {
|
||||
+ try {
|
||||
+ history.createNewFile();
|
||||
+ } catch(IOException ioe) {
|
||||
+ debug("Unable to create history " + history.getAbsolutePath());
|
||||
+ }
|
||||
+ }
|
||||
+ ReadlineLibrary lib = ReadlineLibrary.byName(backingLib);
|
||||
+ // should I wrap CommandLineReader around it?
|
||||
+ if (history.canWrite() && history.canRead()) {
|
||||
+ in = new ReadlineReader("bsh % ", history,lib);
|
||||
+ } else {
|
||||
+ in = new ReadlineReader("bsh % ",lib);
|
||||
+ debug("Unable to read/write history " + history.getAbsolutePath());
|
||||
+ }
|
||||
+ } catch (IOException ioe) {
|
||||
+ System.err.println("Unable to invoke ReadlineReader " +
|
||||
+ "due to: " + ioe);
|
||||
+ }
|
||||
+ }
|
||||
+ if (in == null)
|
||||
+ in = new CommandLineReader( new InputStreamReader(src));
|
||||
+ else
|
||||
+ usingReadline = true;
|
||||
+ Interpreter interpreter =
|
||||
+ new Interpreter( in, System.out, System.err, true );
|
||||
+ if (usingReadline) {
|
||||
+ NameCompletionTable nct = new NameCompletionTable();
|
||||
+ nct.add(interpreter.getNameSpace());
|
||||
+
|
||||
+ /** ClassManager does a lot of chatting to the stdout,
|
||||
+ * so this has been commented out for the time being
|
||||
+ **/
|
||||
+
|
||||
+// try {
|
||||
+// BshClassManager bcm = BshClassManager.getClassManager();
|
||||
+// if (bcm != null) {
|
||||
+// nct.add(((ClassManagerImpl)bcm).getClassPath());
|
||||
+// }
|
||||
+// } catch(ClassPathException cpe) {
|
||||
+// debug("classpath exception in name compl:" + cpe);
|
||||
+// }
|
||||
+
|
||||
+ Readline.setCompleter(new BshCompleter(nct));
|
||||
+ }
|
||||
+ interpreter.run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +501,7 @@
|
||||
System.err.flush();
|
||||
Thread.yield(); // this helps a little
|
||||
|
||||
- if ( interactive )
|
||||
+ if ( interactive && !(in instanceof ReadlineReader))
|
||||
print( getBshPrompt() );
|
||||
|
||||
eof = Line();
|
||||
@@ -548,10 +604,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
- if ( interactive && exitOnEOF )
|
||||
- System.exit(0);
|
||||
+ if ( interactive && exitOnEOF ) {
|
||||
+ /* should be done for all streams in general, but this
|
||||
+ * ensures that the history for readline is flushed */
|
||||
+ try {
|
||||
+ in.close();
|
||||
+ } catch (IOException ioe) {
|
||||
+ }
|
||||
+
|
||||
+ System.exit(0);
|
||||
}
|
||||
-
|
||||
+ }
|
||||
// begin source and eval
|
||||
|
||||
/**
|
||||
--- /dev/null 2003-10-19 02:52:03.000000000 -0400
|
||||
+++ BeanShell/src/bsh/util/BshCompleter.java 2004-01-25 10:14:10.184458217 -0500
|
||||
@@ -0,0 +1,38 @@
|
||||
+package bsh.util;
|
||||
+
|
||||
+import org.gnu.readline.ReadlineCompleter;
|
||||
+
|
||||
+/**
|
||||
+ * An adapter for org.gnu.readline's ReadlineCompleter interface to map to
|
||||
+ * BeanShell's NameCompleter interface.
|
||||
+ *
|
||||
+ * @see org.gnu.readline.ReadlineReader
|
||||
+ * @version $Revision: 1.1 $
|
||||
+ * @author Shane Celis <shane@terraspring.com>
|
||||
+ **/
|
||||
+public class BshCompleter implements ReadlineCompleter {
|
||||
+
|
||||
+ private NameCompletion completer;
|
||||
+
|
||||
+ /**
|
||||
+ * Constructs a <code>ReadlineCompleter</code> out of a
|
||||
+ * <code>NameCompleter</code> object.
|
||||
+ **/
|
||||
+ public BshCompleter(NameCompletion completer) {
|
||||
+ this.completer = completer;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns String of completion if unambiguous, otherwise null
|
||||
+ **/
|
||||
+ public String completer(String text, int state) {
|
||||
+ // Not sure what state is used for in ReadlineCompleter
|
||||
+ String[] completions = completer.completeName(text);
|
||||
+ if (completions.length == 1 && state == 0) {
|
||||
+ return completions[0];
|
||||
+ } else {
|
||||
+ return null; // ambiguous result
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
16
bsh2.changes
Normal file
16
bsh2.changes
Normal file
@ -0,0 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 25 15:16:21 CEST 2006 - skh@suse.de
|
||||
|
||||
- don't use icecream
|
||||
- use source="1.4" and target="1.4" for build with java 1.5
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 25 21:45:57 CET 2006 - mls@suse.de
|
||||
|
||||
- converted neededforbuild to BuildRequires
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 17 14:04:02 CEST 2005 - jsmeix@suse.de
|
||||
|
||||
- Current version 2.0 from JPackage.org
|
||||
|
11
bsh2.fix-visit.diff
Normal file
11
bsh2.fix-visit.diff
Normal file
@ -0,0 +1,11 @@
|
||||
--- BeanShell/src/bsh/ClassGeneratorUtil.java.orig 2005-10-17 13:04:55.000000000 +0200
|
||||
+++ BeanShell/src/bsh/ClassGeneratorUtil.java 2005-10-17 13:07:53.000000000 +0200
|
||||
@@ -188,7 +188,7 @@
|
||||
|
||||
String sourceFile = "BeanShell Generated via ASM (www.objectweb.org)";
|
||||
ClassWriter cw = new ClassWriter(false);
|
||||
- cw.visit( classMods, fqClassName, superClassName,
|
||||
+ cw.visit( 0, classMods, fqClassName, superClassName,
|
||||
interfaceNames, sourceFile );
|
||||
|
||||
if ( !isInterface )
|
308
bsh2.spec
Normal file
308
bsh2.spec
Normal file
@ -0,0 +1,308 @@
|
||||
#
|
||||
# spec file for package bsh2 (Version 2.0)
|
||||
#
|
||||
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
# package are under the same license as the package itself.
|
||||
#
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# icecream 0
|
||||
|
||||
Name: bsh2
|
||||
BuildRequires: ant asm asm-javadoc bsf bsf-javadoc java2-devel-packages xml-commons-apis
|
||||
%define name bsh2
|
||||
%define orig_name bsh
|
||||
%define Name BeanShell
|
||||
%define version 2.0
|
||||
%define fversion 2.0b1
|
||||
%define frelease 7jpp
|
||||
%define release 0.b1.%{frelease}
|
||||
%define section free
|
||||
Version: 2.0
|
||||
Release: 19
|
||||
Summary: Lightweight Scripting for Java (BeanShell Version 2.x)
|
||||
License: LGPL
|
||||
URL: http://www.beanshell.org/
|
||||
Source0: http://www.beanshell.org/bsh-2.0b1-src.jar
|
||||
Patch0: %{name}-build.patch
|
||||
Patch1: %{name}-readline.patch
|
||||
Patch2: %{name}-asm.patch
|
||||
Patch3: %{name}-jedit.patch
|
||||
Patch4: %{name}-java15.patch
|
||||
Patch5: %{name}-crosslink.patch
|
||||
Patch10: bsh2.fix-visit.diff
|
||||
Patch11: %{name}-java14compat.patch
|
||||
Requires: jpackage-utils >= 1.5
|
||||
#BuildRequires: libreadline-java
|
||||
Group: Development/Libraries/Java
|
||||
Buildarch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
BeanShell is a small, free, embeddable, Java source interpreter with
|
||||
object scripting language features, written in Java. BeanShell executes
|
||||
standard Java statements and expressions, in addition to obvious
|
||||
scripting commands and syntax. BeanShell supports scripted objects as
|
||||
simple method closures like those in Perl and JavaScript(tm). You can
|
||||
use BeanShell interactively for Java experimentation and debugging or
|
||||
as a simple scripting engine for your applications. In short: BeanShell
|
||||
is a dynamically interpreted Java, plus some useful stuff. Another way
|
||||
to describe it is to say that in many ways BeanShell is to Java as
|
||||
Tcl/Tk is to C: BeanShell is embeddable - You can call BeanShell from
|
||||
your Java applications to execute Java code dynamically at run-time or
|
||||
to provide scripting extensibility for your applications.
|
||||
Alternatively, you can call your Java applications and objects from
|
||||
BeanShell; working with Java objects and APIs dynamically. Since
|
||||
BeanShell is written in Java and runs in the same space as your
|
||||
application, you can freely pass references to "real live" objects into
|
||||
scripts and return them as results.
|
||||
|
||||
With version 2.0 BeanShell becomes a fully Java compatible scripting
|
||||
language. BeanShell is now capable of interpreting ordinary Java source
|
||||
and loading .java source files from the class path. BeanShell scripted
|
||||
classes are fully typed and appear to outside Java code and via
|
||||
reflective inspection as ordinary classes. However their implementation
|
||||
is fully dynamic and they may include arbitrary BeanShell scripts in
|
||||
their bodies, methods, and constructors. Users may now freely mix
|
||||
loose, unstructured BeanShell scripts, method closures, and full
|
||||
scripted classes.
|
||||
|
||||
|
||||
|
||||
%package bsf
|
||||
Summary: Lightweight Scripting for Java (BeanShell Version 2.x) (BSF support)
|
||||
Group: Development/Libraries/Java
|
||||
Requires: bsf
|
||||
|
||||
%description bsf
|
||||
BSF support for bsh2.
|
||||
|
||||
|
||||
|
||||
%package classgen
|
||||
Summary: Lightweight Scripting for Java (BeanShell Version 2.x) (ASM support)
|
||||
Group: Development/Libraries/Java
|
||||
Requires: asm
|
||||
|
||||
%description classgen
|
||||
ASM support for bsh2.
|
||||
|
||||
|
||||
|
||||
%package manual
|
||||
Summary: Lightweight Scripting for Java (BeanShell Version 2.x) (Manual)
|
||||
Group: Development/Libraries/Java
|
||||
|
||||
%description manual
|
||||
Documentation for bsh2.
|
||||
|
||||
|
||||
|
||||
%package javadoc
|
||||
PreReq: coreutils
|
||||
Summary: Lightweight Scripting for Java (BeanShell Version 2.x) (Java Documentation)
|
||||
Group: Development/Libraries/Java
|
||||
|
||||
%description javadoc
|
||||
Javadoc for bsh2.
|
||||
|
||||
|
||||
|
||||
%package demo
|
||||
Summary: Lightweight Scripting for Java (BeanShell Version 2.x) (demo and samples)
|
||||
Group: Development/Libraries/Java
|
||||
AutoReqProv: no
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description demo
|
||||
Demonstrations and samples for bsh2.
|
||||
|
||||
|
||||
|
||||
%prep
|
||||
|
||||
%__rm -rf $RPM_BUILD_DIR/META-INF
|
||||
%setup -q -n %{Name}
|
||||
%patch0 -p1
|
||||
#%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch10 -p1
|
||||
%patch11
|
||||
find . -name "*.jar" -exec %__rm -f {} \;
|
||||
# remove all CVS files
|
||||
for dir in `find . -type d -name CVS`; do %__rm -rf $dir; done
|
||||
for file in `find . -type f -name .cvsignore`; do %__rm -rf $file; done
|
||||
|
||||
%build
|
||||
|
||||
%__mkdir_p lib
|
||||
export CLASSPATH=$(build-classpath asm/asm bsf)
|
||||
# set VERSION
|
||||
|
||||
%__perl -p -i -e 's|VERSION =.*;|VERSION = "%{version}-%{release}";|' src/bsh/Interpreter.java
|
||||
# remove internal asm code, use JPackage external jar instead
|
||||
|
||||
%__rm -rf src/bsh/org
|
||||
|
||||
%__perl -p -i -e 's|bsh.org.objectweb.asm|org.objectweb.asm|' src/bsh/ClassGeneratorUtil.java
|
||||
# remove servlet dependency
|
||||
|
||||
%__rm -rf src/bsh/servlet
|
||||
|
||||
%ant -Dexclude-servlet='bsh/servlet/*' \
|
||||
-Dasm.javadoc=%{_javadocdir}/asm \
|
||||
-Dbsf.javadoc=%{_javadocdir}/bsf \
|
||||
-Djava.javadoc=%{_javadocdir}/java \
|
||||
dist
|
||||
(cd docs/faq && %ant)
|
||||
(cd docs/manual && %ant)
|
||||
|
||||
%install
|
||||
# jars
|
||||
|
||||
%__mkdir_p %{buildroot}%{_javadir}/%{name}
|
||||
|
||||
%__rm -f dist/%{orig_name}-%{fversion}.jar
|
||||
|
||||
%__rm -f dist/%{orig_name}-%{fversion}-src.jar
|
||||
for jar in dist/*.jar; do
|
||||
%__install -m 644 ${jar} %{buildroot}%{_javadir}/%{name}/`basename ${jar} -%{fversion}.jar`-%{version}.jar
|
||||
done
|
||||
(cd %{buildroot}%{_javadir}/%{name} && for jar in *-%{version}*; do %__ln_s ${jar} ${jar/-%{version}/}; done)
|
||||
# manual
|
||||
find docs -name ".cvswrappers" -exec %__rm -f {} \;
|
||||
find docs -name "*.xml" -exec %__rm -f {} \;
|
||||
find docs -name "*.xsl" -exec %__rm -f {} \;
|
||||
find docs -name "*.log" -exec %__rm -f {} \;
|
||||
(cd docs/manual && %__mv -f html/* .)
|
||||
(cd docs/manual && %__rm -rf html)
|
||||
(cd docs/manual && %__rm -rf xsl)
|
||||
# javadoc
|
||||
|
||||
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
|
||||
|
||||
%__cp -a javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
|
||||
(cd %{buildroot}%{_javadocdir} && %__ln_s %{name}-%{version} %{name})
|
||||
# demo
|
||||
for i in `find tests -name "*.bsh"`; do
|
||||
%__perl -p -i -e 's,^\n?#!(/(usr/)?bin/java bsh\.Interpreter|/bin/sh),#!%{_bindir}/%{name},' $i
|
||||
done
|
||||
|
||||
%__mkdir_p %{buildroot}%{_datadir}/%{name}
|
||||
|
||||
%__cp -a tests %{buildroot}%{_datadir}/%{name}
|
||||
find %{buildroot}%{_datadir}/%{name} -type d \
|
||||
| sed 's|'%{buildroot}'|%dir |' > %{name}-demo-%{version}.files
|
||||
find %{buildroot}%{_datadir}/%{name} -type f -name "*.bsh" \
|
||||
| sed 's|'%{buildroot}'|%attr(0755,root,root) |' >> %{name}-demo-%{version}.files
|
||||
find %{buildroot}%{_datadir}/%{name} -type f ! -name "*.bsh" \
|
||||
| sed 's|'%{buildroot}'|%attr(0644,root,root) |' >> %{name}-demo-%{version}.files
|
||||
# scripts
|
||||
|
||||
%__mkdir_p %{buildroot}%{_bindir}
|
||||
|
||||
%__cat > %{buildroot}%{_bindir}/%{name} << EOF
|
||||
#!/bin/sh
|
||||
#
|
||||
# %{name} script
|
||||
# JPackage Project (http://jpackage.sourceforge.net)
|
||||
# Source functions library
|
||||
. %{_datadir}/java-utils/java-functions
|
||||
# Source system prefs
|
||||
if [ -f %{_sysconfdir}/%{name}.conf ] ; then
|
||||
. %{_sysconfdir}/%{name}.conf
|
||||
fi
|
||||
# Source user prefs
|
||||
if [ -f \$HOME/.%{name}rc ] ; then
|
||||
. \$HOME/.%{name}rc
|
||||
fi
|
||||
# Configuration
|
||||
MAIN_CLASS=bsh.Interpreter
|
||||
if [ -n "\$BSH_DEBUG" ]; then
|
||||
BASE_FLAGS=-Ddebug=true
|
||||
fi
|
||||
BASE_JARS="%{name}.jar"
|
||||
#if [ -f /usr/lib/libJavaReadline.so ]; then
|
||||
# BASE_FLAGS="$BASE_FLAGS -Djava.library.path=/usr/lib"
|
||||
# BASE_FLAGS="\$BASE_FLAGS -Dbsh.console.readlinelib=GnuReadline"
|
||||
# BASE_JARS="\$BASE_JARS libreadline-java.jar"
|
||||
#fi
|
||||
# Set parameters
|
||||
set_jvm
|
||||
set_classpath \$BASE_JARS
|
||||
set_flags \$BASE_FLAGS
|
||||
set_options \$BASE_OPTIONS
|
||||
# Let's start
|
||||
run "\$@"
|
||||
EOF
|
||||
|
||||
%__cat > %{buildroot}%{_bindir}/%{name}doc << EOF
|
||||
#!/usr/bin/env %{_bindir}/%{name}
|
||||
EOF
|
||||
|
||||
%__cat scripts/bshdoc.bsh >> %{buildroot}%{_bindir}/%{name}doc
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%__rm -rf $RPM_BUILD_DIR/META-INF
|
||||
|
||||
%post javadoc
|
||||
|
||||
%__rm -f %{_javadocdir}/%{name}
|
||||
|
||||
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}
|
||||
|
||||
%postun javadoc
|
||||
if [ $1 -eq 0 ]; then
|
||||
%__rm -f %{_javadocdir}/%{name}
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(0644,root,root,0755)
|
||||
%doc bsh20announce.txt CVS_branching KNOWNBUGS Notes TODO src/Changes.html src/License.txt src/README.txt
|
||||
%attr(0755,root,root) %{_bindir}/%{name}
|
||||
%attr(0755,root,root) %{_bindir}/%{name}doc
|
||||
%dir %{_javadir}/%{name}
|
||||
%{_javadir}/%{name}/%{orig_name}-classpath*.jar
|
||||
%{_javadir}/%{name}/%{orig_name}-commands*.jar
|
||||
%{_javadir}/%{name}/%{orig_name}-core*.jar
|
||||
%{_javadir}/%{name}/%{orig_name}-reflect*.jar
|
||||
%{_javadir}/%{name}/%{orig_name}-util*.jar
|
||||
%dir %{_datadir}/%{name}
|
||||
|
||||
%files bsf
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/%{name}/%{orig_name}-bsf*.jar
|
||||
|
||||
%files classgen
|
||||
%defattr(0644,root,root,0755)
|
||||
%{_javadir}/%{name}/%{orig_name}-classgen*.jar
|
||||
|
||||
%files manual
|
||||
%defattr(0644,root,root,0755)
|
||||
%doc docs/*
|
||||
|
||||
%files javadoc
|
||||
%defattr(0644,root,root,0755)
|
||||
%dir %{_javadocdir}/%{name}-%{version}
|
||||
%{_javadocdir}/%{name}-%{version}/*
|
||||
%ghost %dir %{_javadocdir}/%{name}
|
||||
|
||||
%files demo -f %{name}-demo-%{version}.files
|
||||
%defattr(0644,root,root,0755)
|
||||
|
||||
%changelog -n bsh2
|
||||
* Mon Sep 25 2006 - skh@suse.de
|
||||
- don't use icecream
|
||||
- use source="1.4" and target="1.4" for build with java 1.5
|
||||
* Wed Jan 25 2006 - mls@suse.de
|
||||
- converted neededforbuild to BuildRequires
|
||||
* Mon Oct 17 2005 - jsmeix@suse.de
|
||||
- Current version 2.0 from JPackage.org
|
Loading…
Reference in New Issue
Block a user