/
build.sh
executable file
·68 lines (61 loc) · 1.9 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/sh
# GPII Linux Build Script
#
# Copyright 2012 OCAD University
#
# Licensed under the New BSD license. You may not use this file except in
# compliance with this License.
#
# You may obtain a copy of the License at
# https://github.com/gpii/universal/LICENSE.txt
node_modules="../node_modules"
universal="../node_modules/universal"
repoURL="git://github.com/GPII/universal.git"
tag="tags/v0.1"
usbListenerDir="./usbDriveListener"
gpiiInstallDir="/usr/local/gpii"
gpiiStateDir="/var/lib/gpii"
startDir=`pwd`
# Clone the necessary GPII framework dependencies from Git.
# TODO: Deal with cut and pastage for directory creation logic.
if [ -d $node_modules ]; then
echo "$node_modules already exists"
else
echo "$node_modules does not exist"
echo "creating $node_modules"
mkdir -p "$node_modules"
fi
if [ -d $universal ]; then
echo "$universal already exists"
else
echo "$universal does not exist"
echo "cloning universal"
git clone "$repoURL" "$universal"
cd $universal
git checkout $tag
cd $startDir
fi
# Compile the GSettings C++ Bridge
cd node_modules/gsettingsBridge/nodegsettings
node-gyp configure build
cd ../../..
# Create standard directory structure for GPII.
# Note: everything below here must be run as root, since we're installing ourselves centrally.
if [ -d $gpiiInstallDir ]; then
echo "$gpiiInstallDir already exists"
else
echo "$gpiiInstallDir does not exist"
echo "creating $gpiiInstallDir"
sudo mkdir -p "$gpiiInstallDir"
fi
if [ -d $gpiiStateDir ]; then
echo "$gpiiStateDir already exists"
else
echo "$gpiiStateDir does not exist"
echo "creating $gpiiStateDir"
sudo mkdir -p "$gpiiStateDir"
fi
# Install the USB Drive User Listener
# TODO: We should install the entire GPII in /usr/local/gpii, not just the USB Listener
sudo cp -r "$usbListenerDir/bin" "$gpiiInstallDir/bin"
sudo cp "$usbListenerDir/80-gpii.rules" /etc/udev/rules.d/