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 Name: bsh
Version: 1.3.0 Version: 1.3.0
Release: 12jpp.1%{?dist} Release: 12jpp.2%{?dist}
Epoch: 0 Epoch: 0
Summary: Lightweight Scripting for Java Summary: Lightweight Scripting for Java
License: LGPL License: LGPL
@ -42,10 +42,11 @@ Source0: %{name}-%{version}-src.tar.bz2
#tar cjf bsh-1.3.0-src.tar.bz2 BeanShell #tar cjf bsh-1.3.0-src.tar.bz2 BeanShell
Source1: bsh-1.3.0.pom Source1: bsh-1.3.0.pom
Source2: bsh-bsf-1.3.0.pom Source2: bsh-bsf-1.3.0.pom
Source3: %{name}-desktop.desktop
Patch0: %{name}-build.patch Patch0: %{name}-build.patch
#Patch1: %{name}-readline.patch #Patch1: %{name}-readline.patch
BuildRequires: ant, bsf, ant-trax BuildRequires: ant, bsf, ant-trax, ImageMagick, desktop-file-utils
BuildRequires: servlet BuildRequires: servlet
Requires: bsf Requires: bsf
Requires: jpackage-utils >= 0:1.7.2 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} install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} cp -pr javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} 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 # demo
for i in `find tests -name \*.bsh`; do 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 # scripts
install -d $RPM_BUILD_ROOT%{_bindir} 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 #!/bin/sh
# #
# %{name} script # $1 script
# JPackage Project (http://jpackage.sourceforge.net) # JPackage Project (http://jpackage.sourceforge.net)
# Source functions library # Source functions library
@ -225,7 +233,7 @@ if [ -f \$HOME/.%{name}rc ] ; then
fi fi
# Configuration # Configuration
MAIN_CLASS=bsh.Interpreter MAIN_CLASS=$2
if [ -n "\$BSH_DEBUG" ]; then if [ -n "\$BSH_DEBUG" ]; then
BASE_FLAGS=-Ddebug=true BASE_FLAGS=-Ddebug=true
fi fi
@ -247,6 +255,10 @@ set_options \$BASE_OPTIONS
# Let's start # Let's start
run "\$@" run "\$@"
EOF EOF
}
bsh_script bsh bsh.Interpreter
bsh_script bsh-desktop bsh.Console
cat > $RPM_BUILD_ROOT%{_bindir}/%{name}doc << EOF cat > $RPM_BUILD_ROOT%{_bindir}/%{name}doc << EOF
#!/usr/bin/env %{_bindir}/%{name} #!/usr/bin/env %{_bindir}/%{name}
@ -263,6 +275,10 @@ cat scripts/bshdoc.bsh >> $RPM_BUILD_ROOT%{_bindir}/%{name}doc
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%post %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 %update_maven_depmap
%if %{gcj_support} %if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ] if [ -x %{_bindir}/rebuild-gcj-db ]
@ -270,8 +286,13 @@ then
%{_bindir}/rebuild-gcj-db %{_bindir}/rebuild-gcj-db
fi fi
%endif %endif
exit 0
%postun %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 %update_maven_depmap
%if %{gcj_support} %if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ] if [ -x %{_bindir}/rebuild-gcj-db ]
@ -279,14 +300,18 @@ then
%{_bindir}/rebuild-gcj-db %{_bindir}/rebuild-gcj-db
fi fi
%endif %endif
exit 0
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%doc src/Changes.html src/License.txt src/README.txt %doc src/Changes.html src/License.txt src/README.txt
%attr(0755,root,root) %{_bindir}/%{name} %attr(0755,root,root) %{_bindir}/%{name}
%attr(0755,root,root) %{_bindir}/%{name}-desktop
%attr(0755,root,root) %{_bindir}/%{name}doc %attr(0755,root,root) %{_bindir}/%{name}doc
%{_javadir}/* %{_javadir}/*
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%{_datadir}/applications/*%{name}-desktop.desktop
%{_datadir}/icons/hicolor/*x*/apps/%{name}.png
%{_datadir}/%{name}/webapps %{_datadir}/%{name}/webapps
%{_datadir}/maven2/poms/* %{_datadir}/maven2/poms/*
%{_mavendepmapfragdir} %{_mavendepmapfragdir}
@ -310,6 +335,11 @@ fi
%{_datadir}/%{name}/* %{_datadir}/%{name}/*
%changelog %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 * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 0:1.3.0-12jpp.1
- Autorebuild for GCC 4.3 - Autorebuild for GCC 4.3