extras/makedist.sh
changeset 885 e1fe7fe85939
child 891 473312ef9130
equal deleted inserted replaced
884:4337d1e9b266 885:e1fe7fe85939
       
     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 
       
    31 echo " + Making copy of source tree in scratch dir..."
       
    32 cp -R . $CPDIR/
       
    33 echo " + Deleting cruft..."
       
    34 pushd $CPDIR >/dev/null && rm -rf `svn propget svn:ignore .` && popd >/dev/null
       
    35 rm -rf `find $CPDIR -type d -name '.svn'`
       
    36 echo " + Deleting Subversion metadata..."
       
    37 rm -rf `find $CPDIR -type d -name '.svn'`
       
    38 echo " + Fixing up permissions..."
       
    39 chmod -R a+rw $CPDIR
       
    40 chmod a+x `find $CPDIR -type d`
       
    41 echo " + Building final tarball..."
       
    42 rm -f $TARBALL
       
    43 tar -czf $TARBALL -C $TMPCPDIR $BASENAME
       
    44 echo " + Cleaning up..."
       
    45 rm -rf $TMPCPDIR
       
    46 echo " + All done! Packed to '$TARBALL' ..."
       
    47 set +e
       
    48 
       
    49 exit 0
       
    50