forked from ilin-in/OPiOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.sh
executable file
·86 lines (79 loc) · 2.73 KB
/
prepare.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
: ${CURL_SCRIPT_PATH:=./libs/op/libs/ortc-lib/libs/curl-build-scripts}
: ${BOOST_SCRIPT_PATH:=./libs/op/libs/ortc-lib/libs/boost}
: ${TEMPLATES_PATH:=./templates}
: ${DESTINATION_PATH:=./Samples/OpenPeerSampleApp/OpenPeerSampleApp}
: ${CUSTOMER_SPECIFIC_TEMPLATE:=Template_CustomerSpecific.plist}
: ${CUSTOMER_SPECIFIC:=CustomerSpecific.plist}
: ${CUSTOMER_SPECIFIC_RELEASE_TEMPLATE:=Template_CustomerSpecific_Release.plist}
: ${CUSTOMER_SPECIFIC_RELEASE:=CustomerSpecific_Release.plist}
#Runs curl build script
if [ -f "$CURL_SCRIPT_PATH/build_curl" ]; then
pushd $CURL_SCRIPT_PATH
echo Building curl ...
chmod a+x build_curl
./build_curl --sdk-version 8.0 --libcurl-version 7.38.0
status=$?
if [ $status != 0 ]; then
echo $status
echo "Curl build failed!"
exit 1
else
if [ ! -f "curl/curl" ]; then
ln -s ios-appstore/include curl/curl
ln -s ios-appstore/lib curl/lib
fi
echo "Curl build succeeded!"
fi
popd
else
echo ERROR. Curl build failed. No such a file or directory.
fi
#Runs boost build script
if [ -f "$BOOST_SCRIPT_PATH/boost.sh" ]; then
pushd $BOOST_SCRIPT_PATH
echo Building boost ...
chmod a+x boost.sh
sh boost.sh
status=$?
if [ $status != 0 ]; then
echo $status
echo "Boost build failed!"
exit 1
else
echo "Boost build succeeded!"
fi
popd
else
echo ERROR. Boost build failed. No such a file or directory.
fi
#Checks if common settings file already exists in the destination folder. If doesn't exist, copies the template cource in the destiantion folder, renames it and update name of the imported header.
if [ ! -f "$DESTINATION_PATH/$CUSTOMER_SPECIFIC" ]; then
if [ -d $TEMPLATES_PATH ]; then
if [ -f "$TEMPLATES_PATH/$CUSTOMER_SPECIFIC_TEMPLATE" ]; then
cp -r "$TEMPLATES_PATH/$CUSTOMER_SPECIFIC_TEMPLATE" "$DESTINATION_PATH/$CUSTOMER_SPECIFIC"
echo Created $CUSTOMER_SPECIFIC
else
echo "Error. Template $CUSTOMER_SPECIFIC_TEMPLATE doesnt exist!"
fi
else
echo Error. Invalid template directory!
fi
else
echo Using existing $CUSTOMER_SPECIFIC...
fi
#Checks if releas settings file already exists in the destination folder. If doesn't exist, copies the template cource in the destiantion folder, renames it and update name of the imported header.
if [ ! -f "$DESTINATION_PATH/$CUSTOMER_SPECIFIC_RELEASE" ]; then
if [ -d $TEMPLATES_PATH ]; then
if [ -f "$TEMPLATES_PATH/$CUSTOMER_SPECIFIC_RELEASE_TEMPLATE" ]; then
cp -r "$TEMPLATES_PATH/$CUSTOMER_SPECIFIC_RELEASE_TEMPLATE" "$DESTINATION_PATH/$CUSTOMER_SPECIFIC_RELEASE"
echo Created $CUSTOMER_SPECIFIC_RELEASE
else
echo "Error. Template $CUSTOMER_SPECIFIC_RELEASE_TEMPLATE doesnt exist!"
fi
else
echo Error. Invalid template directory!
fi
else
echo Using existing $CUSTOMER_SPECIFIC_RELEASE...
fi