Debian Codegraph @

Packaging/Linux/install.sh

raw
1 #!/bin/sh
2
3 #/***************************************************************************
4 #* *
5 #* OpenNI 2.0 *
6 #* Copyright (C) 2012 PrimeSense Ltd. *
7 #* *
8 #* This file is part of OpenNI2 installation. *
9 #* *
10 #* OpenNI is free software: you can redistribute it and/or modify *
11 #* it under the terms of the GNU Lesser General Public License as published*
12 #* by the Free Software Foundation, either version 3 of the License, or *
13 #* (at your option) any later version. *
14 #* *
15 #* OpenNI is distributed in the hope that it will be useful, *
16 #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 #* GNU Lesser General Public License for more details. *
19 #* *
20 #* You should have received a copy of the GNU Lesser General Public License*
21 #* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
22 #* *
23 #***************************************************************************/
24 #
25
26 # Check if user is root/running with sudo
27 if [ `whoami` != root ]; then
28 echo Please run this script with sudo
29 exit
30 fi
31
32 ORIG_PATH=`pwd`
33 cd `dirname $0`
34 SCRIPT_PATH=`pwd`
35 cd $ORIG_PATH
36
37 if [ "`uname -s`" != "Darwin" ]; then
38 # Install UDEV rules for USB device
39 cp ${SCRIPT_PATH}/primesense-usb.rules /etc/udev/rules.d/557-primesense-usb.rules
40 fi
41
42 OUT_FILE="$SCRIPT_PATH/OpenNIDevEnvironment"
43
44 echo "export OPENNI2_INCLUDE=$SCRIPT_PATH/Include" > $OUT_FILE
45 echo "export OPENNI2_REDIST=$SCRIPT_PATH/Redist" >> $OUT_FILE
46 chmod a+r $OUT_FILE