Generate custom scripts with %jpackage_script
This commit is contained in:
parent
642b0665b4
commit
7e3acd46fc
50
bsh.spec
50
bsh.spec
@ -210,53 +210,8 @@ install -m 644 dist/bshservlet-wbsh.war $RPM_BUILD_ROOT%{_datadir}/%{name}/webap
|
||||
# scripts
|
||||
install -d $RPM_BUILD_ROOT%{_bindir}
|
||||
|
||||
function bsh_script() {
|
||||
local jars=%{name}.jar runclass=
|
||||
if [ $2 = jline.ConsoleRunner ] ; then
|
||||
jars="$jars jline.jar"
|
||||
runclass=bsh.Interpreter
|
||||
fi
|
||||
cat > $RPM_BUILD_ROOT%{_bindir}/$1 << EOF
|
||||
#!/bin/sh
|
||||
#
|
||||
# $1 script
|
||||
# JPackage Project (http://jpackage.sourceforge.net)
|
||||
|
||||
# Source functions library
|
||||
_prefer_jre=true
|
||||
. %{_datadir}/java-utils/java-functions
|
||||
|
||||
# Source system prefs
|
||||
if [ -f %{_sysconfdir}/%{name}.conf ] ; then
|
||||
. %{_sysconfdir}/%{name}.conf
|
||||
fi
|
||||
|
||||
# Source user prefs
|
||||
if [ -f \$HOME/.%{name}rc ] ; then
|
||||
. \$HOME/.%{name}rc
|
||||
fi
|
||||
|
||||
# Configuration
|
||||
MAIN_CLASS=$2
|
||||
if [ -n "\$BSH_DEBUG" ]; then
|
||||
BASE_FLAGS=-Ddebug=true
|
||||
fi
|
||||
|
||||
BASE_JARS="$jars"
|
||||
|
||||
# Set parameters
|
||||
set_jvm
|
||||
set_classpath \$BASE_JARS
|
||||
set_flags \$BASE_FLAGS
|
||||
set_options \$BASE_OPTIONS
|
||||
|
||||
# Let's start
|
||||
run $runclass "\$@"
|
||||
EOF
|
||||
}
|
||||
|
||||
bsh_script bsh jline.ConsoleRunner
|
||||
bsh_script bsh-desktop bsh.Console
|
||||
%jpackage_script jline.ConsoleRunner "\\${BSH_DEBUG:+-Ddebug=true}" bsh.Interpreter %{name}:jline %{name} true
|
||||
%jpackage_script bsh.Console "\\${BSH_DEBUG:+-Ddebug=true}" "" %{name} %{name}-console true
|
||||
|
||||
cat > $RPM_BUILD_ROOT%{_bindir}/%{name}doc << EOF
|
||||
#!/usr/bin/env %{_bindir}/%{name}
|
||||
@ -311,6 +266,7 @@ fi
|
||||
- Remove group tags
|
||||
- Remove Requires on jpackage-utils
|
||||
- Remove Requires on coreutils
|
||||
- Generate custom scripts with %%jpackage_script
|
||||
|
||||
* Thu Jun 06 2013 Michal Srb <msrb@redhat.com> - 0:1.3.0-25
|
||||
- Enable tests
|
||||
|
Loading…
Reference in New Issue
Block a user