replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / enrollee / tizen-sdb / EnrolleeSample / build / tizen / gbsbuild.sh
old mode 100644 (file)
new mode 100755 (executable)
index b8eff08..b00216e
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 cur_dir="./service/easy-setup"
-
 spec=`ls ./service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/packaging/*.spec`
 version=`rpm --query --queryformat '%{version}\n' --specfile $spec`
 
@@ -17,6 +16,7 @@ sourcedir=`pwd`
 
 echo `pwd`
 
+# Clean tmp directory.
 rm -rf ./tmp
 
 # Create directory structure for GBS Build
@@ -24,37 +24,46 @@ mkdir ./tmp
 mkdir ./tmp/con/
 mkdir ./tmp/extlibs/
 mkdir ./tmp/packaging
+mkdir ./tmp/logger
 cp -R ./build_common $sourcedir/tmp
 cp -R ./examples $sourcedir/tmp
 
 # tinycbor is available as soft-link, so copying with 'dereference' option.
 cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
-rm -rf $sourcedir/tmp/extlibs/tinycbor/tinycbor/.git
 
 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
-cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
-cp -R ./extlibs/sqlite3 $sourcedir/tmp/extlibs
+cp -R ./extlibs/mbedtls $sourcedir/tmp/extlibs
+cp -R ./extlibs/gtest $sourcedir/tmp/extlibs
+cp -LR ./extlibs/sqlite3 $sourcedir/tmp/extlibs
 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
+cp -R ./extlibs/libcoap $sourcedir/tmp/extlibs
 cp -R ./resource $sourcedir/tmp
 cp -R ./service $sourcedir/tmp
 cp ./extra_options.scons $sourcedir/tmp
 cp ./tools/tizen/*.spec ./tmp/packaging
 cp ./tools/tizen/*.manifest ./tmp/packaging
 cp ./SConstruct ./tmp
+cp ./LICENSE.md ./tmp
 
 # copy dependency RPMs and conf files for tizen build
 cp ./tools/tizen/*.rpm ./tmp
 cp ./tools/tizen/.gbs.conf ./tmp
 cp ./tools/tizen/*.rpm $sourcedir/tmp/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
 cp ./tools/tizen/.gbs.conf ./tmp/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
+
 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
 
 cd $sourcedir/tmp
 
 echo `pwd`
+# Prepare mbedTLS dependency
+$SHELL ./extlibs/mbedtls/prep.sh
+
+# Prepare TinyCBOR dependency
+$SHELL ./extlibs/tinycbor/prep.sh
 
-whoami
+# Build IoTivity
 # Initialize Git repository
 if [ ! -d .git ]; then
    git init ./
@@ -64,8 +73,9 @@ if [ ! -d .git ]; then
    git commit -m "Initial commit"
 fi
 
+buildoption="--define 'TARGET_TRANSPORT '$1 --define 'SECURED '$2 --define 'ROUTING '$3 --define 'RELEASE '$4 --define 'LOGGING '$5 --define 'ES_TARGET_ENROLLEE '$6 --define 'WITH_TCP '$7 --define 'WITH_CLOUD '$8"
 echo "Calling core gbs build command"
-gbscommand="gbs build -A armv7l --include-all  --repository ./ --define 'TARGET_TRANSPORT IP' --define 'SECURED 0' --define 'RELEASE 0' --define 'LOGGING true'"
+gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-OIC $buildoption --include-all --repository ./"
 echo $gbscommand
 if eval $gbscommand; then
    echo "Core build is successful"
@@ -76,6 +86,7 @@ else
    exit 1
 fi
 
+# Build Enrollee Sample App
 cd service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
 echo `pwd`
 # Initialize Git repository
@@ -87,7 +98,7 @@ if [ ! -d .git ]; then
   git commit -m "Initial commit"
 fi
 echo "Calling sample gbs build command"
-gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./ --define 'TARGET_TRANSPORT $1' --define 'SECURED $2' --define 'ROUTING $4' --define 'RELEASE $5' --define 'LOGGING $6' --define 'ES_ROLE $7' --define 'ES_TARGET_ENROLLEE $8' --define 'ES_SOFTAP_MODE $9'"
+gbscommand="gbs build -A armv7l -B ~/GBS-ROOT-OIC $buildoption --include-all --repository ./"
 echo $gbscommand
 if eval $gbscommand; then
   echo "Sample build is successful"