Path: blob/master/libmupen64plus/mupen64plus-core/tools/install_binary_bundle.sh
2 views
#!/bin/sh1#2# mupen64plus binary bundle install script3#4# Copyright 2007-2013 The Mupen64Plus Development Team5#6# This program is free software; you can redistribute it and/or7# modify it under the terms of the GNU General Public License8# as published by the Free Software Foundation; either version 29# of the License, or (at your option) any later version.10#11# This program is distributed in the hope that it will be useful,12# but WITHOUT ANY WARRANTY; without even the implied warranty of13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14# GNU General Public License for more details.15#16# You should have received a copy of the GNU General Public License17# along with this program; if not, write to the Free Software18# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA19# 02110-1301, USA.20#2122set -e2324export PATH=/bin:/usr/bin2526GINSTALLFLAG=-D2728if `which ginstall >/dev/null 2>&1`; then29INSTALL=ginstall30elif install --help >/dev/null 2>&1; then31INSTALL=install32elif [ -e "`which install 2>/dev/null`" ]; then33printf "warning: GNU install not found, assuming BSD install\n" >&234INSTALL=install35GINSTALLFLAG=36else37printf "error: install tool not found\n" >&238exit 139fi4041INSTALL_STRIP_FLAG="${INSTALL_STRIP_FLAG:=-s}"4243usage()44{45printf "usage: $(basename $0) [PREFIX] [SHAREDIR] [BINDIR] [LIBDIR] [PLUGINDIR] [MANDIR]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 core library (default: \$PREFIX/lib)50\tPLUGINDIR - path to Mupen64Plus plugin libraries (default: \$PREFIX/lib/mupen64plus)51\tMANDIR - path to manual files (default: \$PREFIX/share/man)52"53}5455if [ $# -gt 6 ]; then56usage57exit 158fi5960PREFIX="${1:-/usr/local}"61SHAREDIR="${2:-${PREFIX}/share/mupen64plus}"62BINDIR="${3:-${PREFIX}/bin}"63LIBDIR="${4:-${PREFIX}/lib}"64PLUGINDIR="${5:-${PREFIX}/lib/mupen64plus}"65MANDIR="${6:-${PREFIX}/share/man}"6667# simple check for permissions68if [ -d "${SHAREDIR}" -a ! -w "${SHAREDIR}" ]; then69printf "Error: you do not have permission to install at: ${SHAREDIR}\nMaybe you need to be root?\n"70exit 171fi72if [ -d "${BINDIR}" -a ! -w "${BINDIR}" ]; then73printf "Error: you do not have permission to install at: ${BINDIR}\nMaybe you need to be root?\n"74exit 175fi76if [ -d "${LIBDIR}" -a ! -w "${LIBDIR}" ]; then77printf "Error: you do not have permission to install at: ${LIBDIR}\nMaybe you need to be root?\n"78exit 179fi80if [ -d "${PLUGINDIR}" -a ! -w "${PLUGINDIR}" ]; then81printf "Error: you do not have permission to install at: ${PLUGINDIR}\nMaybe you need to be root?\n"82exit 183fi84if [ -d "${MANDIR}" -a ! -w "${MANDIR}" ]; then85printf "Error: you do not have permission to install at: ${MANDIR}\nMaybe you need to be root?\n"86exit 187fi8889printf "Installing Mupen64Plus Binary Bundle to ${PREFIX}\n"90# Mupen64Plus-Core91$INSTALL -d -v "${LIBDIR}"92$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" libmupen64plus.so.2.* "${LIBDIR}"93/sbin/ldconfig94$INSTALL -d -v "${SHAREDIR}"95$INSTALL -m 0644 font.ttf "${SHAREDIR}"96$INSTALL -m 0644 mupen64plus.cht "${SHAREDIR}"97$INSTALL -m 0644 mupen64plus.ini "${SHAREDIR}"98$INSTALL -d -v "${SHAREDIR}/doc"99$INSTALL -m 0644 doc/* "${SHAREDIR}/doc"100# Mupen64Plus-ROM101$INSTALL -m 0644 m64p_test_rom.v64 "${SHAREDIR}"102# Mupen64Plus-UI-Console103$INSTALL -d -v "${BINDIR}"104$INSTALL $GINSTALLFLAG -m 0755 mupen64plus "${BINDIR}"105$INSTALL -d -v "${MANDIR}/man6"106$INSTALL -m 0644 man6/mupen64plus.6 "${MANDIR}/man6"107# Plugins108$INSTALL -d -v "${PLUGINDIR}"109$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-audio-sdl.so "${PLUGINDIR}"110$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-input-sdl.so "${PLUGINDIR}"111$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-rsp-hle.so "${PLUGINDIR}"112$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-video-rice.so "${PLUGINDIR}"113$INSTALL -m 0644 "${INSTALL_STRIP_FLAG}" mupen64plus-video-glide64mk2.so "${PLUGINDIR}"114$INSTALL -m 0644 RiceVideoLinux.ini "${SHAREDIR}"115$INSTALL -m 0644 InputAutoCfg.ini "${SHAREDIR}"116$INSTALL -m 0644 Glide64mk2.ini "${SHAREDIR}"117118printf "Installation successful.\n"119120121122