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