/[pcre]/code/branches/pcre16/PrepareRelease
ViewVC logotype

Contents of /code/branches/pcre16/PrepareRelease

Parent Directory Parent Directory | Revision Log Revision Log


Revision 683 - (hide annotations) (download)
Tue Sep 6 10:37:15 2011 UTC (3 years, 3 months ago) by ph10
Original Path: code/trunk/PrepareRelease
File size: 7099 byte(s)
Documentation updates.

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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12