3 cur_dir="./resource/csdk/connectivity/"
5 spec=`ls ./resource/csdk/connectivity/build/tizen/packaging/*.spec`
6 version=`rpm --query --queryformat '%{version}\n' --specfile $spec`
8 name=`echo $name|cut -d" " -f 1`
9 version=`echo $version|cut -d" " -f 1`
14 export TARGET_TRANSPORT=$1
20 export BUILD_SAMPLE=$3
31 echo $TARGET_TRANSPORT
45 mkdir -p $sourcedir/tmp/con/extlibs/
47 cp -R $cur_dir/* $sourcedir/tmp/con
48 cp -R $cur_dir/SConscript $sourcedir/tmp/con
49 cp -R $cur_dir/src/ip_adapter/SConscript $sourcedir/tmp/con/src/ip_adapter/
50 cp -R $cur_dir/src/bt_le_adapter/SConscript $sourcedir/tmp/con/src/bt_le_adapter/
51 cp -R $cur_dir/src/bt_edr_adapter/SConscript $sourcedir/tmp/con/src/bt_edr_adapter/
52 cp -R $cur_dir/common/SConscript $sourcedir/tmp/con/common/
53 cp -R $cur_dir/samples/tizen/ $sourcedir/tmp/con/sample/
54 mkdir -p $sourcedir/tmp/con/sample/external/inc
55 cp -R $cur_dir/external/inc/* $sourcedir/tmp/con/sample/external/inc/
57 cp -R ./extlibs/tinydtls/ $sourcedir/tmp/con/extlibs/
58 cp -R ./extlibs/mbedtls/ $sourcedir/tmp/con/mbedtls/
59 cp -R ./extlibs/timer/ $sourcedir/tmp/con/extlibs/
60 cp -R ./extlibs/libcoap/ $sourcedir/tmp/con/extlibs/
61 mkdir -p $sourcedir/tmp/con/c_common
62 cp -R ./resource/c_common/* $sourcedir/tmp/con/c_common/
63 cp -R ./resource/csdk/logger/include/* $sourcedir/tmp/con/common/inc/
64 mkdir ./tmp/con/logger/
65 cp -R ./resource/csdk/logger/* $sourcedir/tmp/con/logger
67 # copy dependency RPMs and conf files for tizen build
68 cp ./tools/tizen/*.rpm $sourcedir/tmp
69 cp ./tools/tizen/*.rpm $sourcedir/tmp/con/sample
70 cp ./tools/tizen/.gbs.conf ./tmp
71 cp ./tools/tizen/.gbs.conf ./tmp/con/sample
74 cd $cur_dir/build/tizen
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
94 # Initialize Git repository
95 if [ ! -d .git ]; then
97 git config user.email "you@example.com"
98 git config user.name "Your Name"
100 git commit -m "Initial commit"
103 echo "Calling core gbs build command"
104 gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-OIC --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --define 'WITH_TCP $6'"
106 if eval $gbscommand; then
107 echo "Core build is successful"
109 echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
111 rm -rf $sourcedir/tmp
115 if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
118 # Initialize Git repository
119 if [ ! -d .git ]; then
121 git config user.email "you@example.com"
122 git config user.name "Your Name"
124 git commit -m "Initial commit"
126 echo "Calling sample gbs build command"
127 gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-OIC --include-all --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'RELEASE $4' --define 'LOGGING $5' --repository ./"
129 if eval $gbscommand; then
130 echo "Sample build is successful"
132 echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
136 echo "Sample build is not enabled"
140 rm -rf $sourcedir/tmp