]>
git.siccegge.de Git - ghextris.git/blob - install.sh
3 if [ "f$1" == f
]; then
4 echo "usage: $0 prefix [real_prefix]"
6 echo "where prefix is the directory under which to install (eg. /usr, /usr/local)"
7 echo "and real_prefix is the directory under which the program is eventually"
8 echo "to run (the same as prefix by default)."
9 echo "You probably don't want to touch the latter by hand."
15 BINDIR
="$PREFIX/games"
16 MANDIR
="$PREFIX/share/man/man6"
17 SHAREDIR
="$PREFIX/share/games/ghextris"
18 LOCALEDIR
="$PREFIX/share/locale"
19 APPDIR
="$PREFIX/share/applications"
21 if [ "f$2" == f
]; then
27 REALSHAREDIR
="$REALPREFIX/share/games/ghextris"
31 echo "Installing program files"
33 mkdir
-m 755 -p "$BINDIR" ||
exit 1
34 mkdir
-m 755 -p "$SHAREDIR" ||
exit 1
35 mkdir
-m 755 -p "$APPDIR" ||
exit 1
36 mkdir
-m 755 -p "$MANDIR" ||
exit 1
38 sed "s#^SHAREDIR.*#SHAREDIR = \"$REALSHAREDIR\"#" < ghextris.py
> "$SHAREDIR/ghextris.py" ||
exit 1
39 chmod 755 "$SHAREDIR/ghextris.py"
40 sed "s#^Icon=.*#Icon=$REALSHAREDIR/ghextris.png#" < ghextris.desktop
> "$APPDIR/ghextris.desktop" ||
exit 1
41 chmod 644 "$APPDIR/ghextris.desktop"
43 cp ghextris.glade
"$SHAREDIR" ||
exit 1
44 cp ghextris.png
"$SHAREDIR" ||
exit 1
45 cp ghextris-icon.xpm
"$SHAREDIR" ||
exit 1
46 cp ghextris.man
"$MANDIR/ghextris.6" ||
exit 1
48 # We just link the .py into the games directory for now; in the future,
49 # this step may be replaced by optional installation of a setgid games
50 # wrapper program for scorekeeping
51 ln -sf ..
/share
/games
/ghextris
/ghextris.py
"$BINDIR"/ghextris ||
exit 1
53 echo "Checking for msgfmt"
55 if which msgfmt
> /dev
/null
; then
56 echo "msgfmt found, installing translations"
59 LANG
="`basename $a .po`"
61 mkdir
-m 755 -p "$LOCALEDIR/$LANG/LC_MESSAGES"
62 msgfmt
-o "$LOCALEDIR/$LANG/LC_MESSAGES/ghextris.mo" "$a" ||
exit 1
65 echo "msgfmt not found; translations not installed"