24a1cf827af3029cffcfacee86ac610a5a7b826d
[platform/upstream/iotivity.git] / gbsbuild.sh
1 #!/bin/sh
2
3 spec=`ls tools/tizen/*.spec`
4 version=`rpm --query --queryformat '%{version}\n' --specfile $spec`
5
6 name=`echo $name|cut -d" " -f 1`
7 version=`echo $version|cut -d" " -f 1`
8
9 name=iotivity
10
11 rm -rf $name-$version
12
13 builddir=`pwd`
14 sourcedir=`pwd`
15
16 echo `pwd`
17
18 mkdir ./tmp
19 mkdir ./tmp/extlibs/
20 mkdir ./tmp/packaging
21 cp -R ./build_common $sourcedir/tmp
22 cp -R ./examples $sourcedir/tmp
23 cp -R ./extlibs/tinycbor $sourcedir/tmp/extlibs
24 cp -R ./extlibs/cjson $sourcedir/tmp/extlibs
25 cp -R ./extlibs/tinydtls $sourcedir/tmp/extlibs
26 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
27 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
28 cp -R ./resource $sourcedir/tmp
29 cp -R ./service $sourcedir/tmp
30 cp ./extra_options.scons $sourcedir/tmp
31 cp ./tools/tizen/*.spec ./tmp/packaging
32 cp ./tools/tizen/*.manifest ./tmp/packaging
33 cp ./SConstruct ./tmp
34 cp ./tools/tizen/*.rpm ./tmp
35 cp ./tools/tizen/.gbs.conf ./tmp
36 cd $sourcedir/tmp
37
38 echo `pwd`
39 rm -rf ./extlibs/tinycbor/tinycbor/.git*
40
41 # Initialize Git repository
42 if [ ! -d .git ]; then
43    git init ./
44    git config user.email "you@example.com"
45    git config user.name "Your Name"
46    git add ./
47    git commit -m "Initial commit"
48 fi
49
50 echo "Calling core gbs build command"
51 gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./"
52 echo $gbscommand
53 if eval $gbscommand; then
54    echo "Build is successful"
55 else
56    echo "Build failed!"
57 fi
58
59 cd $sourcedir
60 rm -rf $sourcedir/tmp