This repository has been archived by the owner on Feb 1, 2018. It is now read-only.
forked from mordak/playbook-dev-tools
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·72 lines (61 loc) · 2.63 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
69
70
71
#!/usr/bin/env bash
# This code Copyright 2012 Todd Mortimer <[email protected]>
#
# You may do whatever you like with this code, provided the above
# copyright notice and this paragraph are preserved.
set -e
source lib.sh
TASK=bootstrap
init "$@"
if [ "$TASK" == "bootstrap" ]
then
bootstrap
TASK=bundle
fi
if [ "$TASK" == "bundle" ]
then
cd "$ROOTDIR"
echo "Setting up target env"
echo "export NATIVE_TOOLS=\"$PREFIX\"" > env.sh
echo "export NATIVE_TOOLS_URL=\"$URL\"" >> env.sh
echo "QNX_TARGET=\$NATIVE_TOOLS/$TARGETNAME/qnx6" >> env.sh
cat profile >> env.sh
echo "umask 002" > sample_profile
echo "CLITOOLS=\"$PREFIX/env.sh\"" >> sample_profile
echo 'if [ -e $CLITOOLS ];then' >> sample_profile
echo ' . $CLITOOLS' >> sample_profile
echo 'fi' >> sample_profile
ZIPFILE="$DESTDIR.zip"
zip -u "$ZIPFILE" env.sh qconf-override.mk pbpkgadd sample_profile || true
zip -u "$ZIPFILE" packages/*.zip || true
TASK=deploy
fi
if [ "$TASK" == "deploy" ]
then
cd "$ROOTDIR"
echo "#!/bin/sh" > pbinstall.sh
echo "mkdir -p \"$PREFIX\"" >> pbinstall.sh
echo "cd \"$PREFIX\"" >> pbinstall.sh
echo "export NATIVE_TOOLS=\"$PREFIX\"" >> pbinstall.sh
echo "export NATIVE_TOOLS_URL=\"$URL\"" >> pbinstall.sh
cat pbinstallhead.sh >> pbinstall.sh
echo "./bin/pwget \"$URL/pbhome.zip\"" >> pbinstall.sh
echo "unzip pbhome.zip" >> pbinstall.sh
echo 'cp pbpkgadd bin/' >> pbinstall.sh
echo 'for pkg in packages/*.zip' >> pbinstall.sh
echo 'do' >> pbinstall.sh
echo './bin/pbpkgadd $pkg' >> pbinstall.sh
echo 'done' >> pbinstall.sh
echo '. ./env.sh' >> pbinstall.sh
echo 'cd' >> pbinstall.sh
echo 'if [ ! -e .profile ]; then' >> pbinstall.sh
echo ' cp "$NATIVE_TOOLS/sample_profile" .profile' >> pbinstall.sh
echo 'else' >> pbinstall.sh
echo ' echo "You already have a .profile."' >> pbinstall.sh
echo ' echo "You can set up your paths by sourcing $NATIVE_TOOLS/env.sh"' >> pbinstall.sh
echo ' echo "See $NATIVE_TOOLS/sample_profile for a snippet that does this"' >> pbinstall.sh
echo 'fi' >> pbinstall.sh
echo "---- On your BB10 device, direct your browser to: $URL/pbinstall.sh"
echo "---- Save the file, then in the shell, execute: sh /accounts/1000/shared/downloads/pbinstall.sh"
./localserver.rb
fi