auto-import changelog data from bsh-1.3.0-5jpp.src.rpm

1.3.0-5jpp
- really drop readline patch
1.3.0-4jpp
- drop readline patch
1.3.0-3jpp
- port libreadline-java patch to new bsh
1.3.0-2jpp
- add Distribution tag
1.3.0-1jpp
- 1.3.0
- remove bsf patch (fixed upstream)
- add epoch to demo package Requires
1.2-0.b8.4jpp
- fix strange permissions
1.2-0.b8.3jpp
- rebuild for JPackage 1.5
- add bsf patch
Sat Feb 01 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.2jpp
- remove servlet dependency (if anyone wants to add this as a separate
    package and do the tomcat integration, be my guest)
Thu Jan 23 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.1jpp
- rename to bsh
- add manual
- add Changes.html to %doc
- add bsh and bshdoc scripts
- add %dir %{_datadir}/%{name} to main package
- correct test interpreter and make bsh files executable
Mon Jan 21 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net>
    1.01-3jpp
- really section macro
Sun Jan 20 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net>
    1.01-2jpp
- additional sources in individual archives
- versioned dir for javadoc
- no dependencies for javadoc package
- stricter dependency for demo package
- section macro
Tue Dec 18 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net>
    1.01-1jpp
- first JPackage release
This commit is contained in:
cvsdist 2004-09-09 03:38:07 +00:00
parent cce5261dc1
commit 250c59ac06
5 changed files with 448 additions and 0 deletions

View File

@ -0,0 +1 @@
bsh-1.3.0-src.tar.bz2

54
bsh-build.patch Normal file
View 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}"

151
bsh-readline.patch Normal file
View 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");
+ if (backingLib != null) {
+ 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
+ }
+ }
+
+}

241
bsh.spec Normal file
View File

@ -0,0 +1,241 @@
%define name bsh
%define Name BeanShell
%define version 1.3.0
%define fversion 1.3.0
%define release 5jpp
%define section free
Name: %{name}
Version: %{version}
Release: %{release}
Epoch: 0
Summary: Lightweight Scripting for Java
License: LGPL
Source0: %{name}-%{fversion}-src.tar.bz2
Patch0: %{name}-build.patch
Patch1: %{name}-readline.patch
Requires: bsf
Requires: jpackage-utils >= 0:1.5
BuildRequires: ant
#BuildRequires: libreadline-java
Url: http://www.beanshell.org/
Group: Development/Java
Buildarch: noarch
Buildroot: %{_tmppath}/%{name}-%{version}-buildroot
Distribution: JPackage
Vendor: JPackage Project
%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.
%package manual
Summary: Manual for %{name}
Group: Development/Java
%description manual
Documentation for %{name}.
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Java
%description javadoc
Javadoc for %{name}.
%package demo
Summary: Demo for %{name}
Group: Development/Java
AutoReqProv: no
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: /usr/bin/env
%description demo
Demonstrations and samples for %{name}.
%prep
rm -rf $RPM_BUILD_ROOT
%setup -n %{Name}
%patch0 -p1
#%patch1 -p1
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 bsf libreadline-java)
export CLASSPATH=$(build-classpath bsf)
# remove servlet dependency
rm -rf src/bsh/servlet
ant -Dexclude-servlet='bsh/servlet/*' compile
ant -Dexclude-servlet='bsh/servlet/*' jarall
ant -Dexclude-servlet='bsh/servlet/*' javadoc
ant -Dexclude-servlet='bsh/servlet/*' bshdoc
(cd docs/faq && ant)
(cd docs/manual && ant)
%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 dist/%{name}-%{fversion}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${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 html/* .)
(cd docs/manual && rm -rf html)
(cd docs/manual && rm -rf xsl)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
# demo
for i in `find tests -name \*.bsh`; do
perl -p -i -e 's,^\n?#!(/(usr/)?bin/java bsh\.Interpreter|/bin/sh),#!/usr/bin/env %{_bindir}/%{name},' $i
if head -1 $i | grep '#!/usr/bin/env %{_bindir}/%{name}' >/dev/null; then
chmod 755 $i
fi
done
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr tests $RPM_BUILD_ROOT%{_datadir}/%{name}
# scripts
install -d $RPM_BUILD_ROOT%{_bindir}
cat > $RPM_BUILD_ROOT%{_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 > $RPM_BUILD_ROOT%{_bindir}/%{name}doc << EOF
#!/usr/bin/env %{_bindir}/%{name}
EOF
cat scripts/bshdoc.bsh >> $RPM_BUILD_ROOT%{_bindir}/%{name}doc
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc src/Changes.html src/License.txt src/README.txt
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}doc
%{_javadir}/*
%dir %{_datadir}/%{name}
%files manual
%defattr(-,root,root)
%doc docs/*
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{name}-%{version}
%files demo
%defattr(-,root,root)
%{_datadir}/%{name}/*
%changelog
* Mon Jan 26 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-5jpp
- really drop readline patch
* Sun Jan 25 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-4jpp
- drop readline patch
* Wed Jan 21 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-3jpp
- port libreadline-java patch to new bsh
* Tue Jan 20 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-2jpp
- add Distribution tag
* Tue Jan 20 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-1jpp
- 1.3.0
- remove bsf patch (fixed upstream)
- add epoch to demo package Requires
* Fri Apr 12 2003 David Walluck <david@anti-microsoft.org> 0:1.2-0.b8.4jpp
- fix strange permissions
* Fri Apr 11 2003 David Walluck <david@anti-microsoft.org> 0:1.2-0.b8.3jpp
- rebuild for JPackage 1.5
- add bsf patch
* Sat Feb 01 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.2jpp
- remove servlet dependency (if anyone wants to add this as a separate
package and do the tomcat integration, be my guest)
* Thu Jan 23 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.1jpp
- rename to bsh
- add manual
- add Changes.html to %%doc
- add bsh and bshdoc scripts
- add %%dir %%{_datadir}/%%{name} to main package
- correct test interpreter and make bsh files executable
* Mon Jan 21 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-3jpp
- really section macro
* Sun Jan 20 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-2jpp
- additional sources in individual archives
- versioned dir for javadoc
- no dependencies for javadoc package
- stricter dependency for demo package
- section macro
* Tue Dec 18 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-1jpp
- first JPackage release

View File

@ -0,0 +1 @@
8ecaff8eb679e4f1447dbb98cc9e897a bsh-1.3.0-src.tar.bz2