summaryrefslogtreecommitdiff
path: root/games-arcade/savagewheels/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-arcade/savagewheels/files
reinit the tree, so we can have metadata
Diffstat (limited to 'games-arcade/savagewheels/files')
-rw-r--r--games-arcade/savagewheels/files/savagewheels.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/games-arcade/savagewheels/files/savagewheels.in b/games-arcade/savagewheels/files/savagewheels.in
new file mode 100644
index 000000000000..c1b4c689f71c
--- /dev/null
+++ b/games-arcade/savagewheels/files/savagewheels.in
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+export SAVAGEWHEELS_SYS_DATADIR="${SAVAGEWHEELS_SYS_DATADIR-@CMAKE_INSTALL_DATADIR@}"
+export SAVAGEWHEELS_LIBEXECDIR="${SAVAGEWHEELS_LIBEXECDIR-@CMAKE_INSTALL_LIBEXECDIR@}"
+export SAVAGEWHEELS_USR_CONFDIR="${SAVAGEWHEELS_USR_CONFDIR-${HOME}/.config/savagewheels}"
+export SAVAGEWHEELS_USR_DATADIR="${SAVAGEWHEELS_USR_DATADIR-${HOME}/.local/share/savagewheels}"
+
+if [ ! -d ${SAVAGEWHEELS_USR_CONFDIR} ]; then
+ if [ -e ${SAVAGEWHEELS_USR_CONFDIR} ]; then
+ printf "${SAVAGEWHEELS_USR_CONFDIR} exists but is not a directory.\n" >&2
+ printf " Please remove.\n" >&2
+ exit 1
+ fi
+ mkdir -p ${SAVAGEWHEELS_USR_CONFDIR}
+ if [ $? -ne 0 ]; then
+ printf "Failed to create ${SAVAGEWHEELS_USR_CONFDIR}\n" >&2
+ exit 1
+ fi
+fi
+
+if [ ! -d ${SAVAGEWHEELS_USR_DATADIR} ]; then
+ if [ -e ${SAVAGEWHEELS_USR_DATADIR} ]; then
+ printf "${SAVAGEWHEELS_USR_DATADIR} exists but is not a directory.\n" >&2
+ printf " Please remove.\n" >&2
+ exit 1
+ fi
+ mkdir -p ${SAVAGEWHEELS_USR_DATADIR}
+ if [ $? -ne 0 ]; then
+ printf "Failed to create ${SAVAGEWHEELS_USR_DATADIR}\n" >&2
+ exit 1
+ fi
+fi
+
+if [ ! -e ${SAVAGEWHEELS_USR_CONFDIR}/bindings.xml ]; then
+ cp ${SAVAGEWHEELS_SYS_DATADIR}/bindings.xml ${SAVAGEWHEELS_USR_CONFDIR}
+ if [ $? -ne 0 ]; then
+ printf "Failed to create ${SAVAGEWHEELS_USR_CONFDIR}/bindings.xml\n" >&2
+ exit 1
+ fi
+fi
+
+exec ${SAVAGEWHEELS_LIBEXECDIR}/savagewheels "$@"