Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

145 lignes
3.6KB

  1. #!/bin/bash
  2. PACKAGE_NAME='tufte-latex'
  3. CLASS_FILES="tufte-handout.cls tufte-book.cls"
  4. STYLE_FILES="tufte-common.sty"
  5. SOURCE_FILES="sample-handout.{pdf,tex,bib} sample-book.{pdf,tex}"
  6. # Exit on first error:
  7. set -e
  8. # Verify prerequisites:
  9. if test $# -ne 1
  10. then
  11. echo "Usage: $0 VERSION"
  12. exit 1
  13. fi
  14. CLASS_DATE=`date +%Y/%m/%d` # (with slashes)
  15. VERSION=$1
  16. if ! echo $VERSION | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$"
  17. then
  18. echo "VERSION should be of the form 1.2.5 (major.minor.revision)"
  19. exit 1
  20. fi
  21. for CLASS in $CLASS_FILES; do
  22. if ! grep -q $VERSION $CLASS
  23. then
  24. echo "Error: version skew. '$VERSION' does not match that in $CLASS"
  25. grep -H ProvidesClass $CLASS
  26. exit 1
  27. fi
  28. if ! grep -q $CLASS_DATE $CLASS; then
  29. echo "Error: date skew. '$CLASS_DATE' does not match that in $CLASS"
  30. grep -H ProvidesClass $CLASS
  31. exit 1
  32. fi
  33. done
  34. for STYLE in $STYLE_FILES; do
  35. if ! grep -q $VERSION $STYLE
  36. then
  37. echo "Error: version skew. '$VERSION' does not match that in $STYLE"
  38. grep -H ProvidesPackage $STYLE
  39. exit 1
  40. fi
  41. if ! grep -q $CLASS_DATE $STYLE
  42. then
  43. echo "Error: date skew. '$CLASS_DATE' does not match that in $STYLE"
  44. grep -H ProvidesPackage $STYLE
  45. exit 1
  46. fi
  47. done
  48. if ! grep -q $VERSION History.txt
  49. then
  50. echo "Error: no release notes for '$VERSION' found in History.txt"
  51. grep -H $VERSION History.txt
  52. exit 1
  53. fi
  54. HISTORY_DATE=`date +%Y-%m-%d` # (with dashes)
  55. if ! grep -q $history_date History.txt
  56. then
  57. echo "Error: '$history_date' not found in History.txt"
  58. grep -H $history_date History.txt
  59. exit 1
  60. fi
  61. # Refresh sample documents
  62. pdflatex sample-handout > refresh-sample.log
  63. bibtex sample-handout >> refresh-sample.log
  64. pdflatex sample-handout >> refresh-sample.log
  65. pdflatex sample-handout >> refresh-sample.log
  66. rm -f sample-handout.{aux,log,out,blg,bbl} refresh-sample.log
  67. pdflatex sample-book > refresh-sample.log
  68. bibtex sample-book >> refresh-sample.log
  69. texindy --language english sample-book.idx >> refresh-sample.log
  70. pdflatex sample-book >> refresh-sample.log
  71. pdflatex sample-book >> refresh-sample.log
  72. rm -f sample-bok.{aux,log,out,blg,bbl,idx,ind,toc} refresh-sample.log
  73. # To ease googlecode upload, make a distinct version of sample-handout:
  74. cp sample-handout.pdf sample-handout-$version.pdf
  75. cp sample-book.pdf sample-book-$version.pdf
  76. # Make bundle for Google Code release
  77. mkdir -p pkg/$package-$version
  78. tar cf - `cat Manifest.txt` | ( cd pkg/$package-$version && tar xf - )
  79. ( cd pkg && zip -rq $package-$version.zip $package-$version )
  80. # Make bundle for CTAN release
  81. TDS_DIR=pkg/$package/tds/
  82. TDS_TEX_DIR=$TDS_DIR/tex/latex/$package/
  83. TDS_DOC_DIR=$TDS_DIR/doc/latex/$package/
  84. TDS_SRC_DIR=$TDS_DIR/source/latex/$package/
  85. mkdir -p $TDS_DIR $TDS_TEX_DIR $TDS_DOC_DIR $TDS_SRC_DIR
  86. cp $CLASS_FILES $STYLE_FILES $TDS_TEX_DIR/
  87. cp History.txt README.txt sample-handout.{pdf,tex,bib} sample-book.{pdf,tex} $TDS_DOC_DIR/
  88. mkdir $TDS_DOC_DIR/graphics
  89. cp graphics/* $TDS_DOC_DIR/graphics/
  90. cp $CLASS_FILES $STYLE_FILES $SOURCE_FILES $TDS_SRC_DIR/
  91. ( cd $TDS_DIR && zip -rq ../../$package-$version/$package.tds.zip * )
  92. rm -fr pkg/$package
  93. mv pkg/$package-$version pkg/$package
  94. ( cd pkg && zip -rq $package.zip $package )
  95. # Remove our temporary files
  96. rm -fr pkg/$package
  97. # Provide some cut-n-paste material for manual steps:
  98. cat << MESSAGE
  99. `openssl dgst -sha1 pkg/$package-$version.zip`
  100. Don't forget to create an SVN tag (after committing changes),
  101. svn cp -m'To tag release $version.' \\
  102. https://$package.googlecode.com/svn/trunk \\
  103. https://$package.googlecode.com/svn/tags/rel_$version
  104. and upload the zip file,
  105. http://code.google.com/p/$package/downloads/list
  106. http://ctan.org/upload
  107. MESSAGE