b800ade
# Copyright (c) 2000-2005, JPackage Project
b800ade
# All rights reserved.
b800ade
#
b800ade
# Redistribution and use in source and binary forms, with or without
b800ade
# modification, are permitted provided that the following conditions
b800ade
# are met:
b800ade
#
b800ade
# 1. Redistributions of source code must retain the above copyright
b800ade
#    notice, this list of conditions and the following disclaimer.
b800ade
# 2. Redistributions in binary form must reproduce the above copyright
b800ade
#    notice, this list of conditions and the following disclaimer in the
b800ade
#    documentation and/or other materials provided with the
b800ade
#    distribution.
b800ade
# 3. Neither the name of the JPackage Project nor the names of its
b800ade
#    contributors may be used to endorse or promote products derived
b800ade
#    from this software without specific prior written permission.
b800ade
#
b800ade
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
b800ade
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
b800ade
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
b800ade
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
b800ade
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
b800ade
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
b800ade
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
b800ade
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
b800ade
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
b800ade
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
b800ade
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
b800ade
#
b800ade
b800ade
%define _with_gcj_support 1
b800ade
b800ade
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
b800ade
cvsdist 250c59a
%define section		free
cvsdist 250c59a
b800ade
Name:           bsh
b800ade
Version:        1.3.0
fa6c416
Release:        8jpp_3fc
cvsdist 250c59a
Epoch:		0
cvsdist 250c59a
Summary:        Lightweight Scripting for Java
cvsdist 250c59a
License:        LGPL
b800ade
Source0:        %{name}-%{version}-src.tar.bz2
cvsdist 250c59a
Patch0:		%{name}-build.patch
cvsdist 250c59a
Patch1:		%{name}-readline.patch
b800ade
BuildRequires:  ant, bsf, perl
cvsdist 250c59a
Requires:	bsf
b800ade
Requires:	jpackage-utils >= 0:1.6
cvsdist 250c59a
#BuildRequires:  libreadline-java
cvsdist 250c59a
Url:            http://www.beanshell.org/
cvsdist 250c59a
Group:          Development/Java
b800ade
%if ! %{gcj_support}
cvsdist 250c59a
Buildarch:      noarch
b800ade
%endif
cvsdist 250c59a
Buildroot:      %{_tmppath}/%{name}-%{version}-buildroot
b800ade
b800ade
%if %{gcj_support}
b800ade
BuildRequires:		java-gcj-compat-devel
b800ade
Requires(post):		java-gcj-compat
b800ade
Requires(postun):	java-gcj-compat
b800ade
%endif
cvsdist 250c59a
cvsdist 250c59a
%description
cvsdist 250c59a
BeanShell is a small, free, embeddable, Java source interpreter with
cvsdist 250c59a
object scripting language features, written in Java. BeanShell executes
cvsdist 250c59a
standard Java statements and expressions, in addition to obvious
cvsdist 250c59a
scripting commands and syntax. BeanShell supports scripted objects as
cvsdist 250c59a
simple method closures like those in Perl and JavaScript(tm).
cvsdist 250c59a
You can use BeanShell interactively for Java experimentation and
cvsdist 250c59a
debugging or as a simple scripting engine for your applications. In
cvsdist 250c59a
short: BeanShell is a dynamically interpreted Java, plus some useful
cvsdist 250c59a
stuff. Another way to describe it is to say that in many ways BeanShell
cvsdist 250c59a
is to Java as Tcl/Tk is to C: BeanShell is embeddable - You can call
cvsdist 250c59a
BeanShell from your Java applications to execute Java code dynamically
cvsdist 250c59a
at run-time or to provide scripting extensibility for your applications.
cvsdist 250c59a
Alternatively, you can call your Java applications and objects from
cvsdist 250c59a
BeanShell; working with Java objects and APIs dynamically. Since
cvsdist 250c59a
BeanShell is written in Java and runs in the same space as your
cvsdist 250c59a
application, you can freely pass references to "real live" objects into
cvsdist 250c59a
scripts and return them as results.
cvsdist 250c59a
cvsdist 250c59a
%package manual
cvsdist 250c59a
Summary:        Manual for %{name}
cvsdist 250c59a
Group:          Development/Java
cvsdist 250c59a
cvsdist 250c59a
%description manual
cvsdist 250c59a
Documentation for %{name}.
cvsdist 250c59a
cvsdist 250c59a
%package javadoc
cvsdist 250c59a
Summary:        Javadoc for %{name}
cvsdist 250c59a
Group:          Development/Java
cvsdist 250c59a
cvsdist 250c59a
%description javadoc
cvsdist 250c59a
Javadoc for %{name}.
cvsdist 250c59a
cvsdist 250c59a
%package demo
cvsdist 250c59a
Summary:        Demo for %{name}
cvsdist 250c59a
Group:          Development/Java
cvsdist 250c59a
AutoReqProv:	no
cvsdist 250c59a
Requires:       %{name} = %{epoch}:%{version}-%{release}
cvsdist 250c59a
Requires:	/usr/bin/env
cvsdist 250c59a
cvsdist 250c59a
%description demo
cvsdist 250c59a
Demonstrations and samples for %{name}.
cvsdist 250c59a
cvsdist 250c59a
%prep
cvsdist 250c59a
rm -rf $RPM_BUILD_ROOT
b800ade
%setup -q -n BeanShell
cvsdist 250c59a
%patch0 -p1
cvsdist 250c59a
#%patch1 -p1
cvsdist 250c59a
find . -name "*.jar" -exec rm -f {} \;
cvsdist 250c59a
# remove all CVS files
cvsdist 250c59a
for dir in `find . -type d -name CVS`; do rm -rf $dir; done
cvsdist 250c59a
for file in `find . -type f -name .cvsignore`; do rm -rf $file; done
cvsdist 250c59a
cvsdist 250c59a
%build
cvsdist 250c59a
mkdir -p lib
cvsdist 250c59a
#export CLASSPATH=$(build-classpath bsf libreadline-java)
cvsdist 250c59a
export CLASSPATH=$(build-classpath bsf)
cvsdist 250c59a
# remove servlet dependency
cvsdist 250c59a
rm -rf src/bsh/servlet
cvsdist 250c59a
ant -Dexclude-servlet='bsh/servlet/*' compile
cvsdist 250c59a
ant -Dexclude-servlet='bsh/servlet/*' jarall
cvsdist 250c59a
ant -Dexclude-servlet='bsh/servlet/*' javadoc
cvsdist 250c59a
ant -Dexclude-servlet='bsh/servlet/*' bshdoc
cvsdist 250c59a
(cd docs/faq && ant)
cvsdist 250c59a
(cd docs/manual && ant)
cvsdist 250c59a
cvsdist 250c59a
%install
cvsdist 250c59a
# jars
cvsdist 250c59a
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
b800ade
install -m 644 dist/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
cvsdist 250c59a
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
cvsdist 250c59a
# manual
cvsdist 250c59a
find docs -name ".cvswrappers" -exec rm -f {} \;
cvsdist 250c59a
find docs -name "*.xml" -exec rm -f {} \;
cvsdist 250c59a
find docs -name "*.xsl" -exec rm -f {} \;
cvsdist 250c59a
find docs -name "*.log" -exec rm -f {} \;
cvsdist 250c59a
(cd docs/manual && mv html/* .)
cvsdist 250c59a
(cd docs/manual && rm -rf html)
cvsdist 250c59a
(cd docs/manual && rm -rf xsl)
cvsdist 250c59a
# javadoc
cvsdist 250c59a
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cvsdist 250c59a
cp -pr javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cvsdist 250c59a
# demo
cvsdist 250c59a
for i in `find tests -name \*.bsh`; do
cvsdist 250c59a
  perl -p -i -e 's,^\n?#!(/(usr/)?bin/java bsh\.Interpreter|/bin/sh),#!/usr/bin/env %{_bindir}/%{name},' $i
cvsdist 250c59a
  if head -1 $i | grep '#!/usr/bin/env %{_bindir}/%{name}' >/dev/null; then
cvsdist 250c59a
    chmod 755 $i
cvsdist 250c59a
  fi
cvsdist 250c59a
done
cvsdist 250c59a
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
cvsdist 250c59a
cp -pr tests $RPM_BUILD_ROOT%{_datadir}/%{name}
cvsdist 250c59a
# scripts
cvsdist 250c59a
install -d $RPM_BUILD_ROOT%{_bindir}
cvsdist 250c59a
cvsdist 250c59a
cat > $RPM_BUILD_ROOT%{_bindir}/%{name} << EOF
cvsdist 250c59a
#!/bin/sh
cvsdist 250c59a
#
cvsdist 250c59a
# %{name} script
cvsdist 250c59a
# JPackage Project (http://jpackage.sourceforge.net)
cvsdist 250c59a
cvsdist 250c59a
# Source functions library
cvsdist 250c59a
. %{_datadir}/java-utils/java-functions
cvsdist 250c59a
cvsdist 250c59a
# Source system prefs
cvsdist 250c59a
if [ -f %{_sysconfdir}/%{name}.conf ] ; then
cvsdist 250c59a
  . %{_sysconfdir}/%{name}.conf
cvsdist 250c59a
fi
cvsdist 250c59a
cvsdist 250c59a
# Source user prefs
cvsdist 250c59a
if [ -f \$HOME/.%{name}rc ] ; then
cvsdist 250c59a
  . \$HOME/.%{name}rc
cvsdist 250c59a
fi
cvsdist 250c59a
cvsdist 250c59a
# Configuration
cvsdist 250c59a
MAIN_CLASS=bsh.Interpreter
cvsdist 250c59a
if [ -n "\$BSH_DEBUG" ]; then
cvsdist 250c59a
  BASE_FLAGS=-Ddebug=true
cvsdist 250c59a
fi
cvsdist 250c59a
cvsdist 250c59a
BASE_JARS="%{name}.jar"
cvsdist 250c59a
cvsdist 250c59a
#if [ -f /usr/lib/libJavaReadline.so ]; then
cvsdist 250c59a
#  BASE_FLAGS="$BASE_FLAGS -Djava.library.path=/usr/lib"
cvsdist 250c59a
#  BASE_FLAGS="\$BASE_FLAGS -Dbsh.console.readlinelib=GnuReadline"
cvsdist 250c59a
#  BASE_JARS="\$BASE_JARS libreadline-java.jar"
cvsdist 250c59a
#fi
cvsdist 250c59a
cvsdist 250c59a
# Set parameters
cvsdist 250c59a
set_jvm
cvsdist 250c59a
set_classpath \$BASE_JARS
cvsdist 250c59a
set_flags \$BASE_FLAGS
cvsdist 250c59a
set_options \$BASE_OPTIONS
cvsdist 250c59a
cvsdist 250c59a
# Let's start
cvsdist 250c59a
run "\$@"
cvsdist 250c59a
EOF
cvsdist 250c59a
cvsdist 250c59a
cat > $RPM_BUILD_ROOT%{_bindir}/%{name}doc << EOF
cvsdist 250c59a
#!/usr/bin/env %{_bindir}/%{name}
cvsdist 250c59a
EOF
cvsdist 250c59a
cat scripts/bshdoc.bsh >> $RPM_BUILD_ROOT%{_bindir}/%{name}doc
cvsdist 250c59a
b800ade
%if %{gcj_support}
b800ade
%{_bindir}/aot-compile-rpm
b800ade
%endif
b800ade
cvsdist 250c59a
%clean
cvsdist 250c59a
rm -rf $RPM_BUILD_ROOT
cvsdist 250c59a
b800ade
%post
b800ade
%if %{gcj_support}
b800ade
if [ -x %{_bindir}/rebuild-gcj-db ]
b800ade
then
b800ade
  %{_bindir}/rebuild-gcj-db
b800ade
fi
b800ade
%endif
b800ade
b800ade
%postun
b800ade
%if %{gcj_support}
b800ade
if [ -x %{_bindir}/rebuild-gcj-db ]
b800ade
then
b800ade
  %{_bindir}/rebuild-gcj-db
b800ade
fi
b800ade
%endif
b800ade
cvsdist 250c59a
%files
cvsdist 250c59a
%defattr(-,root,root)
cvsdist 250c59a
%doc src/Changes.html src/License.txt src/README.txt
cvsdist 250c59a
%attr(0755,root,root) %{_bindir}/%{name}
cvsdist 250c59a
%attr(0755,root,root) %{_bindir}/%{name}doc
cvsdist 250c59a
%{_javadir}/*
cvsdist 250c59a
%dir %{_datadir}/%{name}
cvsdist 250c59a
b800ade
%if %{gcj_support}
b800ade
%attr(-,root,root) %{_libdir}/gcj/%{name}
b800ade
%endif
b800ade
cvsdist 250c59a
%files manual
cvsdist 250c59a
%defattr(-,root,root)
cvsdist 250c59a
%doc docs/*
cvsdist 250c59a
cvsdist 250c59a
%files javadoc
cvsdist 250c59a
%defattr(-,root,root)
cvsdist 250c59a
%{_javadocdir}/%{name}-%{version}
cvsdist 250c59a
cvsdist 250c59a
%files demo
cvsdist 250c59a
%defattr(-,root,root)
cvsdist 250c59a
%{_datadir}/%{name}/*
cvsdist 250c59a
cvsdist 250c59a
%changelog
fa6c416
* Sat Jul 22 2006 Jakub Jelinek <jakub@redhat.com> 0:1.3.0-8jpp_3fc
fa6c416
- Rebuilt
fa6c416
cf7225e
* Fri Jul 21 2006 Deepak Bhole <dbhole@redhat.com> 0:1.3.0-8jpp_2fc
cf7225e
- Removing vendor and distribution tags.
cf7225e
b800ade
* Thu Jul 20 2006 Deepak Bhole <dbhole@redhat.com> 0:1.3.0-8jpp_1fc
b800ade
- Add conditional native compilation.
406b818
b800ade
* Thu May 04 2006 Ralph Apel <r.apel at r-apel.de> 0:1.3.0-7jpp
b800ade
- First JPP-1.7 release
gbenson 76ed5d9
b800ade
* Fri Aug 20 2004 Ralph Apel <r.apel at r-apel.de> 0:1.3.0-6jpp
b800ade
- Build with ant-1.6.2
cvsdist 978c8f9
cvsdist 250c59a
* Mon Jan 26 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-5jpp
cvsdist 250c59a
- really drop readline patch
cvsdist 250c59a
cvsdist 250c59a
* Sun Jan 25 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-4jpp
cvsdist 250c59a
- drop readline patch
cvsdist 250c59a
cvsdist 250c59a
* Wed Jan 21 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-3jpp
cvsdist 250c59a
- port libreadline-java patch to new bsh
cvsdist 250c59a
cvsdist 250c59a
* Tue Jan 20 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-2jpp
cvsdist 250c59a
- add Distribution tag
cvsdist 250c59a
cvsdist 250c59a
* Tue Jan 20 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-1jpp
cvsdist 250c59a
- 1.3.0
cvsdist 250c59a
- remove bsf patch (fixed upstream)
cvsdist 250c59a
- add epoch to demo package Requires
cvsdist 250c59a
cvsdist 250c59a
* Fri Apr 12 2003 David Walluck <david@anti-microsoft.org> 0:1.2-0.b8.4jpp
cvsdist 250c59a
- fix strange permissions
cvsdist 250c59a
cvsdist 250c59a
* Fri Apr 11 2003 David Walluck <david@anti-microsoft.org> 0:1.2-0.b8.3jpp
cvsdist 250c59a
- rebuild for JPackage 1.5
cvsdist 250c59a
- add bsf patch
cvsdist 250c59a
cvsdist 250c59a
* Sat Feb 01 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.2jpp
cvsdist 250c59a
- remove servlet dependency (if anyone wants to add this as a separate
cvsdist 250c59a
  package and do the tomcat integration, be my guest)
cvsdist 250c59a
cvsdist 250c59a
* Thu Jan 23 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.1jpp
cvsdist 250c59a
- rename to bsh
cvsdist 250c59a
- add manual
cvsdist 250c59a
- add Changes.html to %%doc
cvsdist 250c59a
- add bsh and bshdoc scripts
cvsdist 250c59a
- add %%dir %%{_datadir}/%%{name} to main package
cvsdist 250c59a
- correct test interpreter and make bsh files executable
cvsdist 250c59a
cvsdist 250c59a
* Mon Jan 21 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-3jpp
cvsdist 250c59a
- really section macro
cvsdist 250c59a
cvsdist 250c59a
* Sun Jan 20 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-2jpp
cvsdist 250c59a
- additional sources in individual archives
cvsdist 250c59a
- versioned dir for javadoc
cvsdist 250c59a
- no dependencies for javadoc package
cvsdist 250c59a
- stricter dependency for demo package
cvsdist 250c59a
- section macro
cvsdist 250c59a
cvsdist 250c59a
* Tue Dec 18 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-1jpp
cvsdist 250c59a
- first JPackage release