X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gbsbuild.sh;h=58c2cdf66a4c7531965d31beb6b43762d72ea5e6;hb=5479d22c2eab0b2055f2b05c8ad8fef576950b84;hp=749da0a985162b840d9f79fc8cf6ab4209da4dbe;hpb=632666ef557d61eee5ef438a2af51d760cace39f;p=platform%2Fupstream%2Fiotivity.git diff --git a/gbsbuild.sh b/gbsbuild.sh old mode 100644 new mode 100755 index 749da0a..58c2cdf --- a/gbsbuild.sh +++ b/gbsbuild.sh @@ -15,29 +15,49 @@ sourcedir=`pwd` echo `pwd` +# Clean tmp directory. +rm -rf ./tmp + +# Create directory structure for GBS Build mkdir ./tmp mkdir ./tmp/extlibs/ mkdir ./tmp/packaging cp -R ./build_common $sourcedir/tmp cp -R ./examples $sourcedir/tmp -cp -R ./extlibs/tinycbor $sourcedir/tmp/extlibs + +# 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/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/*.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` rm -rf ./extlibs/tinycbor/tinycbor/.git* -# Initialize Git repository +# Initialize Git repositoryㅣ if [ ! -d .git ]; then git init ./ git config user.email "you@example.com" @@ -46,14 +66,43 @@ if [ ! -d .git ]; then git commit -m "Initial commit" fi +withtcp=0 +withcloud=0 +withproxy=0 +withmq=OFF +for ARGUMENT_VALUE in $* +do + echo $ARGUMENT_VALUE + if [ "WITH_TCP" = $ARGUMENT_VALUE ];then + withtcp=1 + fi + + if [ "WITH_CLOUD" = $ARGUMENT_VALUE ];then + withcloud=1 + fi + + if [ "WITH_PROXY" = $ARGUMENT_VALUE ];then + withproxy=1 + fi + + if [ "WITH_MQ" = $ARGUMENT_VALUE ];then + withmq=PUB,SUB,BROKER + fi +done + echo "Calling core gbs build command" -gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./" +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 ./" echo $gbscommand if eval $gbscommand; then - echo "Build is successful" + echo "Build is successful" else - echo "Build failed!" + echo "Build failed!" + exit 1 fi + +rm -rf tmp cd $sourcedir rm -rf $sourcedir/tmp + +exit 0