/[pcre]/code/tags/pcre-7.1/PrepareRelease
ViewVC logotype

Contents of /code/tags/pcre-7.1/PrepareRelease

Parent Directory Parent Directory | Revision Log Revision Log


Revision 111 - (show annotations) (download)
Thu Mar 8 16:53:09 2007 UTC (7 years, 9 months ago) by ph10
Original Path: code/trunk/PrepareRelease
File size: 5341 byte(s)
Create the PrepareRelease script to process the documentation and create the 
.generic files for distribution, also to remove trailing spaces. Update a lot 
more of the build-time documentation. Arrange for PrepareRelease and its 
sub-scripts to be distributed.

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

Properties

Name Value
svn:executable *

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12