| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # Installs O3D plugin for Linux. | 2 # Installs O3D plugin for Linux. |
| 3 # | 3 # |
| 4 # Copyright 2009, Google Inc. | 4 # Copyright 2009, Google Inc. |
| 5 # All rights reserved. | 5 # All rights reserved. |
| 6 # | 6 # |
| 7 # Redistribution and use in source and binary forms, with or without | 7 # Redistribution and use in source and binary forms, with or without |
| 8 # modification, are permitted provided that the following conditions are | 8 # modification, are permitted provided that the following conditions are |
| 9 # met: | 9 # met: |
| 10 # | 10 # |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 if [ "$USER" != "0" ]; then | 55 if [ "$USER" != "0" ]; then |
| 56 echo "You must be root (or sudo) to install this package." | 56 echo "You must be root (or sudo) to install this package." |
| 57 exit 1 | 57 exit 1 |
| 58 fi | 58 fi |
| 59 } | 59 } |
| 60 | 60 |
| 61 | 61 |
| 62 SetupO3d() { | 62 SetupO3d() { |
| 63 # Create npapi plugin directories, copy and symlink libs. | 63 # Create npapi plugin directories, copy and symlink libs. |
| 64 O3D_DIR="/opt/google/o3d" | 64 O3D_DIR="/opt/google/o3d" |
| 65 LIB_DIR=$O3D_DIR/lib |
| 65 | 66 |
| 66 PLUGIN_DIRS="/usr/lib/firefox/plugins | 67 PLUGIN_DIRS="/usr/lib/firefox/plugins |
| 67 /usr/lib/iceape/plugins | 68 /usr/lib/iceape/plugins |
| 68 /usr/lib/iceweasel/plugins | 69 /usr/lib/iceweasel/plugins |
| 69 /usr/lib/midbrowser/plugins | 70 /usr/lib/midbrowser/plugins |
| 70 /usr/lib/mozilla/plugins | 71 /usr/lib/mozilla/plugins |
| 71 /usr/lib/xulrunner/plugins | 72 /usr/lib/xulrunner/plugins |
| 72 /usr/lib/xulrunner-addons/plugins" | 73 /usr/lib/xulrunner-addons/plugins" |
| 73 | 74 |
| 74 LIBS="libCg.so | 75 LIBS="libCg.so |
| 75 libCgGL.so | 76 libCgGL.so |
| 76 libGLEW.so.1.5" | 77 libGLEW.so.1.5" |
| 77 | 78 |
| 78 LIB3D="libnpo3dautoplugin.so" | 79 LIB3D="libnpo3dautoplugin.so" |
| 79 | 80 |
| 80 echo -n "Creating plugin directories..." | 81 echo -n "Creating plugin directories..." |
| 81 mkdir -p $PLUGIN_DIRS $O3D_DIR | 82 mkdir -p $PLUGIN_DIRS $O3D_DIR $LIB_DIR |
| 82 echo "ok" | 83 echo "ok" |
| 83 | 84 |
| 84 echo -n "Installing files to $O3D_DIR..." | 85 echo -n "Installing files to $O3D_DIR..." |
| 85 install --mode=644 ${LIB3D} $O3D_DIR | 86 install --mode=644 ${LIB3D} $O3D_DIR |
| 86 install --mode=644 ${LIBS} $O3D_DIR | 87 install --mode=644 ${LIBS} $LIB_DIR |
| 87 echo "ok" | 88 echo "ok" |
| 88 | 89 |
| 89 echo -n "Creating symlinks to plugin..." | 90 echo -n "Creating symlinks to plugin..." |
| 90 for dir in $PLUGIN_DIRS; do | 91 for dir in $PLUGIN_DIRS; do |
| 91 ln -sf ${O3D_DIR}/${LIB3D} ${dir}/ | 92 ln -sf ${O3D_DIR}/${LIB3D} ${dir}/ |
| 92 done | 93 done |
| 93 echo "ok" | 94 echo "ok" |
| 94 | 95 |
| 95 # If 32bit arch, use /usr/lib. If 64bit, use /usr/lib32 | |
| 96 if [ "$ARCH" = "32bit" ]; then | |
| 97 LIBDIR="/usr/lib" | |
| 98 elif [ "$ARCH" = "64bit" ]; then | |
| 99 LIBDIR="/usr/lib32" | |
| 100 NP_WRAP="yes" | |
| 101 else | |
| 102 echo "$ARCH not recognized" | |
| 103 exit 1 | |
| 104 fi | |
| 105 | |
| 106 echo -n "Creating symlinks to libs..." | |
| 107 mkdir -p $LIBDIR | |
| 108 for lib in $LIBS; do | |
| 109 if [ -e "${LIBDIR}/${lib}" ]; then | |
| 110 echo "$lib already exists, not replacing." | |
| 111 else | |
| 112 ln -s ${O3D_DIR}/${lib} ${LIBDIR}/ | |
| 113 fi | |
| 114 done | |
| 115 echo "ok" | |
| 116 | |
| 117 # 64bit only: Check for nspluginwrapper, wrap libnpo3dautoplugin.so if found. | 96 # 64bit only: Check for nspluginwrapper, wrap libnpo3dautoplugin.so if found. |
| 118 if [ "$NP_WRAP" = "yes" ]; then | 97 if [ "$ARCH" = "64bit" ]; then |
| 119 echo -n "Attempting to wrap $LIB3D via nspluginwrapper..." | 98 echo -n "Attempting to wrap $LIB3D via nspluginwrapper..." |
| 120 NSPW=$(which nspluginwrapper) | 99 NSPW=$(which nspluginwrapper) |
| 121 if [ -z "$NSPW" ]; then | 100 if [ -z "$NSPW" ]; then |
| 122 echo " | 101 echo " |
| 123 nspluginwrapper not found. Without nspluginwrapper you will be | 102 nspluginwrapper not found. Without nspluginwrapper you will be |
| 124 unable to use O3D in 64-bit browsers. Continue installation? (y/N)" | 103 unable to use O3D in 64-bit browsers. Continue installation? (y/N)" |
| 125 read answer | 104 read answer |
| 126 if [ "$answer" = "y" ]; then | 105 if [ "$answer" = "y" ]; then |
| 127 echo "Ok, Installation complete." | 106 echo "Ok, Installation complete." |
| 128 exit 0 | 107 exit 0 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 147 echo "Installation failed" | 126 echo "Installation failed" |
| 148 exit 1 | 127 exit 1 |
| 149 else | 128 else |
| 150 echo "Installation completed successfully!" | 129 echo "Installation completed successfully!" |
| 151 fi | 130 fi |
| 152 } | 131 } |
| 153 | 132 |
| 154 CheckArch | 133 CheckArch |
| 155 SetRootUser | 134 SetRootUser |
| 156 SetupO3d | 135 SetupO3d |
| OLD | NEW |