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
30 rm -rf $sourcedir/tmp/extlibs/tinycbor/tinycbor/.git
32 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
33 cp -R ./extlibs/mbedtls $sourcedir/tmp/extlibs
34 cp -R ./extlibs/gtest $sourcedir/tmp/extlibs
35 cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
36 cp -LR ./extlibs/sqlite3 $sourcedir/tmp/extlibs
37 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
38 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
39 cp -R ./extlibs/libcoap $sourcedir/tmp/extlibs
40 cp -R ./resource $sourcedir/tmp
41 cp -R ./service $sourcedir/tmp
42 cp ./extra_options.scons $sourcedir/tmp
43 cp ./tools/tizen/*.spec ./tmp/packaging
44 cp ./tools/tizen/*.manifest ./tmp/packaging
48 # copy dependency RPMs and conf files for tizen build
49 cp ./tools/tizen/*.rpm ./tmp
50 cp ./tools/tizen/.gbs.conf ./tmp
51 cp ./tools/tizen/*.rpm $sourcedir/tmp/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
52 cp ./tools/tizen/.gbs.conf ./tmp/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample
54 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
59 gbscommand="gbs build -A armv7l "
61 for ARGUMENT_VALUE in $*
64 if [[ "$ARGUMENT_VALUE" = *"="* ]]; then
65 optionname=$(echo $ARGUMENT_VALUE | cut -f1 -d=)
66 optionvalue=$(echo $ARGUMENT_VALUE | cut -f2 -d=)
67 echo -- "# $optionname $optionvalue"
68 gbscommand=${gbscommand}" --define '$optionname $optionvalue'"
70 if [ "SECURED" = "$optionname" ]; then
74 echo "'$ARGUMENT_VALUE' does not contain '='";
78 gbscommand="${gbscommand} -B ~/GBS-ROOT-OIC --include-all --repository ./"
80 if [ $secured -eq 1 ];then
82 # Prepare mbedTLS dependency
83 $SHELL ./extlibs/mbedtls/prep.sh
86 # Prepare TinyCBOR dependency
87 $SHELL ./extlibs/tinycbor/prep.sh
89 # Initialize Git repositoryㅣ
90 if [ ! -d .git ]; then
92 git config user.email "you@example.com"
93 git config user.name "Your Name"
95 git commit -m "Initial commit"
98 echo "Calling core gbs build command"
100 if eval $gbscommand; then
101 echo "Build is successful"
110 rm -rf $sourcedir/tmp