summaryrefslogtreecommitdiff
path: root/emulators/linux-ePSXe/files/epsxe-install.in
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/linux-ePSXe/files/epsxe-install.in')
-rw-r--r--emulators/linux-ePSXe/files/epsxe-install.in72
1 files changed, 72 insertions, 0 deletions
diff --git a/emulators/linux-ePSXe/files/epsxe-install.in b/emulators/linux-ePSXe/files/epsxe-install.in
new file mode 100644
index 000000000000..5c0e81eee4c8
--- /dev/null
+++ b/emulators/linux-ePSXe/files/epsxe-install.in
@@ -0,0 +1,72 @@
+#!/bin/sh
+# epsxe-install - ePSXe user installation
+#
+# (c) 2002-2003 Jean-Yves Lefort.
+# All rights reserved.
+
+EPSXE=@EPSXE@
+DATADIR=@DATADIR@
+PSEMUPRO_PLUGINS_DIR=@PSEMUPRO_PLUGINS_DIR@
+PSEMUPRO_CFGBINS_DIR=@PSEMUPRO_CFGBINS_DIR@
+PSEMUPRO_CFGFILES_DIR=@PSEMUPRO_CFGFILES_DIR@
+
+USERDIR=$HOME/.epsxe
+
+_mkdir () {
+ if [ ! -e $1 ]; then
+ echo "Creating directory $1"
+ mkdir -p $1
+ fi
+}
+
+_ln () {
+ if [ ! -e $2 ]; then
+ echo "Creating symlink $2"
+ ln -sf $1 $2
+ fi
+}
+
+_install () {
+ if [ ! -e $2 ]; then
+ echo "Copying $1 to $2"
+ install -m $3 $1 $2
+ fi
+}
+
+for d in \
+ $USERDIR \
+ $USERDIR/bios \
+ $USERDIR/cfg \
+ $USERDIR/cheats \
+ $USERDIR/memcards \
+ $USERDIR/patches \
+ $USERDIR/plugins \
+ $USERDIR/snap \
+ $USERDIR/sstates; do
+ _mkdir $d || exit $?
+done
+
+_ln $EPSXE $USERDIR/epsxe || exit $?
+
+for f in \
+ keycodes.lst \
+ cheats/breath_of_fire_4_usa.cht \
+ cheats/chrono_cross_ntsc.cht \
+ cheats/tarzan_pal.cht; do
+ _ln $DATADIR/$f $USERDIR/$f || exit $?
+done
+
+for p in $PSEMUPRO_PLUGINS_DIR/*; do
+ [ -e $p ] || break
+ _ln $p $USERDIR/plugins/`basename $p` || exit $?
+done
+
+for c in $PSEMUPRO_CFGBINS_DIR/*; do
+ [ -e $c ] || break
+ _ln $c $USERDIR/cfg/`basename $c` || exit $?
+done
+
+for c in $PSEMUPRO_CFGFILES_DIR/*; do
+ [ -e $c ] || break
+ _install $c $USERDIR/cfg/`basename $c` 0644 || exit $?
+done