-
Notifications
You must be signed in to change notification settings - Fork 60
/
install.sh
executable file
·61 lines (53 loc) · 2.01 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
# this is the install-script for the game
# I will install the game to your system :)
# the following variables will be used:
# SYSTEM_DATA_DIR - the dir, where the game-data will be installed into
# it should be the same as used for compilation
# default=/usr/share
# BIN_DIR - the dir, where the binary will be put into
# default=/usr/bin
# DOC_DIR - the dir, where I will place the docs into
# default=/usr/share/doc
# PIXMAP_DIR - dir, where I put the icon
# PREFIX - additional prefix for everything
# ( all paths are only prefixes, I will add /OpenLieroX at the end )
if [ ! -x bin/openlierox ]; then
echo "ERROR: the binary is missing" >&2
echo "please run ./compile.sh to compile it first"
exit 1
fi
[ "$SYSTEM_DATA_DIR" = "" ] && SYSTEM_DATA_DIR=/usr/share
[ "$BIN_DIR" = "" ] && BIN_DIR=/usr/bin
[ "$DOC_DIR" = "" ] && DOC_DIR=/usr/share/doc
if [ "$PREFIX" != "" ]; then
SYSTEM_DATA_DIR=$PREFIX/$SYSTEM_DATA_DIR
BIN_DIR=$PREFIX/$BIN_DIR
DOC_DIR=$PREFIX/$DOC_DIR
fi
cp bin/openlierox $BIN_DIR/
echo "> $BIN_DIR/openlierox copied"
mkdir -p $SYSTEM_DATA_DIR/OpenLieroX
cp -r share/gamedir/* $SYSTEM_DATA_DIR/OpenLieroX/
echo "> $SYSTEM_DATA_DIR/OpenLieroX copied"
mkdir -p $DOC_DIR/openlierox
cp -r doc/* $DOC_DIR/openlierox/
echo "> $DOC_DIR/openlierox copied"
# cleanup
for d in $DOC_DIR/openlierox $SYSTEM_DATA_DIR/OpenLieroX; do
find $d \( \( -true -a \
\( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
-o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
-o -name '.svn' \
-o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
-o -name TAGS -o -name core -o \( -path '*/.deps/*' -a -name '*.P' \) \
\) -exec rm -rf {} \; \) -o \
\( -type d -a -name autom4te.cache -prune -exec rm -rf {} \; \) \) 2>/dev/null
done
# gzip doc files
for f in $DOC_DIR/openlierox/*; do
if [ -f "$f" ]; then
gzip -9 $f
fi
done
echo ">>> installation ready"