- Allow sudo to keep env
[meego-developer-tools:obs-light.git] / build-project-tgz.sh
1 #!/bin/sh
2
3 INITIALDIR=`pwd`
4 TMPDIR=`mktemp -d`
5 set -x 
6 PRJOBSVERSION=`sed -rn s,"Version:\s*(.*)$","\1",p "$PACKAGING/$PRJ.spec"`
7
8 rm -f "$PRJ/dist"/*.tar.gz
9 echo "creating archive in $TMPDIR"
10 git archive -o "$TMPDIR/$PRJ-$PRJOBSVERSION.tar" HEAD "$PRJDIR"
11 cd "$TMPDIR"
12 tar -xf "$PRJ-$PRJOBSVERSION.tar"
13 mv "$PRJDIR" "$PRJ-$PRJOBSVERSION"
14 tar -czf "$PRJ-$PRJOBSVERSION.tar.gz" "$PRJ-$PRJOBSVERSION"
15 #gzip -f "$PRJ"-"$PRJOBSVERSION".tar
16 cp -vf "$PRJ-$PRJOBSVERSION".tar.gz "$INITIALDIR/$PRJDIR/dist/"
17 cd "$INITIALDIR"
18 rm -rf "$TMPDIR"
19