Merge "Merge branch 'remote-access2'"
[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/sqlite3 $sourcedir/tmp/extlibs
27 cp -R ./extlibs/timer $sourcedir/tmp/extlibs
28 cp -R ./extlibs/rapidxml $sourcedir/tmp/extlibs
29 cp -R ./resource $sourcedir/tmp
30 cp -R ./service $sourcedir/tmp
31 cp ./extra_options.scons $sourcedir/tmp
32 cp ./tools/tizen/*.spec ./tmp/packaging
33 cp ./tools/tizen/*.manifest ./tmp/packaging
34 cp ./SConstruct ./tmp
35 cp ./tools/tizen/*.rpm ./tmp
36 cp ./tools/tizen/.gbs.conf ./tmp
37
38 cp -R $sourcedir/iotivity.pc.in $sourcedir/tmp
39
40 cd $sourcedir/tmp
41
42 echo `pwd`
43 rm -rf ./extlibs/tinycbor/tinycbor/.git*
44
45 # Initialize Git repository
46 if [ ! -d .git ]; then
47    git init ./
48    git config user.email "you@example.com"
49    git config user.name "Your Name"
50    git add ./
51    git commit -m "Initial commit"
52 fi
53
54 echo "Calling core gbs build command"
55 gbscommand="gbs build -A armv7l -B ~/GBS-ROOT --include-all --repository ./"
56 echo $gbscommand
57 if eval $gbscommand; then
58    echo "Build is successful"
59 else
60    echo "Build failed!"
61 fi
62
63 cd $sourcedir
64 rm -rf $sourcedir/tmp