3
# mupen64plus install script
5
# Copyright 2007, 2008 The Mupen64Plus Development Team
6
# Modifications Copyright 2008 Guido Berhoerster
8
# This program is free software; you can redistribute it and/or
9
# modify it under the terms of the GNU General Public License
10
# as published by the Free Software Foundation; either version 2
11
# of the License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
export PATH=/bin:/usr/bin
30
if command -v ginstall >/dev/null 2>&1; then
32
elif install --help >/dev/null 2>&1; then
34
elif [ -e "`which install 2>/dev/null`" ]; then
35
printf "warning: GNU install not found, assuming BSD install\n" >&2
39
printf "error: install tool not found\n" >&2
45
printf "usage: $(basename $0) [PREFIX] [SHAREDIR] [BINDIR] [LIBDIR] [MANDIR] [APPLICATIONSDIR]
46
\tPREFIX - installation directories prefix (default: /usr/local)
47
\tSHAREDIR - path to Mupen64Plus shared data files (default: \$PREFIX/share/mupen64plus)
48
\tBINDIR - path to Mupen64Plus binary program files (default: \$PREFIX/bin)
49
\tLIBDIR - path to Mupen64Plus plugins (default: \$SHAREDIR/plugins)
50
\tMANDIR - path to manual files (default: \$PREFIX/man/man1)
51
\tAPPLICATIONSDIR - path to place .desktop file in (default: \$PREFIX/share/applications)
60
PREFIX="${1:-/usr/local}"
61
SHAREDIR="${2:-${PREFIX}/share/mupen64plus}"
62
BINDIR="${3:-${PREFIX}/bin}"
63
LIBDIR="${4:-${SHAREDIR}/plugins}"
64
MANDIR="${5:-${PREFIX}/man/man1}"
65
APPLICATIONSDIR="${6:-${PREFIX}/share/applications}"
67
printf "Installing Mupen64Plus to ${PREFIX}\n"
68
$INSTALL -d -v "${SHAREDIR}"
69
$INSTALL -d -v "${SHAREDIR}/config"
70
$INSTALL -m 0644 config/* "${SHAREDIR}/config"
71
$INSTALL -m 0644 mupen64plus.ini "${SHAREDIR}/"
72
$INSTALL -d -v "${SHAREDIR}/doc"
73
$INSTALL -m 0644 doc/* "${SHAREDIR}/doc"
74
$INSTALL -d -v "${SHAREDIR}/fonts"
75
$INSTALL -m 0644 fonts/* "${SHAREDIR}/fonts"
76
$INSTALL -d -v "${SHAREDIR}/icons"
77
$INSTALL -m 0644 icons/*.png "${SHAREDIR}/icons"
78
$INSTALL -d -v "${SHAREDIR}/icons/32x32"
79
$INSTALL -m 0644 icons/32x32/* "${SHAREDIR}/icons/32x32"
80
$INSTALL -d -v "${SHAREDIR}/icons/22x22"
81
$INSTALL -m 0644 icons/22x22/* "${SHAREDIR}/icons/22x22"
82
$INSTALL -d -v "${SHAREDIR}/icons/16x16"
83
$INSTALL -m 0644 icons/16x16/* "${SHAREDIR}/icons/16x16"
84
$INSTALL -d -v "${SHAREDIR}/lang"
85
$INSTALL -m 0644 lang/* "${SHAREDIR}/lang"
86
$INSTALL $GINSTALLFLAG -m 0755 mupen64plus "${BINDIR}/mupen64plus"
87
$INSTALL -d -v "${MANDIR}"
88
$INSTALL -m 0644 doc/mupen64plus.1.gz "${MANDIR}"
89
$INSTALL -d -v "${LIBDIR}"
90
if [ -f mupen64plus.desktop ]
92
$INSTALL -d -v "${APPLICATIONSDIR}"
93
$INSTALL -m 0644 mupen64plus.desktop "${APPLICATIONSDIR}"
95
if [ "x$(ls plugins/)" != "x" ]
97
$INSTALL -m 0644 plugins/* "${LIBDIR}"
99
if [ "x$(ls translations/*.qm 2>/dev/null)" != "x" ]
101
$INSTALL -d -v "${SHAREDIR}/translations"
102
$INSTALL -m 0644 translations/*.qm "${SHAREDIR}/translations"