25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.3KB

  1. #! /bin/bash
  2. # Shell options: -o = on, +o = off
  3. set -o errexit # exit on first error
  4. set -o nounset # report unset variables
  5. set +o xtrace # show commands
  6. PACKAGE="tufte-latex"
  7. CLS_FILES="tufte-handout.cls tufte-book.cls"
  8. DEF_FILES="tufte-common.def"
  9. BST_FILES="tufte.bst"
  10. SOURCE_FILES="sample-handout.pdf sample-handout.tex sample-handout.bib sample-book.pdf sample-book.tex"
  11. if test $# -ne 1 ; then echo "Usage: $0 3.5.2 (version number)" ; exit 1 ; fi
  12. VERSION=$1
  13. DATE=$(date +"%Y/%m/%d")
  14. if ! echo $VERSION | egrep -q "^[0-9]+\.[0-9]+\.[0-9]+$" ; then
  15. echo "Error: version should be of the form 1.2.5 (major.minor.revision)."
  16. exit 1
  17. fi
  18. # TODO: instead of all this checking, just sed values into the appropriate files
  19. DATE_VERSION="$DATE v$VERSION"
  20. for file in $CLS_FILES $DEF_FILES ; do
  21. if ! grep -q "$DATE_VERSION" $file ; then
  22. echo "Error: $file does not contain '$DATE_VERSION':"
  23. egrep 'Provides(Class|File)' $file
  24. exit 1
  25. fi
  26. done
  27. VERSION_DATE="$VERSION - $DATE"
  28. if ! grep -q "$VERSION_DATE" History.txt ; then
  29. echo "Error: no release notes for '$VERSION_DATE' found in History.txt"
  30. exit 1
  31. fi
  32. # Refresh sample documents
  33. echo "Building sample-handout ..."
  34. pdflatex sample-handout > refresh-sample.log
  35. bibtex sample-handout >> refresh-sample.log
  36. pdflatex sample-handout >> refresh-sample.log
  37. pdflatex sample-handout >> refresh-sample.log
  38. rm -f sample-handout.{aux,blg,bbl,log,out} refresh-sample.log
  39. echo "Success"
  40. echo "Building sample-book ..."
  41. pdflatex sample-book > refresh-book.log
  42. bibtex sample-book >> refresh-book.log
  43. texindy --language english sample-book.idx >> refresh-book.log
  44. pdflatex sample-book >> refresh-book.log
  45. pdflatex sample-book >> refresh-book.log
  46. rm -f sample-book.{aux,blg,bbl,idx,ind,lof,log,lot,out,toc} refresh-book.log
  47. echo "Success"
  48. # To ease Google Code upload, make a distinct version of samples:
  49. cp sample-handout.pdf sample-handout-$VERSION.pdf
  50. cp sample-book.pdf sample-book-$VERSION.pdf
  51. # Make bundle for Google Code release
  52. echo "Creating zip bundle for Google Code release ..."
  53. mkdir -p pkg/$PACKAGE-$VERSION
  54. tar -cf - $(cat Manifest.txt) | tar -C pkg/$PACKAGE-$VERSION -xf -
  55. ( cd pkg && zip -rq $PACKAGE-$VERSION.zip $PACKAGE-$VERSION )
  56. echo "Complete"
  57. # Make bundle for CTAN release
  58. TDS_DIR=pkg/$PACKAGE/tds/
  59. TDS_TEX_DIR=$TDS_DIR/tex/latex/$PACKAGE/
  60. TDS_DOC_DIR=$TDS_DIR/doc/latex/$PACKAGE/
  61. TDS_SRC_DIR=$TDS_DIR/source/latex/$PACKAGE/
  62. echo "Creating zip bundle for CTAN release ..."
  63. mkdir -p $TDS_DIR $TDS_TEX_DIR $TDS_DOC_DIR $TDS_SRC_DIR
  64. cp $CLS_FILES $DEF_FILES $BST_FILES $TDS_TEX_DIR/
  65. cp History.txt README.txt sample-handout.{pdf,tex,bib} sample-book.{pdf,tex} $TDS_DOC_DIR/
  66. cp -a graphics $TDS_DOC_DIR/
  67. cp $CLS_FILES $DEF_FILES $BST_FILES $SOURCE_FILES $TDS_SRC_DIR/
  68. ( cd $TDS_DIR && zip -rq ../../$PACKAGE-$VERSION/$PACKAGE.tds.zip * )
  69. rm -fr pkg/$PACKAGE
  70. mv pkg/$PACKAGE-$VERSION pkg/$PACKAGE
  71. ( cd pkg && zip -rq $PACKAGE.zip $PACKAGE )
  72. echo "Complete"
  73. # TODO: test release (unpack and build sample-*.tex files)
  74. # Remove our temporary files
  75. rm -rf pkg/$PACKAGE
  76. # Provide some cut-n-paste material for manual steps:
  77. cat << MESSAGE
  78. `openssl dgst -sha1 pkg/$PACKAGE-$VERSION.zip`
  79. Don't forget to create an SVN tag (after committing changes),
  80. git tag -a v$VERSION -m 'Tufte-LaTeX v$VERSION'
  81. And upload the zip file:
  82. https://github.com/Tufte-LaTeX/tufte-latex/releases
  83. http://ctan.org/upload
  84. MESSAGE