#!/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`
echo `pwd`
+# Clean tmp directory.
rm -rf ./tmp
# Create directory structure for GBS Build
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/.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 ./
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 $1' --define 'SECURED $2' --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 "Core build is successful"
exit 1
fi
+# Build Enrollee Sample App
cd service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
echo `pwd`
# Initialize Git repository
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"