3 spec=`ls tools/tizen/*.spec`
4 version=`rpm --query --queryformat '%{version}\n' --specfile $spec`
6 name=`echo $name|cut -d" " -f 1`
7 version=`echo $version|cut -d" " -f 1`
18 # Clean tmp directory.
21 # Create directory structure for GBS Build
25 cp -R ./build_common $sourcedir/tmp
26 cp -R ./examples $sourcedir/tmp
28 # tinycbor is available as soft-link, so copying with 'dereference' option.
29 cp -LR ./extlibs/tinycbor $sourcedir/tmp/extlibs
31 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
32 cp -R ./extlibs/mbedtls $sourcedir/tmp/extlibs
33 cp -R ./extlibs/gtest $sourcedir/tmp/extlibs
34 cp -LR ./extlibs/sqlite3 $sourcedir/tmp/extlibs
35 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
36 cp -R ./extlibs/libcoap $sourcedir/tmp/extlibs
37 cp -R ./resource $sourcedir/tmp
38 cp -R ./service $sourcedir/tmp
39 cp ./extra_options.scons $sourcedir/tmp
40 cp ./tools/tizen/*.spec ./tmp/packaging
41 cp ./tools/tizen/*.manifest ./tmp/packaging
45 # copy dependency RPMs and conf files for tizen build
46 cp ./tools/tizen/*.rpm ./tmp
47 cp ./tools/tizen/.gbs.conf ./tmp
48 cp ./tools/tizen/*.rpm $sourcedir/tmp/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
49 cp ./tools/tizen/.gbs.conf ./tmp/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
51 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
56 gbsarch=${gbsarch:=armv7l}
57 gbsprofile=${gbsprofile:=profile.tizen}
58 gbscommand="gbs build -A ${gbsarch} -P ${gbsprofile}"
59 nproc=$(expr 1 + $(expr `nproc --ignore=1` / 2 ) )
60 gbscommand=$gbscommand" --define '_smp_mflags -j$nproc'"
62 for ARGUMENT_VALUE in $*
65 if [[ "$ARGUMENT_VALUE" = *"="* ]]; then
66 optionname=$(echo $ARGUMENT_VALUE | cut -f1 -d=)
67 optionvalue=$(echo $ARGUMENT_VALUE | cut -f2 -d=)
68 echo -- "# $optionname $optionvalue"
69 gbscommand=${gbscommand}" --define '$optionname $optionvalue'"
71 if [ "SECURED" = "$optionname" ]; then
75 echo "'$ARGUMENT_VALUE' does not contain '='";
79 gbscommand="${gbscommand} -B ~/GBS-ROOT-OIC --include-all --repository ./"
82 # Prepare mbedTLS dependency (also for unsecured as used by connectivity)
83 $SHELL ./extlibs/mbedtls/prep.sh
85 # Prepare TinyCBOR dependency
86 $SHELL ./extlibs/tinycbor/prep.sh
88 # Remove modules history for gbs export (Applies to tinycbor, mbedtls...)
89 rm -rf ./extlibs/*/*/.git
91 # Initialize Git repositoryㅣ
92 if [ ! -d .git ]; then
94 git config user.email "you@example.com"
95 git config user.name "Your Name"
97 git commit -m "Initial commit"
100 echo "Calling core gbs build command"
102 if eval $gbscommand; then
103 echo "Build is successful"
112 rm -rf $sourcedir/tmp