3f62f4d0d5ab0a86cb8b16f657139066416135e6
[supertux.git] / src / unison / physfs-1.1.1 / extras / makedist.sh
1 #!/bin/sh
2
3 # This shell script is roughly equivalent to what "make dist" did in the
4 #  autotools build system and is called from a custom CMake target.
5
6 # !!! FIXME: This code sort of sucks. Consider using CPack instead...
7
8 if [ ! -f ./CMakeLists.txt ]; then
9     echo "you are in the wrong place."
10     exit 1
11 fi
12
13 if [ -z "$1" ]; then
14     echo "Wrong arguments."
15     exit 2
16 fi
17
18 set -e
19
20 VERSION="$1"
21 BASENAME="physfs-$VERSION"
22 TARBALL="$BASENAME.tar.gz"
23 TMPCPDIR="../9sdkujy75jv932-physfstmp-$VERSION"
24 CPDIR="$TMPCPDIR/$BASENAME"
25
26 echo "Packing PhysicsFS $VERSION source tarball..."
27 echo " + Setting up scratch dir..."
28 rm -rf $TMPCPDIR
29 mkdir $TMPCPDIR
30 mkdir $CPDIR
31
32 echo " + Making copy of source tree in scratch dir..."
33 cp -R . $CPDIR/
34 echo " + Deleting cruft..."
35 pushd $CPDIR >/dev/null
36 rm -rf `svn propget svn:ignore .`
37 rm -rf `svn status |grep '?' |sed -s 's/\?//'`
38 popd >/dev/null
39 rm -rf `find $CPDIR -type d -name '.svn'`
40 echo " + Deleting Subversion metadata..."
41 rm -rf `find $CPDIR -type d -name '.svn'`
42 echo " + Fixing up permissions..."
43 chmod -R a+rw $CPDIR
44 chmod a+x `find $CPDIR -type d`
45 echo " + Building final tarball..."
46 rm -f $TARBALL
47 tar -czf $TARBALL -C $TMPCPDIR $BASENAME
48 echo " + Cleaning up..."
49 rm -rf $TMPCPDIR
50 echo " + All done! Packed to '$TARBALL' ..."
51 set +e
52
53 exit 0
54