[IOT-1438] Solve Build issue on Tizen secured build through gbsbuild script
authorYounghyunJoo <yh_.joo@samsung.com>
Tue, 11 Oct 2016 11:08:35 +0000 (20:08 +0900)
committerUze Choi <uzchoi@samsung.com>
Fri, 14 Oct 2016 07:09:29 +0000 (07:09 +0000)
- add secured check logic into gbsbuild.sh file
- using this logic, check mbedtls file & apply the patch

Change-Id: I6d458ea599562216444582b78724a1b61023d6de
Signed-off-by: YounghyunJoo <yh_.joo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13099
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: dongik Lee <dongik.lee@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 3f7b46b56356b3d8997fc56d5904a1e0e12d9c87)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13263

gbsbuild.sh

index 58c2cdf..e514e6a 100755 (executable)
@@ -55,21 +55,11 @@ cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
 
 cd $sourcedir/tmp
 
-rm -rf ./extlibs/tinycbor/tinycbor/.git*
-
-# Initialize Git repositoryㅣ
-if [ ! -d .git ]; then
-   git init ./
-   git config user.email "you@example.com"
-   git config user.name "Your Name"
-   git add ./
-   git commit -m "Initial commit"
-fi
-
 withtcp=0
 withcloud=0
 withproxy=0
 withmq=OFF
+secured=0
 for ARGUMENT_VALUE in $*
 do
    echo $ARGUMENT_VALUE
@@ -88,10 +78,44 @@ do
    if [ "WITH_MQ" = $ARGUMENT_VALUE ];then
        withmq=PUB,SUB,BROKER
    fi
+
+   if [ "SECURED" = $ARGUMENT_VALUE ];then
+       secured=1
+   fi
 done
 
+if [ $secured -eq 1 ];then
+  echo `pwd`
+  if [ -d ./extlibs/mbedtls/mbedtls ];then
+      cd ./extlibs/mbedtls/mbedtls
+      git reset --hard ad249f509fd62a3bbea7ccd1fef605dbd482a7bd ; git apply ../ocf.patch
+      cd -
+      rm -rf ./extlibs/mbedtls/mbedtls/.git*
+
+  else
+      echo ""
+      echo "*********************************** Error: ****************************************"
+      echo "* Please download mbedtls using the following command:                            *"
+      echo "*     $ git clone https://github.com/ARMmbed/mbedtls.git extlibs/mbedtls/mbedtls  *"
+      echo "***********************************************************************************"
+      echo ""
+      exit
+  fi
+fi
+
+rm -rf ./extlibs/tinycbor/tinycbor/.git*
+
+# Initialize Git repositoryㅣ
+if [ ! -d .git ]; then
+   git init ./
+   git config user.email "you@example.com"
+   git config user.name "Your Name"
+   git add ./
+   git commit -m "Initial commit"
+fi
+
 echo "Calling core gbs build command"
-gbscommand="gbs build -A armv7l --define 'WITH_TCP $withtcp' --define 'WITH_CLOUD $withcloud' --define 'WITH_PROXY $withproxy' --define 'WITH_MQ $withmq' -B ~/GBS-ROOT-OIC --include-all --repository ./"
+gbscommand="gbs build -A armv7l --define 'WITH_TCP $withtcp' --define 'WITH_CLOUD $withcloud' --define 'WITH_PROXY $withproxy' --define 'WITH_MQ $withmq' --define 'SECURED $secured' -B ~/GBS-ROOT-OIC --include-all --repository ./"
 echo $gbscommand
 if eval $gbscommand; then
     echo "Build is successful"