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 cp -R $cur_dir/* $sourcedir/tmp/con
46 cp -R $cur_dir/SConscript $sourcedir/tmp/con
47 cp -R $cur_dir/src/ip_adapter/SConscript $sourcedir/tmp/con/src/ip_adapter/
48 cp -R $cur_dir/src/bt_le_adapter/SConscript $sourcedir/tmp/con/src/bt_le_adapter/
49 cp -R $cur_dir/src/bt_edr_adapter/SConscript $sourcedir/tmp/con/src/bt_edr_adapter/
50 cp -R $cur_dir/common/SConscript $sourcedir/tmp/con/common/
51 cp -R $cur_dir/lib/libcoap-4.1.1/SConscript $sourcedir/tmp/con/lib/libcoap-4.1.1/
52 cp -R $cur_dir/samples/tizen/ $sourcedir/tmp/con/sample/
53 mkdir -p $sourcedir/tmp/con/sample/external/inc
54 cp -R $cur_dir/external/inc/* $sourcedir/tmp/con/sample/external/inc/
55 mkdir -p $sourcedir/tmp/con/extlibs/
56 cp -R ./extlibs/tinydtls/ $sourcedir/tmp/con/extlibs/
57 cp -R ./extlibs/timer/ $sourcedir/tmp/con/extlibs/
58 mkdir -p $sourcedir/tmp/con/c_common
59 cp -R ./resource/c_common/* $sourcedir/tmp/con/c_common/
60 cp -R ./resource/csdk/logger/include/* $sourcedir/tmp/con/common/inc/
61 mkdir ./tmp/con/logger/
62 cp -R ./resource/csdk/logger/* $sourcedir/tmp/con/logger
64 # copy dependency RPMs and conf files for tizen build
65 cp ./tools/tizen/*.rpm $sourcedir/tmp
66 cp ./tools/tizen/*.rpm $sourcedir/tmp/con/sample
67 cp ./tools/tizen/.gbs.conf ./tmp
68 cp ./tools/tizen/.gbs.conf ./tmp/con/sample
71 cd $cur_dir/build/tizen
72 cp -R ./* $sourcedir/tmp/
73 rm -f $sourcedir/tmp/SConscript
74 cp SConstruct $sourcedir/tmp/
75 cp scons/SConscript $sourcedir/tmp/scons/
77 mkdir -p $sourcedir/tmp/iotivityconfig
78 cd $sourcedir/build_common/
79 cp -R ./iotivityconfig/* $sourcedir/tmp/iotivityconfig/
80 cp -R ./SConscript $sourcedir/tmp/
82 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp/
89 # Initialize Git repository
90 if [ ! -d .git ]; then
92 git config user.email "you@example.com"
93 git config user.name "Your Name"
95 git commit -m "Initial commit"
98 echo "Calling core gbs build command"
99 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'"
101 if eval $gbscommand; then
102 echo "Core build is successful"
104 echo "Core build failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
106 rm -rf $sourcedir/tmp
110 if echo $BUILD_SAMPLE|grep -qi '^ON$'; then
113 # Initialize Git repository
114 if [ ! -d .git ]; then
116 git config user.email "you@example.com"
117 git config user.name "Your Name"
119 git commit -m "Initial commit"
121 echo "Calling sample gbs build command"
122 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 ./"
124 if eval $gbscommand; then
125 echo "Sample build is successful"
127 echo "Sample build is failed. Try 'find . -type f -exec dos2unix {} \;' in the 'connectivity/' folder"
131 echo "Sample build is not enabled"
135 rm -rf $sourcedir/tmp