X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=blobdiff_plain;f=jpctb;h=50f295298b14b58b3cd688eafb23c4bef19aaaac;hp=a2cb243e910b5754201bc56757f7b2e230e8a39a;hb=1b3d354d33db2696417989647cf04f5302907065;hpb=f990674d59428070dc501681c7fafd6a2e7e07d7 diff --git a/jpctb b/jpctb index a2cb243..50f2952 100755 --- a/jpctb +++ b/jpctb @@ -1,6 +1,30 @@ #!/bin/bash -e + +# This is jpctb, a wrapper script for plumbing Ted Pearson's Java PCTB +# client into a JVM on Linux. + +# This program is Free Software. Copyright (C) 2009 Ian Jackson. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is fur- +# nished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- +# NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +# NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + usage () { cat <&1` + set -e +fi + +cat <&2 "control panel failed with exit status $rc"; exit "$rc" ;; +esac + + #---------- create the temporary are and link farm ---------- rm -rf -- "$jtmp" mkdir -- "$jtmp" "$extdir" "$linkfarm" cp "$srcjardir"/PCTB*.jar "$extdir" -lndir -silent "$javadir" "$linkfarm" +cp -Rs "$javadir"/. "$linkfarm"/. #---------- edit the linkfarm to have our jvm wrapper ---------- -wrapper="$linkfarm"/jre/bin/java +wrapper="$linkfarm"/$jreleaf/bin/java rm -- "$wrapper" export JPCTB_EXTDIR="$extdir" -export JPCTB_JRE="$javadir/jre" cat <<'END' >"$wrapper" #!/bin/bash @@ -116,4 +243,4 @@ chmod +x -- "$wrapper" #---------- now run it ---------- -exec "$yohoho" -Djava.home="$linkfarm/jre" +exec $setup_only_simulate "$yohoho" -Djava.home="$linkfarm/$jreleaf"