e885f7
# Copyright (c) 2000-2007, JPackage Project
e885f7
# All rights reserved.
e885f7
#
e885f7
# Redistribution and use in source and binary forms, with or without
e885f7
# modification, are permitted provided that the following conditions
e885f7
# are met:
e885f7
#
e885f7
# 1. Redistributions of source code must retain the above copyright
e885f7
#    notice, this list of conditions and the following disclaimer.
e885f7
# 2. Redistributions in binary form must reproduce the above copyright
e885f7
#    notice, this list of conditions and the following disclaimer in the
e885f7
#    documentation and/or other materials provided with the
e885f7
#    distribution.
e885f7
# 3. Neither the name of the JPackage Project nor the names of its
e885f7
#    contributors may be used to endorse or promote products derived
e885f7
#    from this software without specific prior written permission.
e885f7
#
e885f7
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
e885f7
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
e885f7
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
e885f7
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
e885f7
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
e885f7
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
e885f7
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
e885f7
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
e885f7
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
e885f7
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
e885f7
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
e885f7
#
e885f7
e885f7
%global reltag b6
e885f7
%bcond_without  desktop
e885f7
e885f7
Name:           bsh
e885f7
Version:        2.0
e885f7
Release:        13.%{reltag}%{?dist}
e885f7
Epoch:          0
e885f7
Summary:        Lightweight Scripting for Java
e885f7
URL:            http://www.beanshell.org/
e885f7
# bundled asm is BSD
e885f7
# bsf/src/bsh/util/BeanShellBSFEngine.java is public-domain
e885f7
License:        ASL 2.0 and BSD and Public Domain
e885f7
BuildArch:      noarch
e885f7
# ./generate-tarball.sh
e885f7
Source0:        %{name}-%{version}-%{reltag}.tar.gz
e885f7
Source1:        %{name}-desktop.desktop
e885f7
# Remove bundled jars which cannot be easily verified for licensing
e885f7
# Remove code marked as SUN PROPRIETARY/CONFIDENTAIL
e885f7
Source2:        generate-tarball.sh
e885f7
e885f7
BuildRequires:  javapackages-local
e885f7
BuildRequires:  ant
e885f7
BuildRequires:  bsf
e885f7
BuildRequires:  junit
e885f7
BuildRequires:  javacc
e885f7
BuildRequires:  glassfish-servlet-api
e885f7
%if %{with desktop}
e885f7
BuildRequires:  ImageMagick
e885f7
BuildRequires:  desktop-file-utils
e885f7
%endif
e885f7
e885f7
Requires:       java-headless
e885f7
Requires:       bsf
e885f7
Requires:       jline
e885f7
# Explicit javapackages-tools requires since scripts use
e885f7
# /usr/share/java-utils/java-functions
e885f7
Requires:       javapackages-tools
e885f7
e885f7
e885f7
Provides:       %{name}-utils = %{epoch}:%{version}-%{release}
e885f7
Obsoletes:      %{name}-utils < 0:2.0
e885f7
Obsoletes:      %{name}-demo < 0:2.0
e885f7
e885f7
# bsh uses small subset of modified (shaded) classes from ancient version of
e885f7
# objecweb-asm under asm directory
e885f7
Provides:       bundled(objectweb-asm) = 1.3.6
e885f7
e885f7
%description
e885f7
BeanShell is a small, free, embeddable, Java source interpreter with
e885f7
object scripting language features, written in Java. BeanShell
e885f7
executes standard Java statements and expressions, in addition to
e885f7
obvious scripting commands and syntax. BeanShell supports scripted
e885f7
objects as simple method closures like those in Perl and
e885f7
JavaScript(tm). You can use BeanShell interactively for Java
e885f7
experimentation and debugging or as a simple scripting engine for your
e885f7
applications. In short: BeanShell is a dynamically interpreted Java,
e885f7
plus some useful stuff. Another way to describe it is to say that in
e885f7
many ways BeanShell is to Java as Tcl/Tk is to C: BeanShell is
e885f7
embeddable - You can call BeanShell from your Java applications to
e885f7
execute Java code dynamically at run-time or to provide scripting
e885f7
extensibility for your applications. Alternatively, you can call your
e885f7
Java applications and objects from BeanShell; working with Java
e885f7
objects and APIs dynamically. Since BeanShell is written in Java and
e885f7
runs in the same space as your application, you can freely pass
e885f7
references to "real live" objects into scripts and return them as
e885f7
results.
e885f7
e885f7
%package manual
e885f7
Summary:        Manual for %{name}
e885f7
e885f7
%description manual
e885f7
Documentation for %{name}.
e885f7
e885f7
%package javadoc
e885f7
Summary:        API documentation for %{name}
e885f7
e885f7
%description javadoc
e885f7
This package provides %{summary}.
e885f7
e885f7
%prep
e885f7
%setup -q -n beanshell-%{version}%{reltag}
e885f7
e885f7
sed -i 's,org.apache.xalan.xslt.extensions.Redirect,http://xml.apache.org/xalan/redirect,' docs/manual/xsl/*.xsl
e885f7
e885f7
%mvn_alias :bsh bsh:bsh bsh:bsh-bsf org.beanshell:bsh
e885f7
e885f7
%mvn_file : %{name}
e885f7
e885f7
%build
e885f7
mkdir lib
e885f7
build-jar-repository lib bsf javacc junit glassfish-servlet-api
e885f7
e885f7
ant test dist
e885f7
e885f7
%install
e885f7
%mvn_artifact pom.xml dist/%{name}-%{version}%{reltag}.jar
e885f7
e885f7
%mvn_install -J javadoc
e885f7
e885f7
%if %{with desktop}
e885f7
# menu entry
e885f7
desktop-file-install --mode=644 \
e885f7
  --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
e885f7
install -d -m 755 %{buildroot}%{_datadir}/pixmaps
e885f7
convert src/bsh/util/lib/icon.gif \
e885f7
  %{buildroot}%{_datadir}/pixmaps/bsh.png
e885f7
%endif
e885f7
e885f7
install -d -m 755 %{buildroot}%{_datadir}/%{name}
e885f7
install -d -m 755 %{buildroot}%{_datadir}/%{name}/webapps
e885f7
install -m 644 dist/bshservlet.war %{buildroot}%{_datadir}/%{name}/webapps
e885f7
install -m 644 dist/bshservlet-wbsh.war %{buildroot}%{_datadir}/%{name}/webapps
e885f7
e885f7
# scripts
e885f7
install -d %{buildroot}%{_bindir}
e885f7
e885f7
%jpackage_script bsh.Interpreter "\${BSH_DEBUG:+-Ddebug=true}" jline.console.internal.ConsoleRunner %{name}:jline %{name} true
e885f7
%jpackage_script bsh.Console "\${BSH_DEBUG:+-Ddebug=true}" "" bsh bsh-console true
e885f7
e885f7
echo '#!%{_bindir}/bsh' > %{buildroot}%{_bindir}/bshdoc
e885f7
cat scripts/bshdoc.bsh >> %{buildroot}%{_bindir}/bshdoc
e885f7
e885f7
%files -f .mfiles
e885f7
%license LICENSE NOTICE
e885f7
%doc README.md src/Changes.html src/CodeMap.html docs/faq/faq.html
e885f7
%attr(0755,root,root) %{_bindir}/%{name}*
e885f7
%if %{with desktop}
e885f7
%{_datadir}/applications/%{name}-desktop.desktop
e885f7
%{_datadir}/pixmaps/%{name}.png
e885f7
%endif
e885f7
%{_datadir}/%{name}
e885f7
e885f7
%files manual
e885f7
%doc docs/manual/html
e885f7
%doc docs/manual/images/*.jpg
e885f7
%doc docs/manual/images/*.gif
e885f7
%license LICENSE NOTICE
e885f7
e885f7
%files javadoc -f .mfiles-javadoc
e885f7
%license LICENSE NOTICE
e885f7
e885f7
%changelog
e885f7
* Fri Aug 03 2018 Michael Simacek <msimacek@redhat.com> - 0:2.0-13.b6
e885f7
- Remove proprietary files from tarball
e885f7
e885f7
* Mon Jul 30 2018 Severin Gehwolf <sgehwolf@redhat.com> - 0:2.0-12.b6
e885f7
- Add requirement on javapackages-tools for script's usage of
e885f7
  java-functions.
e885f7
e885f7
* Mon Jul 30 2018 Michael Simacek <msimacek@redhat.com> - 0:2.0-11.b6
e885f7
- Repack the tarball without binaries
e885f7
e885f7
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.0-10.b6
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
e885f7
e885f7
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.0-9.b6
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e885f7
e885f7
* Sat Sep 23 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.0-8.b6
e885f7
- Properly conditionalize build-requires
e885f7
e885f7
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.0-7.b6
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e885f7
e885f7
* Tue Jun 13 2017 Michael Simacek <msimacek@redhat.com> - 0:2.0-6.b6
e885f7
- Add conditional for desktop file
e885f7
e885f7
* Fri Mar  3 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.0-5.b6
e885f7
- Install desktop icon to pixmaps instead of icons
e885f7
e885f7
* Fri Mar  3 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.0-4.b6
e885f7
- Fix directory ownership
e885f7
e885f7
* Tue Feb 07 2017 Michael Simacek <msimacek@redhat.com> - 0:2.0-3.b6
e885f7
- Build against glassfish-servlet-api
e885f7
e885f7
* Thu Nov 24 2016 Michael Simacek <msimacek@redhat.com> - 0:2.0-2.b6
e885f7
- Install into expected location
e885f7
e885f7
* Thu Nov 24 2016 Michael Simacek <msimacek@redhat.com> - 0:2.0-1.b6
e885f7
- Update to upstream version 2.0.b6
e885f7
e885f7
* Wed Oct 12 2016 Ville Skyttä <ville.skytta@iki.fi> - 0:1.3.0-36
e885f7
- Switch to jline 2.x in -utils
e885f7
- Mark License.txt as %%license
e885f7
e885f7
* Thu Jul 21 2016 Michael Simacek <msimacek@redhat.com> - 0:1.3.0-35
e885f7
- Replace perl usage with sed
e885f7
e885f7
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0:1.3.0-34
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e885f7
e885f7
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-33
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e885f7
e885f7
* Wed Nov  5 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.3.0-32
e885f7
- Remove workaround for RPM bug #646523
e885f7
e885f7
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-31
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e885f7
e885f7
* Wed May 21 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.3.0-30
e885f7
- Use .mfiles generated during build
e885f7
e885f7
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0:1.3.0-29
e885f7
- Use Requires: java-headless rebuild (#1067528)
e885f7
e885f7
* Wed Oct 30 2013 Michal Srb <msrb@redhat.com> - 0:1.3.0-28
e885f7
- Switch to jline1 (Resolves rhbz#1023018)
e885f7
e885f7
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-27
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e885f7
e885f7
* Fri Jul 12 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.3.0-26
e885f7
- Use %%add_maven_depmap instead of legacy macros
e885f7
- Install versionless javadocs
e885f7
- Remove old Obsoletes
e885f7
- Update and format descriptions
e885f7
- Install license file with manual and javadoc packages
e885f7
- Fix Requires and BuildRequires on java
e885f7
- Fix calls to %%jpackage_script
e885f7
e885f7
* Wed Jul 10 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.3.0-26
e885f7
- Remove arch-specific conditionals
e885f7
- Remove group tags
e885f7
- Remove Requires on jpackage-utils
e885f7
- Remove Requires on coreutils
e885f7
- Generate custom scripts with %%jpackage_script
e885f7
- Install versionless JARs only
e885f7
- Install POM files to %%{_mavenpomdir}
e885f7
e885f7
* Thu Jun 06 2013 Michal Srb <msrb@redhat.com> - 0:1.3.0-25
e885f7
- Enable tests
e885f7
- Fix BR
e885f7
e885f7
* Thu Feb 14 2013 Rahul Sundaram <sundaram@fedoraproject.org> - 0:1.3.0-24
e885f7
- remove vendor tag from desktop file. https://fedorahosted.org/fpc/ticket/247
e885f7
- clean up spec to follow current guidelines
e885f7
e885f7
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-23
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e885f7
e885f7
* Tue Nov 20 2012 David Tardon <dtardon@redhat.com> - 0:1.3.0-22
e885f7
- Resolves: rhbz#850008 bsh - Should not own /usr/share/maven-fragments
e885f7
  directory
e885f7
- Resolves: rhbz#878163 bsh - javadoc subpackage doesn't require
e885f7
  jpackage-utils
e885f7
- Resolves: rhbz#878166 bsh: Public Domain not listed in license tag
e885f7
e885f7
* Thu Nov  1 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.3.0-21
e885f7
- Add additional maven depmap
e885f7
e885f7
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-20
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
e885f7
e885f7
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-19
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
e885f7
e885f7
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-18
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
e885f7
e885f7
* Thu Nov 25 2010 Ville Skyttä <ville.skytta@iki.fi> - 0:1.3.0-17
e885f7
- Rename -desktop to -utils, move shell scripts and menu entry to it (#417491).
e885f7
- Bring icon cache scriptlets up to date with current guidelines.
e885f7
- Use jline in bsh script for command history support.
e885f7
- Prefer JRE over SDK when finding JVM to invoke in scripts.
e885f7
- Build with -source 1.5.
e885f7
e885f7
* Thu Nov 25 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0:1.3.0-16
e885f7
- Fix pom filenames (Resolves rhbz#655791)
e885f7
- Fix xsl errors when building docs
e885f7
e885f7
* Sat Jan 9 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.3.0-15.2
e885f7
- Drop gcj_support.
e885f7
- Fix rpmlint warnings.
e885f7
e885f7
* Mon Sep 21 2009 Permaine Cheung <pcheung@redhat.com> 0:1.3.0-15.1
e885f7
- Do not build manual and faq for ppc64 or s390x as the style task is disabled
e885f7
e885f7
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-15
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e885f7
e885f7
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:1.3.0-14
e885f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
e885f7
e885f7
* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0:1.3.0-13
e885f7
- drop repotag
e885f7
- fix license tag
e885f7
e885f7
* Mon Mar 10 2008 Permaine Cheung <pcheung@redhat.com> 0:1.3.0-12jpp.3
e885f7
- Fix bugzilla 436675. Separate menu entry into desktop subpackage.
e885f7
e885f7
* Thu Mar 06 2008 Permaine Cheung <pcheung@redhat.com> 0:1.3.0-12jpp.2
e885f7
- Fix bugzilla 417491. Thanks Ville Skytta for the patch.
e885f7
- Add menu entry and startup script for bsh desktop.
e885f7
- Ensure scriptlets exit with zero exit status.
e885f7
e885f7
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0:1.3.0-12jpp.1
e885f7
- Autorebuild for GCC 4.3
e885f7
e885f7
* Mon Jan 21 2008 Permaine Cheung <pcheung@redhat.com> 0:1.3.0-11jpp.1
e885f7
- Merge with upstream
e885f7
e885f7
* Thu Jul 12 2007 Ralph Apel <r.apel at r-apel.de> 0:1.3.0-11jpp
e885f7
- Fix aot build
e885f7
- Add pom and depmap frags
e885f7
- Restore all jars
e885f7
- Add webapps
e885f7
e885f7
* Fri Mar 16 2007 Permaine Cheung <pcheung@redhat.com> 0:1.3.0-10jpp.1
e885f7
- Merge with upstream
e885f7
- Removed unapplied patch and moved buildroot removal from prep to install,
e885f7
  and other rpmlint cleanup
e885f7
e885f7
* Mon Mar 12 2007 Karsten Hopp <karsten@redhat.com> 1.3.0-9jpp.2
e885f7
- add buildrequirement ant-trax for documentation
e885f7
e885f7
* Fri Aug 04 2006 Deepak Bhole <dbhole@redhat.com> 0:1.3.0-9jpp.1
e885f7
- Added missing requirements
e885f7
e885f7
* Sat Jul 22 2006 Jakub Jelinek <jakub@redhat.com> 0:1.3.0-8jpp_3fc
e885f7
- Rebuilt
e885f7
e885f7
* Fri Jul 21 2006 Deepak Bhole <dbhole@redhat.com> 0:1.3.0-8jpp_2fc
e885f7
- Removing vendor and distribution tags.
e885f7
e885f7
* Thu Jul 20 2006 Deepak Bhole <dbhole@redhat.com> 0:1.3.0-8jpp_1fc
e885f7
- Add conditional native compilation.
e885f7
e885f7
* Thu May 04 2006 Ralph Apel <r.apel at r-apel.de> 0:1.3.0-7jpp
e885f7
- First JPP-1.7 release
e885f7
e885f7
* Fri Aug 20 2004 Ralph Apel <r.apel at r-apel.de> 0:1.3.0-6jpp
e885f7
- Build with ant-1.6.2
e885f7
e885f7
* Mon Jan 26 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-5jpp
e885f7
- really drop readline patch
e885f7
e885f7
* Sun Jan 25 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-4jpp
e885f7
- drop readline patch
e885f7
e885f7
* Wed Jan 21 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-3jpp
e885f7
- port libreadline-java patch to new bsh
e885f7
e885f7
* Tue Jan 20 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-2jpp
e885f7
- add Distribution tag
e885f7
e885f7
* Tue Jan 20 2004 David Walluck <david@anti-microsoft.org> 0:1.3.0-1jpp
e885f7
- 1.3.0
e885f7
- remove bsf patch (fixed upstream)
e885f7
- add epoch to demo package Requires
e885f7
e885f7
* Sat Apr 12 2003 David Walluck <david@anti-microsoft.org> 0:1.2-0.b8.4jpp
e885f7
- fix strange permissions
e885f7
e885f7
* Fri Apr 11 2003 David Walluck <david@anti-microsoft.org> 0:1.2-0.b8.3jpp
e885f7
- rebuild for JPackage 1.5
e885f7
- add bsf patch
e885f7
e885f7
* Sat Feb 01 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.2jpp
e885f7
- remove servlet dependency (if anyone wants to add this as a separate
e885f7
  package and do the tomcat integration, be my guest)
e885f7
e885f7
* Thu Jan 23 2003 David Walluck <david@anti-microsoft.org> 1.2-0.b8.1jpp
e885f7
- rename to bsh
e885f7
- add manual
e885f7
- add Changes.html to %%doc
e885f7
- add bsh and bshdoc scripts
e885f7
- add %%dir %%{_datadir}/%%{name} to main package
e885f7
- correct test interpreter and make bsh files executable
e885f7
e885f7
* Mon Jan 21 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-3jpp
e885f7
- really section macro
e885f7
e885f7
* Sun Jan 20 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-2jpp
e885f7
- additional sources in individual archives
e885f7
- versioned dir for javadoc
e885f7
- no dependencies for javadoc package
e885f7
- stricter dependency for demo package
e885f7
- section macro
e885f7
e885f7
* Tue Dec 18 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 1.01-1jpp
e885f7
- first JPackage release