makesrcdist 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #!/bin/sh
  2. #
  3. # makesrcdist - make a distribution of FLTK.
  4. #
  5. echo "Getting distribution..."
  6. if test $# = 0 -o "x$1" = xsnapshot; then
  7. echo Updating for snapshot...
  8. svn up
  9. rev=`svnversion . | sed -e '1,$s/[a-zA-Z]//g'`
  10. version="1.3svn"
  11. fileversion="1.3svn-r$rev"
  12. fileurl="ftp://ftp.easysw.com/pub/fltk/snapshots/fltk-$fileversion-source.tar.bz2"
  13. url="."
  14. else
  15. if test ! -e "documentation/html/"; then
  16. echo "ERROR: Please generate the HTML documentation before distributing:"
  17. echo " autoconf"
  18. echo " ./configure"
  19. echo " cd documentation; make dist"
  20. exit
  21. fi
  22. if test ! -e "documentation/fltk.pdf"; then
  23. echo "ERROR: Please generate the PDF documentation before distributing:"
  24. echo " autoconf"
  25. echo " ./configure"
  26. echo " cd documentation; make dist"
  27. exit
  28. fi
  29. echo Creating tag for release...
  30. rev="1"
  31. version=$1
  32. fileversion=$1
  33. fileurl="ftp://ftp.easysw.com/pub/fltk/$version/fltk-$fileversion-source.tar.bz2"
  34. url="https://svn.easysw.com/public/fltk/fltk/tags/release-$version"
  35. svn copy https://svn.easysw.com/public/fltk/fltk/branches/branch-1.3 "$url" \
  36. -m "Tag $version" || exit 1
  37. fi
  38. echo Exporting $version...
  39. rm -rf /tmp/fltk-$version
  40. svn export $url /tmp/fltk-$version
  41. if test $# != 0 -a "x$1" != xsnapshot; then
  42. echo "Copying HTML and PDF documentation..."
  43. cp -r documentation/html /tmp/fltk-$version/documentation/
  44. cp documentation/fltk.pdf /tmp/fltk-$version/documentation/
  45. fi
  46. echo Applying version number...
  47. cd /tmp/fltk-$version
  48. fileurl=`echo $fileurl | sed -e '1,$s/\\//\\\\\\//g'`
  49. sed -e '1,$s/@VERSION@/'$version'/' \
  50. -e '1,$s/@RELEASE@/'$rev'/' \
  51. -e '1,$s/^Source:.*/Source: '$fileurl'/' \
  52. <fltk.spec.in >fltk.spec
  53. echo Creating configure script...
  54. autoconf -f
  55. echo Creating config.guess and config.sub \(ignore any other errors\)...
  56. automake --add-missing --copy
  57. echo Cleaning developer files...
  58. rm -rf OpenGL autom4te* bc5 config forms glut images packages themes
  59. rm -f makesrcdist
  60. cd ..
  61. if test $# != 0 -a "x$1" != xsnapshot; then
  62. echo "Making HTML docs distribution..."
  63. gtar czf fltk-$fileversion-docs-html.tar.gz fltk-$version/documentation/html/
  64. echo "Making PDF docs distribution..."
  65. gtar czf fltk-$fileversion-docs-pdf.tar.gz fltk-$version/documentation/fltk.pdf
  66. fi
  67. echo "Removing documentation..."
  68. rm -rf fltk-$version/documentation/html/
  69. rm -f fltk-$version/documentation/fltk.pdf
  70. echo "Making UNIX distribution..."
  71. gtar czf fltk-$fileversion-source.tar.gz fltk-$version
  72. #echo "Making BZ2 distribution..."
  73. #gtar cjf fltk-$fileversion-source.tar.bz2 fltk-$version
  74. #echo "Making Windows distribution..."
  75. #rm -f fltk-$fileversion-source.zip
  76. #zip -r9 fltk-$fileversion-source.zip fltk-$version
  77. echo "Removing distribution directory..."
  78. rm -rf fltk-$version
  79. echo "Done!"