/[pcre]/code/trunk/PrepareRelease
ViewVC logotype

Contents of /code/trunk/PrepareRelease

Parent Directory Parent Directory | Revision Log Revision Log


Revision 453 - (hide annotations) (download)
Fri Sep 18 19:12:35 2009 UTC (4 years, 7 months ago) by ph10
File size: 6611 byte(s)
Add more explanation about recursive subpatterns, and make it possible to 
process the documenation without building a whole release.

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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12