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

Diff of /code/trunk/PrepareRelease

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

code/trunk/maintain/MakeRelease revision 97 by ph10, Mon Mar 5 12:36:47 2007 UTC code/trunk/PrepareRelease revision 840 by ph10, Fri Dec 30 19:32:50 2011 UTC
# Line 1  Line 1 
1  #/bin/sh  #/bin/sh
2    
3  # Script to make a PCRE release  # 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  if [ ! "$1" ]; then  # You must run this script before runnning "make dist". If its first argument
8    echo "*** Version number missing ***"  # is "doc", it stops after preparing the documentation. There are no other
9    exit 1  # arguments. The script makes use of the following files:
 fi  
10    
11  # The name of the release directory  # 132html     A Perl script that converts a .1 or .3 man page into HTML. It
12    #             "knows" the relevant troff constructs that are used in the PCRE
13    #             man pages.
14    
15  dir=pcre-$1  # CheckMan    A Perl script that checks man pages for typos in the mark up.
16    
17  # But sometimes we just want to process the documentation  # 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    
21  if [ "$1" = "doconly" ] ; then  # Detrail     A Perl script that removes trailing spaces from files.
   doconly=yes  
 fi  
22    
23    # doc/index.html.src
24    #             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    
28  # First, sort out the documentation  
29    # 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    
33  cd doc  cd doc
34  echo Processing documentation  echo Processing documentation
35    
36    /bin/rm -f pcredemo.3
37    
38    # Check the remaining man pages
39    
40    perl ../CheckMan *.1 *.3
41    if [ $? != 0 ] ; then exit 1; fi
42    
43  # Make Text form of the documentation. It needs some mangling to make it  # 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  # tidy for online reading. Concatenate all the .3 stuff, but omit the
45  # individual function pages.  # individual function pages.
# Line 32  cat <<End >pcre.txt Line 49  cat <<End >pcre.txt
49  This file contains a concatenation of the PCRE man pages, converted to plain  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  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  that do not have a man page processor. The small individual files that give
52  synopses of each function in the library have not been included. There are  synopses of each function in the library have not been included. Neither has
53  separate text files for the pcregrep and pcretest commands.  the pcredemo program. There are separate text files for the pcregrep and
54    pcretest commands.
55  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
56    
57    
# Line 41  End Line 59  End
59    
60  echo "Making pcre.txt"  echo "Making pcre.txt"
61  for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \  for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \
62              pcrepattern pcrepartial pcreprecompile \              pcrepattern pcresyntax pcreunicode pcrejit pcrepartial \
63              pcreperform pcreposix pcrecpp pcresample pcrestack ; do              pcreprecompile pcreperform pcreposix pcrecpp pcresample \
64                pcrelimits pcrestack ; do
65    echo "  Processing $file.3"    echo "  Processing $file.3"
66    nroff -c -man $file.3 >$file.rawtxt    nroff -c -man $file.3 >$file.rawtxt
67    ../maintain/CleanTxt <$file.rawtxt >>pcre.txt    perl ../CleanTxt <$file.rawtxt >>pcre.txt
68    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
69    echo "------------------------------------------------------------------------------" >>pcre.txt    echo "------------------------------------------------------------------------------" >>pcre.txt
70    if [ "$file" != "pcresample" ] ; then    if [ "$file" != "pcresample" ] ; then
# Line 54  for file in pcre pcrebuild pcrematching Line 73  for file in pcre pcrebuild pcrematching
73    fi    fi
74  done  done
75    
76  # The two commands  # The three commands
77  for file in pcretest pcregrep ; do  for file in pcretest pcregrep pcre-config ; do
78    echo Making $file.txt    echo Making $file.txt
79    nroff -c -man $file.1 >$file.rawtxt    nroff -c -man $file.1 >$file.rawtxt
80    ../maintain/CleanTxt <$file.rawtxt >$file.txt    perl ../CleanTxt <$file.rawtxt >$file.txt
81    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
82  done  done
83    
84    
85    # 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                ".EX\n" ;
108      while (<IN>)
109        {
110        s/\\/\\e/g;
111        print OUT;
112        }
113      print OUT ".EE\n";
114      close(IN);
115      close(OUT);
116    END
117    if [ $? != 0 ] ; then exit 1; fi
118    
119    
120  # Make HTML form of the documentation.  # Make HTML form of the documentation.
121    
122    echo "Making HTML documentation"
123  /bin/rm html/*  /bin/rm html/*
124  cp ../maintain/Index.html html/index.html  cp index.html.src html/index.html
125    
126  for file in *.1 ; do  for file in *.1 ; do
127    base=`basename $file .1`    base=`basename $file .1`
128    echo Making $base.html    echo "  Making $base.html"
129    ../maintain/132html -toc $base <$file >html/$base.html    perl ../132html -toc $base <$file >html/$base.html
130  done  done
131    
132  # Exclude table of contents for function summaries. It seems that expr  # Exclude table of contents for function summaries. It seems that expr
133  # forces an anchored regex. Also exclude them for small pages that have  # forces an anchored regex. Also exclude them for small pages that have
134  # only one section.  # only one section.
135    
136  for file in *.3 ; do  for file in *.3 ; do
137    base=`basename $file .3`    base=`basename $file .3`
138    toc=-toc    toc=-toc
139    if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi    if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi
140    if [ "$base" = "pcresample" ] || \    if [ "$base" = "pcresample" ]  || \
141       [ "$base" = "pcrestack" ]  || \       [ "$base" = "pcrestack" ]   || \
142       [ "$base" = "pcrecompat" ] || \       [ "$base" = "pcrecompat" ]  || \
143       [ "$base" = "pcreperform" ] ; then       [ "$base" = "pcrelimits" ]  || \
144         [ "$base" = "pcreperform" ] || \
145         [ "$base" = "pcreunicode" ] ; then
146      toc=""      toc=""
147    fi    fi
148    echo Making $base.html    echo "  Making $base.html"
149    ../maintain/132html $toc $base <$file >html/$base.html    perl ../132html $toc $base <$file >html/$base.html
150      if [ $? != 0 ] ; then exit 1; fi
151  done  done
152    
153  # End of documentation processing  # End of documentation processing; stop if only documentation required.
154    
155  cd ..  cd ..
156  echo Documentation done  echo Documentation done
157    if [ "$1" = "doc" ] ; then exit; fi
158    
159  if [ "$doconly" = "yes" ] ; then  # These files are detrailed; do not detrail the test data because there may be
160    exit 0  # significant trailing spaces. Do not detrail RunTest.bat, because it has CRLF
161  fi  # line endings and the detrail script removes all trailing white space. The
162    # configure files are also omitted from the detrailing. We don't bother with
163  # These files are detrailed and copied; do not detrail the test data  # those pcre16_xx files that just define COMPILE_PCRE16 and then #include the
164  # because there may be significant trailing spaces. The configure files  # common file, because they aren't going to change.
165  # are also omitted from the detrailing.  
166    files="\
167  files="Makefile.in configure.ac config.h.in \    Makefile.am \
168    README LICENCE COPYING AUTHORS NEWS NON-UNIX-USE INSTALL ChangeLog \    Makefile.in \
169      configure.ac \
170      README \
171      LICENCE \
172      COPYING \
173      AUTHORS \
174      NEWS \
175      NON-UNIX-USE \
176      INSTALL \
177      132html \
178      CleanTxt \
179      Detrail \
180      ChangeLog \
181      CMakeLists.txt \
182      RunGrepTest \
183      RunTest \
184    pcre-config.in \    pcre-config.in \
185    libpcre.pc.in \    libpcre.pc.in \
186      libpcre16.pc.in \
187      libpcreposix.pc.in \
188    libpcrecpp.pc.in \    libpcrecpp.pc.in \
189    pcre_printint.src \    config.h.in \
190      pcre_chartables.c.dist \
191    pcredemo.c \    pcredemo.c \
192    pcregrep.c \    pcregrep.c \
193    pcretest.c \    pcretest.c \
194    dftables.c \    dftables.c \
195    pcreposix.c \    pcreposix.c \
196    pcreposix.h \    pcreposix.h \
197    pcre.h \    pcre.h.in \
198    pcre_internal.h    pcre_internal.h
199      pcre_byte_order.c \
200    pcre_compile.c \    pcre_compile.c \
201    pcre_config.c \    pcre_config.c \
202    pcre_dfa_exec.c \    pcre_dfa_exec.c \
# Line 125  files="Makefile.in configure.ac config.h Line 204  files="Makefile.in configure.ac config.h
204    pcre_fullinfo.c \    pcre_fullinfo.c \
205    pcre_get.c \    pcre_get.c \
206    pcre_globals.c \    pcre_globals.c \
207    pcre_info.c \    pcre_jit_compile.c \
208      pcre_jit_test.c \
209    pcre_maketables.c \    pcre_maketables.c \
210    pcre_newline.c \    pcre_newline.c \
211    pcre_ord2utf8.c \    pcre_ord2utf8.c \
212      pcre_ord2utf16.c \
213      pcre_printint.c \
214    pcre_refcount.c \    pcre_refcount.c \
215      pcre_stringutils.c \
216    pcre_study.c \    pcre_study.c \
217    pcre_tables.c \    pcre_tables.c \
   pcre_try_flipped.c \  
218    pcre_ucp_searchfuncs.c \    pcre_ucp_searchfuncs.c \
219    pcre_valid_utf8.c \    pcre_valid_utf8.c \
220    pcre_version.c \    pcre_version.c \
221    pcre_xclass.c \    pcre_xclass.c \
222      pcre16_utf16_utils.c \
223      pcre16_valid_utf16.c \
224    pcre_scanner.cc \    pcre_scanner.cc \
225    pcre_scanner.h \    pcre_scanner.h \
226    pcre_scanner_unittest.cc \    pcre_scanner_unittest.cc \
# Line 152  files="Makefile.in configure.ac config.h Line 236  files="Makefile.in configure.ac config.h
236    ucpinternal.h \    ucpinternal.h \
237    ucptable.h \    ucptable.h \
238    makevp.bat \    makevp.bat \
   RunTest.bat \  
239    pcre.def \    pcre.def \
240    libpcre.def \    libpcre.def \
241    libpcreposix.def"    libpcreposix.def"
242    
 docfiles="doc/Tech.Notes doc/p*"  
   
243  echo Detrailing  echo Detrailing
244  ./maintain/Detrail $files doc/p* doc/html/*  perl ./Detrail $files doc/p* doc/html/*
245    
246  echo Building release  echo Doing basic configure to get default pcre.h and config.h
247  echo " "  # This is in case the caller has set aliases (as I do - PH)
248    unset cp ls mv rm
249    ./configure >/dev/null
250    
251    echo Converting pcre.h and config.h to generic forms
252    cp -f pcre.h pcre.h.generic
253    
254    perl <<'END'
255      open(IN, "<config.h") || die "Can't open config.h: $!\n";
256      open(OUT, ">config.h.generic") || die "Can't open config.h.generic: $!\n";
257      while (<IN>)
258        {
259        if (/^#define\s(?!PACKAGE)(\w+)/)
260          {
261          print OUT "#ifndef $1\n";
262          print OUT;
263          print OUT "#endif\n";
264          }
265        else
266          {
267          print OUT;
268          }
269        }
270      close IN;
271      close OUT;
272    END
273    
274  mkdir Releases/$dir  echo Done
 mkdir Releases/$dir/doc  
 mkdir Releases/$dir/testdata  
   
 cp $files RunTest.in RunGrepTest.in configure install-sh mkinstalldirs \  
    config.guess config.sub libpcre.a.dev ltmain.sh Releases/$dir  
 cp -r doc/* Releases/$dir/doc  
   
 cp testdata/testinput1 testdata/testoutput1 \  
    testdata/testinput2 testdata/testoutput2 \  
    testdata/testinput3 testdata/testoutput3 \  
    testdata/testinput4 testdata/testoutput4 \  
    testdata/testinput5 testdata/testoutput5 \  
    testdata/testinput6 testdata/testoutput6 \  
    testdata/testinput7 testdata/testoutput7 \  
    testdata/testinput8 testdata/testoutput8 \  
    testdata/testinput9 testdata/testoutput9 \  
    testdata/grepinput  testdata/grepinputx  \  
    testdata/greplist   testdata/grepoutput \  
    testdata/grepinput8 testdata/grepoutput8 \  
    Releases/$dir/testdata  
   
 # Change the comparison command for testing to the standard one  
   
 ne Releases/$dir/RunTest.in -with /dev/null -opt "ge/cf=cf//cf=diff/"  
 ne Releases/$dir/RunGrepTest.in -with /dev/null -opt "ge/cf=cf//cf=diff/"  
   
 cd Releases  
   
 tar cf $dir.tar $dir  
 gzip -v --best $dir.tar  
 gpg -sb $dir.tar.gz  
   
 tar cf $dir.tar $dir  
 bzip2 -v -9 $dir.tar  
 gpg -sb $dir.tar.bz2  
275    
276  #End  #End

Legend:
Removed from v.97  
changed lines
  Added in v.840

  ViewVC Help
Powered by ViewVC 1.1.5