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

Contents of /code/trunk/PrepareRelease

Parent Directory Parent Directory | Revision Log Revision Log


Revision 429 - (hide annotations) (download)
Tue Sep 1 16:10:16 2009 UTC (5 years ago) by ph10
File size: 6420 byte(s)
Add pcredemo man page, containing a listing of pcredemo.c.

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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12