From 7e3acd46fc7eef22a507ff75a382ade661ade5e5 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 10 Jul 2013 15:24:42 +0200 Subject: [PATCH] Generate custom scripts with %jpackage_script --- bsh.spec | 50 +++----------------------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/bsh.spec b/bsh.spec index 747790e..1d134a8 100644 --- a/bsh.spec +++ b/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 - 0:1.3.0-25 - Enable tests