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`
10 gbsarch=${gbsarch:=armv7l}
13 export TARGET_TRANSPORT=$1
19 export BUILD_SAMPLE=$3
40 export DISABLE_BLE_SERVER=$10
42 echo $TARGET_TRANSPORT
57 cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
58 cp -Rf ./extlibs/mbedtls $sourcedir/tmp/extlibs
59 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
60 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
61 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
62 cp -R ./extlibs/libcoap $sourcedir/tmp/extlibs
63 cp -LR ./extlibs/sqlite3 $sourcedir/tmp/extlibs
64 cp -R ./resource/csdk/stack/samples/tizen/build/packaging/*.spec $sourcedir/tmp/packaging
65 cp -R ./resource $sourcedir/tmp/
66 cp -R ./build_common/external_libs.scons $sourcedir/tmp/
67 mkdir -p $sourcedir/tmp/build_common/
68 cp -a ./build_common/*.scons $sourcedir/tmp/build_common/
70 # copy dependency RPMs and conf files for tizen build
71 cp ./tools/tizen/*.rpm $sourcedir/tmp
72 cp ./tools/tizen/*.rpm $sourcedir/tmp/resource/csdk/stack/samples/tizen/SimpleClientServer
73 cp ./tools/tizen/.gbs.conf ./tmp
74 cp ./tools/tizen/.gbs.conf ./tmp/resource/csdk/stack/samples/tizen/SimpleClientServer
77 cd ./resource/csdk/stack/samples/tizen/build/
79 cp -R ./* $sourcedir/tmp/
80 rm -f $sourcedir/tmp/SConscript
81 cp SConstruct $sourcedir/tmp/
82 cp scons/SConscript $sourcedir/tmp/scons/
84 mkdir -p $sourcedir/tmp/iotivityconfig
85 cd $sourcedir/build_common/
86 cp -R ./iotivityconfig/* $sourcedir/tmp/iotivityconfig/
87 cp -R ./SConscript $sourcedir/tmp/
89 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp/
94 # Prepare mbedTLS dependency
95 $SHELL ./extlibs/mbedtls/prep.sh
97 # Prepare TinyCBOR dependency
98 $SHELL ./extlibs/tinycbor/prep.sh
101 # Initialize Git repository
102 if [ ! -d .git ]; then
104 git config user.email "you@example.com"
105 git config user.name "Your Name"
107 git commit -m "Initial commit"
110 gbsprofile=${gbsprofile:=profile.tizen}
111 gbscommand_prefix="gbs build -A ${gbsarch} -P ${gbsprofile} "
112 nproc=$(expr 1 + $(expr `nproc --ignore=1` / 2 ) )
113 gbscommand_prefix=${gbscommand_prefix}" --define '_smp_mflags -j${nproc}'"
115 echo "Calling core gbs build command"
116 gbscommand=${gbscommand_prefix}" -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' --define 'DISABLE_BLE_SERVER $10'"
118 if eval $gbscommand; then
119 echo "Core build is successful"
121 echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
123 rm -rf $sourcedir/tmp
127 if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
128 cd resource/csdk/stack/samples/tizen/SimpleClientServer
130 # Initialize Git repository
131 if [ ! -d .git ]; then
133 git config user.email "you@example.com"
134 git config user.name "Your Name"
136 git commit -m "Initial commit"
138 echo "Calling sample gbs build command"
139 gbscommand=${gbscommand_prefix}" -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'"
141 if eval $gbscommand; then
142 echo "Sample build is successful"
144 echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
148 echo "Sample build is not enabled"
152 rm -rf $sourcedir/tmp