Tizen 2.0 Release
[adaptation/face-engine.git] / make_tar.sh
1 #!/bin/sh
2
3 echo ".gitattributes export-ignore" > .gitattributes
4 echo ".gitignore export-ignore" >> .gitattributes
5 echo "debian export-ignore" >> .gitattributes
6 echo "packaging export-ignore" >> .gitattributes
7
8 PWD=`pwd`
9 DIR=`basename $PWD`
10 echo "DIR=$DIR"
11
12 COUNT=`ls -1 packaging/*.spec | grep .spec | wc -l`
13
14 if [ $COUNT -ne 1 ]
15 then
16         echo "No spec file !!"
17         exit;
18 fi
19
20 SPEC_FILE=`ls -1 packaging/*.spec`
21
22 #SPEC_FILE=ug-image-viewer-efl.spec
23
24 VER=`grep "Version:" $SPEC_FILE | awk '{ print $2 }'`
25 REV=`grep "Release:" $SPEC_FILE | awk '{ print $2 }'`
26
27 PKGNAME=`grep "Name:" $SPEC_FILE | awk '{ print $2}'`
28
29 echo "package : $PKGNAME"
30 echo "version : $VER"
31 echo "revision : $REV"
32
33 # git archive --format=tar --worktree-attributes --prefix=$PKGNAME-$VER/ HEAD  | gzip >  ./packaging/$PKGNAME-$VER.tar.gz
34
35 rm .build_tmp -rf
36
37 mkdir .build_tmp
38 cd .build_tmp
39
40 mkdir $PKGNAME-$VER
41
42 cp ../* $PKGNAME-$VER -r
43
44 tar cvzf ../packaging/$PKGNAME-$VER.tar.gz $PKGNAME-$VER --exclude .git --exclude packaging
45
46 cd ..
47
48 rm .build_tmp -rf
49
50 # cd $PWD
51
52 echo "Created : " $PKGNAME-$VER.tar.gz
53