install.sh
上传用户:hongyu5696
上传日期:2018-01-22
资源大小:391k
文件大小:2k
- #!/bin/bash
- SHAREDTARGET=downloadplug-in
- INSTALL='/usr/bin/install -c'
- prefix=/usr/local
- exec_prefix=${prefix}
- sysconfdir=${prefix}/etc
- libdir=${exec_prefix}/lib
- datadir=${prefix}/share
- LOCALEDIR=${datadir}/locale
- DESTDIR=$1
- MOZHOME=/plugins
- if [ "$DESTDIR" ]; then
- echo "Installing to $DESTDIR"
- $INSTALL -b -D -m0644 downloadplug-in.conf ${DESTDIR}/etc/downloadplug-in.conf
- $INSTALL -b -D -m0644 downloadplug-in.types ${DESTDIR}/etc/downloadplug-in.types
- for mod in downloadplug-in
- do
- $INSTALL -D -m0755 ${mod}.so ${DESTDIR}${libdir}/mozilla/plugins/${mod}.so
- $INSTALL -D -m0755 Source/nsIScriptabledownloadPlugin.xpt ${DESTDIR}${libdir}/mozilla/plugins/${mod}.xpt
- done
- make install -C po LOCALEDIR="${LOCALEDIR}" INSTALL="$INSTALL" DESTDIR="$DESTDIR"
- else
- if [ `whoami` != 'root' ]; then
-
- echo "Installing for user `whoami`"
- for mod in downloadplug-in
- do
- $INSTALL -D -m0755 ${mod}.so ${HOME}/.mozilla/plugins/${mod}.so
- $INSTALL -D -m0755 Source/nsIScriptabledownloadPlugin.xpt ${HOME}/.mozilla/plugins/${mod}.xpt
- done
- $INSTALL -b -D -m0644 downloadplug-in.conf ${HOME}/.mozilla/downloadplug-in.conf
- $INSTALL -b -D -m0644 downloadplug-in.types ${HOME}/.mozilla/downloadplug-in.types
- else
- echo "Installing plugin system wide"
- # system install code
- if [ -z ${MOZHOME} ]; then
- MOZ=`which mozilla`
- MOZHOME=`grep MOZILLA_FIVE_HOME= ${MOZ} | awk -F " '{ print $2 }'`
- if [ -z ${MOZHOME} ]; then MOZHOME=`grep moz_libdir= ${MOZ} | awk -F " '{ print $2 }'`; fi
- if [ -z ${MOZHOME} ]; then MOZHOME=`grep moz_libdir= ${MOZ} | awk -F = '{ print $2 }'`; fi
- MOZPLUGINS=`grep MOZ_PLUGIN_PATH ${MOZ} | awk -F = '{ print $2 }' | awk -F : '{ if ( $1 != "") if ( index($1,"_PLUGIN_") == 0) print $1 }'`
- if [ ${MOZHOME} ]; then DEST=${MOZHOME}/plugins; fi
- if [ ${MOZPLUGINS} ]; then DEST=${MOZPLUGINS}; fi
- else
- DEST=${MOZHOME}
- fi
- if [ -z ${DEST} ]; then echo "Can't find MOZILLA HOME. Please install manually"; exit 1; fi
- echo "Installing into ${DEST}"
- if [ ! -d ${DEST} ]; then mkdir ${DEST}; fi
- for mod in downloadplug-in
- do
- $INSTALL -D -m0755 ${mod}.so ${DEST}/${mod}.so
- $INSTALL -D -m0755 Source/nsIScriptabledownloadPlugin.xpt ${DEST}/${mod}.xpt
- done
- $INSTALL -b -D -m0644 downloadplug-in.conf /etc/downloadplug-in.conf
- $INSTALL -b -D -m0644 downloadplug-in.types /etc/downloadplug-in.types
- make install -C po
- fi
- fi