#! /bin/sh # Generic installation script for Ponscripter games. # # Copyright (C) 2009 Haeleth. # # 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 furnished 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, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS I THE SOFTWARE. # Game-specific variables: GAME=narcissu2 # Name of game (used to name directory and launcher) TITLE="Narcissu Side 2nd" # Pretty name of game GAMEID=Narcissu_Side_2nd # ;gameid after Unix transformation GAMEVER=1.00 # Version number of game COPYRIGHT="Copyright (c) 2005-2007 Stage-Nana, 2005-2009 Insani/Haeleth/Agilis" NEEDVER=20090104 # Minimum version of Ponscripter required # The remainder of this file should not need customisation. # Default options PREFIX=/usr/local PONSCR= # Parse options prev= for opt do if test -n "$prev"; then eval "$prev=\$opt" prev= continue fi arg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case $opt in --prefix=* | -prefix=*) PREFIX=$arg ;; --prefix | -prefix) prev=PREFIX ;; --ponscr=* | -ponscr=*) PONSCR=$arg ;; --ponscr | -ponscr) prev=PONSCR ;; -\? | -h* | --h*) cat < Options: --help display this message --prefix=DIR install in prefix DIR (default is /usr/local) --ponscr=PATH specify location of ponscr program EOF exit 0 ;; *) echo "Ignoring unknown option $opt" ;; esac done if test -n "$prev"; then opt=--`echo $prev | tr '[A-Z]_' '[a-z]-'` echo "Error: missing argument to $opt" >&2 exit 2 fi # ---------- Check environment ---------- # permission to write to PREFIX if test ! -w "$PREFIX"; then cat </dev/null` fi if test -z "$PONSCR"; then PONSCR=ponscr fi PSCVER=`($PONSCR --version) 2>/dev/null | awk '/version/ { print $3 }'` if test -z "$PSCVER"; then cat </dev/null" 0 cat > $TMPSCR < Options: --debug -d enable debugging output (very verbose!) --window start in windowed mode --fullscreen start in fullscreen mode --save DIR put saves and settings in DIR (default: \$HOME/.$GAMEID) Information: --help -h display this message --version -v display version and copyright information Administration: --uninstall uninstall $TITLE ENDHELP exit 0 ;; *) echo "Ignoring unknown option \$opt" ;; esac done if test -n "\$prev"; then opt=--\`echo \$prev | tr '[A-Z]_' '[a-z]-'\` echo "Error: missing argument to \$opt" >&2 exit 2 fi if \$PLAY; then if [ ! -z "\$SAVE" ]; then SAVE="--save \$SAVE"; fi exec $PONSCR \\ -r $PREFIX/share/games/$GAME \\ \$WINDOW \$SAVE \$DEBUG fi if test ! -w $PREFIX/share/games; then cat <