X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gbsbuild.sh;h=4872ca48ad8b4b00775d17c040a1929f5976862e;hb=refs%2Ftags%2Fsubmit%2Ftizen%2F20190819.064537;hp=633a2866dab399bbaa79756695f14e27ce5e5946;hpb=8f51e668ae78cb8ea4e57576160ab99ddcd40a81;p=platform%2Fupstream%2Fiotivity.git diff --git a/gbsbuild.sh b/gbsbuild.sh index 633a286..4872ca4 100755 --- a/gbsbuild.sh +++ b/gbsbuild.sh @@ -1,6 +1,6 @@ -#!/bin/sh +#!/bin/bash -e -spec=`ls tools/tizen/*.spec` +spec=`ls tools/tizen/iotivity.spec` version=`rpm --query --queryformat '%{version}\n' --specfile $spec` name=`echo $name|cut -d" " -f 1` @@ -32,14 +32,14 @@ rm -rf $sourcedir/tmp/extlibs/tinycbor/tinycbor/.git cp -R ./extlibs/cjson $sourcedir/tmp/extlibs cp -R ./extlibs/mbedtls $sourcedir/tmp/extlibs cp -R ./extlibs/gtest $sourcedir/tmp/extlibs -cp -R ./extlibs/tinydtls $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/iotivity.spec ./tmp/packaging cp ./tools/tizen/*.manifest ./tmp/packaging cp ./SConstruct ./tmp cp ./LICENSE.md ./tmp @@ -54,26 +54,38 @@ cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp cd $sourcedir/tmp -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 +secured=1 +gbscommand="gbs build -A armv7l " + +for ARGUMENT_VALUE in $* +do + echo $ARGUMENT_VALUE + if [[ "$ARGUMENT_VALUE" = *"="* ]]; then + optionname=$(echo $ARGUMENT_VALUE | cut -f1 -d=) + optionvalue=$(echo $ARGUMENT_VALUE | cut -f2 -d=) + echo -- "# $optionname $optionvalue" + gbscommand=${gbscommand}" --define '$optionname $optionvalue'" + + if [ "SECURED" = "$optionname" ]; then + secured=$optionvalue + fi + else + echo "'$ARGUMENT_VALUE' does not contain '='"; + fi +done + +gbscommand="${gbscommand} -B ~/GBS-ROOT-OIC --include-all --repository ./" + +if [ $secured -eq 1 ];then + echo `pwd` + # Prepare mbedTLS dependency + $SHELL ./extlibs/mbedtls/prep.sh fi -rm -rf ./extlibs/tinycbor/tinycbor/.git* +# Prepare TinyCBOR dependency +$SHELL ./extlibs/tinycbor/prep.sh -# Initialize Git repository +# Initialize Git repositoryㅣ if [ ! -d .git ]; then git init ./ git config user.email "you@example.com" @@ -82,17 +94,7 @@ if [ ! -d .git ]; then git commit -m "Initial commit" fi -withtcp=0 -withcloud=0 -if [ "WITH_TCP" = "$1" ] || [ "WITH_TCP" = "$2" ];then - withtcp=1 -fi -if [ "WITH_CLOUD" = "$1" ] || [ "WITH_CLOUD" = "$2" ];then - withcloud=1 -fi - echo "Calling core gbs build command" -gbscommand="gbs build -A armv7l --define 'WITH_TCP $withtcp' --define 'WITH_CLOUD $withcloud' -B ~/GBS-ROOT-OIC --include-all --repository ./" echo $gbscommand if eval $gbscommand; then echo "Build is successful"