Fix bugzilla 417491. Thanks Ville Skytta for the patch. Add menu entry and

startup script for bsh desktop. Ensure scriptlets exit with zero exit
    status.
This commit is contained in:
Permaine Cheung 2008-03-06 13:18:43 +00:00
parent 743253011f
commit 3dca6f4a22
2 changed files with 44 additions and 5 deletions

9
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

View File

@ -32,7 +32,7 @@
Name: bsh
Version: 1.3.0
Release: 12jpp.1%{?dist}
Release: 12jpp.2%{?dist}
Epoch: 0
Summary: Lightweight Scripting for Java
License: LGPL
@ -42,10 +42,11 @@ Source0: %{name}-%{version}-src.tar.bz2
#tar cjf bsh-1.3.0-src.tar.bz2 BeanShell
Source1: bsh-1.3.0.pom
Source2: bsh-bsf-1.3.0.pom
Source3: %{name}-desktop.desktop
Patch0: %{name}-build.patch
#Patch1: %{name}-readline.patch
BuildRequires: ant, bsf, ant-trax
BuildRequires: ant, bsf, ant-trax, ImageMagick, desktop-file-utils
BuildRequires: servlet
Requires: bsf
Requires: jpackage-utils >= 0:1.7.2
@ -173,6 +174,12 @@ find docs -name "*.log" -exec rm -f {} \;
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# menu entry
desktop-file-install --vendor=fedora --mode=644 \
--dir=$RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE3}
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps
convert src/bsh/util/lib/icon.gif \
$RPM_BUILD_ROOT%{_datadir}/icons/hicolor/16x16/apps/bsh.png
# demo
for i in `find tests -name \*.bsh`; do
@ -205,10 +212,11 @@ install -m 644 dist/bshservlet-wbsh.war $RPM_BUILD_ROOT%{_datadir}/%{name}/webap
# scripts
install -d $RPM_BUILD_ROOT%{_bindir}
cat > $RPM_BUILD_ROOT%{_bindir}/%{name} << EOF
function bsh_script() {
cat > $RPM_BUILD_ROOT%{_bindir}/$1 << EOF
#!/bin/sh
#
# %{name} script
# $1 script
# JPackage Project (http://jpackage.sourceforge.net)
# Source functions library
@ -225,7 +233,7 @@ if [ -f \$HOME/.%{name}rc ] ; then
fi
# Configuration
MAIN_CLASS=bsh.Interpreter
MAIN_CLASS=$2
if [ -n "\$BSH_DEBUG" ]; then
BASE_FLAGS=-Ddebug=true
fi
@ -247,6 +255,10 @@ set_options \$BASE_OPTIONS
# Let's start
run "\$@"
EOF
}
bsh_script bsh bsh.Interpreter
bsh_script bsh-desktop bsh.Console
cat > $RPM_BUILD_ROOT%{_bindir}/%{name}doc << EOF
#!/usr/bin/env %{_bindir}/%{name}
@ -263,6 +275,10 @@ cat scripts/bshdoc.bsh >> $RPM_BUILD_ROOT%{_bindir}/%{name}doc
rm -rf $RPM_BUILD_ROOT
%post
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
@ -270,8 +286,13 @@ then
%{_bindir}/rebuild-gcj-db
fi
%endif
exit 0
%postun
touch --no-create %{_datadir}/icons/hicolor
if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
%{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor
fi
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
@ -279,14 +300,18 @@ then
%{_bindir}/rebuild-gcj-db
fi
%endif
exit 0
%files
%defattr(-,root,root)
%doc src/Changes.html src/License.txt src/README.txt
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}-desktop
%attr(0755,root,root) %{_bindir}/%{name}doc
%{_javadir}/*
%dir %{_datadir}/%{name}
%{_datadir}/applications/*%{name}-desktop.desktop
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_datadir}/%{name}/webapps
%{_datadir}/maven2/poms/*
%{_mavendepmapfragdir}
@ -310,6 +335,11 @@ fi
%{_datadir}/%{name}/*
%changelog
* Thu Mar 06 2008 Permaine Cheung <pcheung@redhat.com> 0:1.3.0-12jpp.2
- Fix bugzilla 417491. Thanks Ville Skytta for the patch.
- Add menu entry and startup script for bsh desktop.
- Ensure scriptlets exit with zero exit status.
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0:1.3.0-12jpp.1
- Autorebuild for GCC 4.3