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