fixed demo rpm warning [release 1.3.0-7mamba;Mon Mar 28 2011]

This commit is contained in:
gil 2024-01-06 00:02:59 +01:00
parent 49ca0385bc
commit 90d356005b
11 changed files with 521 additions and 0 deletions

View File

@ -1,2 +1,6 @@
# java-bsh # java-bsh
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.

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}"

View File

@ -0,0 +1,40 @@
#!/bin/sh
#
# bsh-desktop script
# JPackage Project (http://jpackage.sourceforge.net)
# Source functions library
. /usr/share/java-utils/java-functions
# Source system prefs
if [ -f /etc/bsh.conf ] ; then
. /etc/bsh.conf
fi
# Source user prefs
if [ -f $HOME/.bshrc ] ; then
. $HOME/.bshrc
fi
# Configuration
MAIN_CLASS=bsh.Console
if [ -n "$BSH_DEBUG" ]; then
BASE_FLAGS=-Ddebug=true
fi
BASE_JARS="bsh.jar"
#if [ -f /usr/lib/libJavaReadline.so ]; then
# 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 "$@"

40
java-bsh-1.3.0-bsh-script Normal file
View File

@ -0,0 +1,40 @@
#!/bin/sh
#
# bsh script
# JPackage Project (http://jpackage.sourceforge.net)
# Source functions library
. /usr/share/java-utils/java-functions
# Source system prefs
if [ -f /etc/bsh.conf ] ; then
. /etc/bsh.conf
fi
# Source user prefs
if [ -f $HOME/.bshrc ] ; then
. $HOME/.bshrc
fi
# Configuration
MAIN_CLASS=bsh.Interpreter
if [ -n "$BSH_DEBUG" ]; then
BASE_FLAGS=-Ddebug=true
fi
BASE_JARS="bsh.jar"
#if [ -f /usr/lib/libJavaReadline.so ]; then
# 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 "$@"

11
java-bsh-1.3.0-faq.patch Normal file
View File

@ -0,0 +1,11 @@
--- docs/faq/faq.xsl 2002-05-28 06:03:18.000000000 +0200
+++ docs/faq/faq.xsl-gil 2010-11-25 03:00:25.000000000 +0100
@@ -18,7 +18,7 @@
<!--xsl:param name="imagedir"/-->
<!-- Output directives -->
-<xsl:output method="xhtml" indent="yes"/>
+<xsl:output method="html" indent="yes"/>
<!--
Root

View File

@ -0,0 +1,19 @@
--- docs/manual/xsl/manual.xsl 2002-05-28 00:58:14.000000000 +0200
+++ docs/manual/xsl/manual.xsl-gil 2010-11-25 03:09:44.000000000 +0100
@@ -1,6 +1,6 @@
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
+ xmlns:redirect="http://xml.apache.org/xalan/redirect"
extension-element-prefixes="redirect"
>
@@ -29,7 +29,7 @@
<xsl:param name="pagesdir"/>
<!-- Output directives -->
-<xsl:output method="xhtml" indent="no"/>
+<xsl:output method="html" indent="no"/>
<!--
Root

8
java-bsh-1.3.0.pom Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>bsh</groupId>
<artifactId>bsh</artifactId>
<name>Beanshell</name>
<version>1.3.0</version>
</project>

8
java-bsh-bsf-1.3.0.pom Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>bsh</groupId>
<artifactId>bsh-bsf</artifactId>
<name>Beanshell BSFEngine</name>
<version>1.3.0</version>
</project>

9
java-bsh-desktop.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=BeanShell Desktop
Exec=bsh-desktop
Icon=bsh
Terminal=false
Type=Application
StartupWMClass=bsh-Console
Categories=Development;Java;
Version=1.0

BIN
java-bsh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

328
java-bsh.spec Normal file
View File

@ -0,0 +1,328 @@
%define javahome %{_jvmdir}/jdk
Name: java-bsh
Version: 1.3.0
Release: 7mamba
Summary: Lightweight Scripting for Java
Group: Development/Libraries/Java
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.beanshell.org/
# Source: http://www.beanshell.org/bsh-2.0b4-src.zip broken link
# svn co http://ikayzo.org/svn/beanshell
Source0: http://repository.jboss.com/beanshell/%{version}-brew/src/bsh-%{version}-src.tar.bz2
Source1: java-bsh.png
Source2: java-bsh-desktop.desktop
Source3: java-bsh-1.3.0.pom
Source4: java-bsh-bsf-1.3.0.pom
Source5: java-bsh-1.3.0-bsh-desktop-script
Source6: java-bsh-1.3.0-bsh-script
Patch0: http://repository.jboss.com/beanshell/%{version}-brew/src/bsh-build.patch
Patch1: java-bsh-1.3.0-faq.patch
Patch2: java-bsh-1.3.0-manual.patch
License: LGPL, Sun Public License
BuildRequires: apache-ant
BuildRequires: apache-ant-trax
BuildRequires: desktop-file-utils
%if "%{stage1}" != "1"
BuildRequires: apache-tomcat5-servletapi5
%else
BuildRequires: java-servletapi4
%endif
BuildRequires: jakarta-bsf
BuildRequires: ImageMagick
BuildRequires: java-libreadline
BuildRequires: javacc
BuildRequires: xalan-j2
Requires: jakarta-bsf
Requires: jpackage-utils
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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 javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Lightweight Scripting for Java.
This package contains Javadoc for %{name}.
%package demo
Group: Documentation
Summary: Examples for %{name}
%description demo
Lightweight Scripting for Java.
This package contains demonstrations and samples for %{name}.
%package desktop
Summary: Desktop integraton for %{name}
Group: Development/Tools
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description desktop
Lightweight Scripting for Java.
This package contains a menu entry for %{name}.
%package manual
Group: Documentation
Summary: Manual for %{name}
%description manual
Lightweight Scripting for Java.
This package contains documentation for %{name}.
%prep
%setup -q -n BeanShell
%patch0 -p1
%patch1 -p0
%patch2 -p0
for j in $(find . -name "*.jar"); do
mv $j $j.no
done
for dir in $(find . -type d -name CVS); do
rm -rf $dir
done
for file in $(find . -type d -name .cvsignore) ; do
rm -rf $file
done
for i in backbutton forwardbutton homebutton remoteconsole upbutton; do
chmod 644 docs/images/$i.gif
done
%build
mkdir -p lib
pushd lib
ln -sf $(build-classpath bsf) bsf.jar
%if "%{stage1}" != "1"
ln -sf $(build-classpath servletapi5) servlet.jar
%else
ln -sf $(build-classpath servletapi4) servlet.jar
%endif
ln -sf $(build-classpath javacc) javacc.jar
popd
export JAVA_HOME=%javahome
ant dist
(
cd docs/faq
ant -Dant.build.javac.source=1.4
)
(
cd docs/manual
export CLASSPATH=$(build-classpath xalan-j2 ant/ant-trax)
ant -Dant.build.javac.source=1.4
)
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}
install -m 644 dist/bsh-%{version}.jar \
%{buildroot}%{_javadir}/bsh-%{version}.jar
install -m 644 dist/bsh-bsf-%{version}.jar \
%{buildroot}%{_javadir}/bsh-bsf-%{version}.jar
install -m 644 dist/bsh-classpath-%{version}.jar \
%{buildroot}%{_javadir}/bsh-classpath-%{version}.jar
install -m 644 dist/bsh-commands-%{version}.jar \
%{buildroot}%{_javadir}/bsh-commands-%{version}.jar
install -m 644 dist/bsh-core-%{version}.jar \
%{buildroot}%{_javadir}/bsh-core-%{version}.jar
install -m 644 dist/bsh-reflect-%{version}.jar \
%{buildroot}%{_javadir}/bsh-reflect-%{version}.jar
install -m 644 dist/bsh-util-%{version}.jar \
%{buildroot}%{_javadir}/bsh-util-%{version}.jar
(
cd %{buildroot}%{_javadir}
for jar in *-%{version}*; do
ln -sf ${jar} ${jar/-%{version}/}
done
)
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
)
mkdir -p %{buildroot}%{_javadocdir}/bsh-%{version}
cp -pr javadoc/* %{buildroot}%{_javadocdir}/bsh-%{version}
ln -s bsh-%{version} %{buildroot}%{_javadocdir}/bsh
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}/bsh,' $i
if head -1 $i | grep '#!/usr/bin/env %{_bindir}/bsh' >/dev/null; then
chmod 755 $i
fi
done
find . -name "*.bsh" -exec perl -p -i -e 's|/bin/java|%{_bindir}/java|g;' {} \;
sed -i "s|/bin/java|%{_bindir}/java|" tests/Template
mkdir -p %{buildroot}%{_datadir}/bsh/webapps
chmod 755 tests/Template
cat > one << EOF
#!/bin/sh
EOF
cat tests/Interactive/reload/one >> one
cat one > tests/Interactive/reload/one
rm one
cat > two << EOF
#!/bin/sh
EOF
cat tests/Interactive/reload/two >> two
cat two > tests/Interactive/reload/two
rm two
cp -pr tests %{buildroot}%{_datadir}/bsh
install -m 644 dist/bshservlet.war %{buildroot}%{_datadir}/bsh/webapps
install -m 644 dist/bshservlet-wbsh.war %{buildroot}%{_datadir}/bsh/webapps
mkdir -p %{buildroot}%{_datadir}/applications
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/16x16/apps
mkdir -p %{buildroot}%{_datadir}/pixmaps
convert %{SOURCE1} \
%{buildroot}%{_datadir}/icons/hicolor/16x16/apps/bsh.png
convert %{SOURCE1} \
%{buildroot}%{_datadir}/pixmaps/bsh.png
desktop-file-install --vendor=%vendor --mode=644 \
--dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -pm 644 %{SOURCE3} %{buildroot}%{_datadir}/maven2/poms/JPP.bsh.pom
install -pm 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP.bsh-bsf.pom
%add_to_maven_depmap bsh bsh %{version} JPP bsh
%add_to_maven_depmap bsh bsh-bsf %{version} JPP bsh-bsf
mkdir -p %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/bshdoc << EOF
#!/usr/bin/env %{_bindir}/bsh
EOF
cat scripts/bshdoc.bsh >> %{buildroot}%{_bindir}/bshdoc
install -pm 755 %{SOURCE5} %{buildroot}%{_bindir}/bsh-desktop
install -pm 755 %{SOURCE6} %{buildroot}%{_bindir}/bsh
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post desktop
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
%post
%update_maven_depmap
%postun desktop
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
%postun
%update_maven_depmap
%files
%defattr(-,root,root)
%{_bindir}/bsh
%{_bindir}/bshdoc
%{_javadir}/bsh-%{version}.jar
%{_javadir}/bsh-bsf-%{version}.jar
%{_javadir}/bsh-bsf.jar
%{_javadir}/bsh-classpath-%{version}.jar
%{_javadir}/bsh-classpath.jar
%{_javadir}/bsh-commands-%{version}.jar
%{_javadir}/bsh-commands.jar
%{_javadir}/bsh-core-%{version}.jar
%{_javadir}/bsh-core.jar
%{_javadir}/bsh-reflect-%{version}.jar
%{_javadir}/bsh-reflect.jar
%{_javadir}/bsh-util-%{version}.jar
%{_javadir}/bsh-util.jar
%{_javadir}/bsh.jar
%dir %{_datadir}/bsh
%{_datadir}/bsh/webapps
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
%doc src/Changes.html src/License.txt src/README.txt
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/bsh-%{version}
%{_javadocdir}/bsh
%files demo
%defattr(-,root,root)
%{_datadir}/bsh
%doc tests/README.txt tests/Interactive/README
%files manual
%defattr(-,root,root)
%doc docs/*
%files desktop
%defattr(-,root,root)
%{_bindir}/bsh-desktop
%{_datadir}/applications/*bsh-desktop.desktop
%{_datadir}/icons/hicolor/*x*/apps/bsh.png
%{_datadir}/pixmaps/bsh.png
%changelog
* Mon Mar 28 2011 gil <puntogil@libero.it> 1.3.0-7mamba
- fixed demo rpm warning
* Sun Mar 27 2011 gil <puntogil@libero.it> 1.3.0-6mamba
- rebuilt with java-openjdk support
* Thu Nov 25 2010 gil <puntogil@libero.it> 1.3.0-5mamba
- rebuilt devel
- add new sub package desktop
- fix documentation build
- add %%post %%postun {,desktop} scripts
* Tue Mar 17 2009 gil <puntogil@libero.it> 1.3.0-4mamba
- rebuilt with sun-java 6u20
* Tue Mar 17 2009 gil <puntogil@libero.it> 1.3.0-3mamba
- rebuilt
* Fri Mar 13 2009 gil <puntogil@libero.it> 1.3.0-2mamba
- rebuilt
* Thu Mar 05 2009 gil <puntogil@libero.it> 1.3.0-1mamba
- package created by autospec