3 spec=`ls ./resource/csdk/stack/samples/tizen/build/packaging/*.spec`
4 version=`rpm --query --queryformat '%{version}\n' --specfile $spec`
6 name=`echo $name|cut -d" " -f 1`
7 version=`echo $version|cut -d" " -f 1`
12 export TARGET_TRANSPORT=$1
18 export BUILD_SAMPLE=$3
38 echo $TARGET_TRANSPORT
53 cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
54 cp -Rf ./extlibs/mbedtls $sourcedir/tmp/extlibs
55 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
56 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
57 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
58 cp -R ./extlibs/libcoap $sourcedir/tmp/extlibs
59 cp -LR ./extlibs/sqlite3 $sourcedir/tmp/extlibs
60 cp -R ./resource/csdk/stack/samples/tizen/build/packaging/*.spec $sourcedir/tmp/packaging
61 cp -R ./resource $sourcedir/tmp/
62 cp -R ./build_common/external_libs.scons $sourcedir/tmp/
63 mkdir -p $sourcedir/tmp/build_common/
64 cp -a ./build_common/*.scons $sourcedir/tmp/build_common/
66 # copy dependency RPMs and conf files for tizen build
67 cp ./tools/tizen/*.rpm $sourcedir/tmp
68 cp ./tools/tizen/*.rpm $sourcedir/tmp/resource/csdk/stack/samples/tizen/SimpleClientServer
69 cp ./tools/tizen/.gbs.conf ./tmp
70 cp ./tools/tizen/.gbs.conf ./tmp/resource/csdk/stack/samples/tizen/SimpleClientServer
73 cd ./resource/csdk/stack/samples/tizen/build/
75 cp -R ./* $sourcedir/tmp/
76 rm -f $sourcedir/tmp/SConscript
77 cp SConstruct $sourcedir/tmp/
78 cp scons/SConscript $sourcedir/tmp/scons/
80 mkdir -p $sourcedir/tmp/iotivityconfig
81 cd $sourcedir/build_common/
82 cp -R ./iotivityconfig/* $sourcedir/tmp/iotivityconfig/
83 cp -R ./SConscript $sourcedir/tmp/
85 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp/
90 # Prepare mbedTLS dependency
91 $SHELL ./extlibs/mbedtls/prep.sh
93 # Prepare TinyCBOR dependency
94 $SHELL ./extlibs/tinycbor/prep.sh
97 # Initialize Git repository
98 if [ ! -d .git ]; then
100 git config user.email "you@example.com"
101 git config user.name "Your Name"
103 git commit -m "Initial commit"
106 echo "Calling core gbs build command"
107 gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --define 'WITH_TCP $7' --define 'WITH_PROXY $8' --define 'WITH_MQ $9'"
109 if eval $gbscommand; then
110 echo "Core build is successful"
112 echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
114 rm -rf $sourcedir/tmp
118 if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
119 cd resource/csdk/stack/samples/tizen/SimpleClientServer
121 # Initialize Git repository
122 if [ ! -d .git ]; then
124 git config user.email "you@example.com"
125 git config user.name "Your Name"
127 git commit -m "Initial commit"
129 echo "Calling sample gbs build command"
130 gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-RI-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'ROUTING $6' --define 'WITH_TCP $7' --define 'WITH_PROXY $8' --define 'WITH_MQ $9'"
132 if eval $gbscommand; then
133 echo "Sample build is successful"
135 echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
139 echo "Sample build is not enabled"
143 rm -rf $sourcedir/tmp