PrepareRelease 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. #/bin/sh
  2. # Script to prepare the files for building a PCRE release. It does some
  3. # processing of the documentation, detrails files, and creates pcre.h.generic
  4. # and config.h.generic (for use by builders who can't run ./configure).
  5. # You must run this script before runnning "make dist". If its first argument
  6. # is "doc", it stops after preparing the documentation. There are no other
  7. # arguments. The script makes use of the following files:
  8. # 132html A Perl script that converts a .1 or .3 man page into HTML. It
  9. # "knows" the relevant troff constructs that are used in the PCRE
  10. # man pages.
  11. # CheckMan A Perl script that checks man pages for typos in the mark up.
  12. # CleanTxt A Perl script that cleans up the output of "nroff -man" by
  13. # removing backspaces and other redundant text so as to produce
  14. # a readable .txt file.
  15. # Detrail A Perl script that removes trailing spaces from files.
  16. # doc/index.html.src
  17. # A file that is copied as index.html into the doc/html directory
  18. # when the HTML documentation is built. It works like this so that
  19. # doc/html can be deleted and re-created from scratch.
  20. # README & NON-AUTOTOOLS-BUILD
  21. # These files are copied into the doc/html directory, with .txt
  22. # extensions so that they can by hyperlinked from the HTML
  23. # documentation, because some people just go to the HTML without
  24. # looking for text files.
  25. # First, sort out the documentation. Remove pcredemo.3 first because it won't
  26. # pass the markup check (it is created below, using markup that none of the
  27. # other pages use).
  28. cd doc
  29. echo Processing documentation
  30. /bin/rm -f pcredemo.3
  31. # Check the remaining man pages
  32. perl ../CheckMan *.1 *.3
  33. if [ $? != 0 ] ; then exit 1; fi
  34. # Make Text form of the documentation. It needs some mangling to make it
  35. # tidy for online reading. Concatenate all the .3 stuff, but omit the
  36. # individual function pages.
  37. cat <<End >pcre.txt
  38. -----------------------------------------------------------------------------
  39. This file contains a concatenation of the PCRE man pages, converted to plain
  40. text format for ease of searching with a text editor, or for use on systems
  41. that do not have a man page processor. The small individual files that give
  42. synopses of each function in the library have not been included. Neither has
  43. the pcredemo program. There are separate text files for the pcregrep and
  44. pcretest commands.
  45. -----------------------------------------------------------------------------
  46. End
  47. echo "Making pcre.txt"
  48. for file in pcre pcre16 pcre32 pcrebuild pcrematching pcreapi pcrecallout \
  49. pcrecompat pcrepattern pcresyntax pcreunicode pcrejit pcrepartial \
  50. pcreprecompile pcreperform pcreposix pcrecpp pcresample \
  51. pcrelimits pcrestack ; do
  52. echo " Processing $file.3"
  53. nroff -c -man $file.3 >$file.rawtxt
  54. perl ../CleanTxt <$file.rawtxt >>pcre.txt
  55. /bin/rm $file.rawtxt
  56. echo "------------------------------------------------------------------------------" >>pcre.txt
  57. if [ "$file" != "pcresample" ] ; then
  58. echo " " >>pcre.txt
  59. echo " " >>pcre.txt
  60. fi
  61. done
  62. # The three commands
  63. for file in pcretest pcregrep pcre-config ; do
  64. echo Making $file.txt
  65. nroff -c -man $file.1 >$file.rawtxt
  66. perl ../CleanTxt <$file.rawtxt >$file.txt
  67. /bin/rm $file.rawtxt
  68. done
  69. # Make pcredemo.3 from the pcredemo.c source file
  70. echo "Making pcredemo.3"
  71. perl <<"END" >pcredemo.3
  72. open(IN, "../pcredemo.c") || die "Failed to open pcredemo.c\n";
  73. open(OUT, ">pcredemo.3") || die "Failed to open pcredemo.3\n";
  74. print OUT ".\\\" Start example.\n" .
  75. ".de EX\n" .
  76. ". nr mE \\\\n(.f\n" .
  77. ". nf\n" .
  78. ". nh\n" .
  79. ". ft CW\n" .
  80. "..\n" .
  81. ".\n" .
  82. ".\n" .
  83. ".\\\" End example.\n" .
  84. ".de EE\n" .
  85. ". ft \\\\n(mE\n" .
  86. ". fi\n" .
  87. ". hy \\\\n(HY\n" .
  88. "..\n" .
  89. ".\n" .
  90. ".EX\n" ;
  91. while (<IN>)
  92. {
  93. s/\\/\\e/g;
  94. print OUT;
  95. }
  96. print OUT ".EE\n";
  97. close(IN);
  98. close(OUT);
  99. END
  100. if [ $? != 0 ] ; then exit 1; fi
  101. # Make HTML form of the documentation.
  102. echo "Making HTML documentation"
  103. /bin/rm html/*
  104. cp index.html.src html/index.html
  105. cp ../README html/README.txt
  106. cp ../NON-AUTOTOOLS-BUILD html/NON-AUTOTOOLS-BUILD.txt
  107. for file in *.1 ; do
  108. base=`basename $file .1`
  109. echo " Making $base.html"
  110. perl ../132html -toc $base <$file >html/$base.html
  111. done
  112. # Exclude table of contents for function summaries. It seems that expr
  113. # forces an anchored regex. Also exclude them for small pages that have
  114. # only one section.
  115. for file in *.3 ; do
  116. base=`basename $file .3`
  117. toc=-toc
  118. if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi
  119. if [ "$base" = "pcresample" ] || \
  120. [ "$base" = "pcrestack" ] || \
  121. [ "$base" = "pcrecompat" ] || \
  122. [ "$base" = "pcrelimits" ] || \
  123. [ "$base" = "pcreperform" ] || \
  124. [ "$base" = "pcreunicode" ] ; then
  125. toc=""
  126. fi
  127. echo " Making $base.html"
  128. perl ../132html $toc $base <$file >html/$base.html
  129. if [ $? != 0 ] ; then exit 1; fi
  130. done
  131. # End of documentation processing; stop if only documentation required.
  132. cd ..
  133. echo Documentation done
  134. if [ "$1" = "doc" ] ; then exit; fi
  135. # These files are detrailed; do not detrail the test data because there may be
  136. # significant trailing spaces. Do not detrail RunTest.bat, because it has CRLF
  137. # line endings and the detrail script removes all trailing white space. The
  138. # configure files are also omitted from the detrailing. We don't bother with
  139. # those pcre[16|32]_xx files that just define COMPILE_PCRE16 and then #include the
  140. # common file, because they aren't going to change.
  141. files="\
  142. Makefile.am \
  143. Makefile.in \
  144. configure.ac \
  145. README \
  146. LICENCE \
  147. COPYING \
  148. AUTHORS \
  149. NEWS \
  150. NON-UNIX-USE \
  151. NON-AUTOTOOLS-BUILD \
  152. INSTALL \
  153. 132html \
  154. CleanTxt \
  155. Detrail \
  156. ChangeLog \
  157. CMakeLists.txt \
  158. RunGrepTest \
  159. RunTest \
  160. pcre-config.in \
  161. libpcre.pc.in \
  162. libpcre16.pc.in \
  163. libpcre32.pc.in \
  164. libpcreposix.pc.in \
  165. libpcrecpp.pc.in \
  166. config.h.in \
  167. pcre_chartables.c.dist \
  168. pcredemo.c \
  169. pcregrep.c \
  170. pcretest.c \
  171. dftables.c \
  172. pcreposix.c \
  173. pcreposix.h \
  174. pcre.h.in \
  175. pcre_internal.h \
  176. pcre_byte_order.c \
  177. pcre_compile.c \
  178. pcre_config.c \
  179. pcre_dfa_exec.c \
  180. pcre_exec.c \
  181. pcre_fullinfo.c \
  182. pcre_get.c \
  183. pcre_globals.c \
  184. pcre_jit_compile.c \
  185. pcre_jit_test.c \
  186. pcre_maketables.c \
  187. pcre_newline.c \
  188. pcre_ord2utf8.c \
  189. pcre16_ord2utf16.c \
  190. pcre32_ord2utf32.c \
  191. pcre_printint.c \
  192. pcre_refcount.c \
  193. pcre_string_utils.c \
  194. pcre_study.c \
  195. pcre_tables.c \
  196. pcre_valid_utf8.c \
  197. pcre_version.c \
  198. pcre_xclass.c \
  199. pcre16_utf16_utils.c \
  200. pcre32_utf32_utils.c \
  201. pcre16_valid_utf16.c \
  202. pcre32_valid_utf32.c \
  203. pcre_scanner.cc \
  204. pcre_scanner.h \
  205. pcre_scanner_unittest.cc \
  206. pcrecpp.cc \
  207. pcrecpp.h \
  208. pcrecpparg.h.in \
  209. pcrecpp_unittest.cc \
  210. pcre_stringpiece.cc \
  211. pcre_stringpiece.h.in \
  212. pcre_stringpiece_unittest.cc \
  213. perltest.pl \
  214. ucp.h \
  215. makevp.bat \
  216. pcre.def \
  217. libpcre.def \
  218. libpcreposix.def"
  219. echo Detrailing
  220. perl ./Detrail $files doc/p* doc/html/*
  221. echo Done
  222. #End