makedist.sh 1.3 KB

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