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/mbedtls/ $sourcedir/tmp/con/mbedtls/
58 cp -R ./extlibs/timer/ $sourcedir/tmp/con/extlibs/
59 cp -R ./extlibs/libcoap/ $sourcedir/tmp/con/extlibs/
60 mkdir -p $sourcedir/tmp/con/c_common
61 cp -R ./resource/c_common/* $sourcedir/tmp/con/c_common/
62 cp -R ./resource/csdk/logger/include/* $sourcedir/tmp/con/common/inc/
63 mkdir ./tmp/con/logger/
64 cp -R ./resource/csdk/logger/* $sourcedir/tmp/con/logger
66 # copy dependency RPMs and conf files for tizen build
67 cp ./tools/tizen/*.rpm $sourcedir/tmp
68 cp ./tools/tizen/*.rpm $sourcedir/tmp/con/sample
69 cp ./tools/tizen/.gbs.conf ./tmp
70 cp ./tools/tizen/.gbs.conf ./tmp/con/sample
73 cd $cur_dir/build/tizen
74 cp -R ./* $sourcedir/tmp/
75 rm -f $sourcedir/tmp/SConscript
76 cp SConstruct $sourcedir/tmp/
77 cp scons/SConscript $sourcedir/tmp/scons/
79 mkdir -p $sourcedir/tmp/iotivityconfig
80 cd $sourcedir/build_common/
81 cp -R ./iotivityconfig/* $sourcedir/tmp/iotivityconfig/
82 cp -R ./SConscript $sourcedir/tmp/
84 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp/
89 # Prepare mbedTLS dependency
90 $SHELL ./extlibs/mbedtls/prep.sh
93 # Initialize Git repository
94 if [ ! -d .git ]; then
96 git config user.email "you@example.com"
97 git config user.name "Your Name"
99 git commit -m "Initial commit"
102 echo "Calling core gbs build command"
103 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'"
105 if eval $gbscommand; then
106 echo "Core build is successful"
108 echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
110 rm -rf $sourcedir/tmp
114 if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
117 # Initialize Git repository
118 if [ ! -d .git ]; then
120 git config user.email "you@example.com"
121 git config user.name "Your Name"
123 git commit -m "Initial commit"
125 echo "Calling sample gbs build command"
126 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 ./"
128 if eval $gbscommand; then
129 echo "Sample build is successful"
131 echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
135 echo "Sample build is not enabled"
139 rm -rf $sourcedir/tmp