/[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 453 by ph10, Fri Sep 18 19:12:35 2009 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  if [ ! "$1" ]; then  # and config.h.generic (for use by builders who can't run ./configure).
6    echo "*** Version number missing ***"  
7    exit 1  # You must run this script before runnning "make dist". If its first argument
8  fi  # is "doc", it stops after preparing the documentation. There are no other
9    # arguments. The script makes use of the following files:
10  # The name of the release directory  
11    # 132html     A Perl script that converts a .1 or .3 man page into HTML. It
12  dir=pcre-$1  #             "knows" the relevant troff constructs that are used in the PCRE
13    #             man pages.
14  # But sometimes we just want to process the documentation  
15    # CleanTxt    A Perl script that cleans up the output of "nroff -man" by
16  if [ "$1" = "doconly" ] ; then  #             removing backspaces and other redundant text so as to produce
17    doconly=yes  #             a readable .txt file.
18  fi  
19    # Detrail     A Perl script that removes trailing spaces from files.
20    
21    # doc/index.html.src
22    #             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    
26    
27  # First, sort out the documentation  # First, sort out the documentation
# Line 32  cat <<End >pcre.txt Line 38  cat <<End >pcre.txt
38  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
39  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
40  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
41  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
42  separate text files for the pcregrep and pcretest commands.  the pcredemo program. There are separate text files for the pcregrep and
43    pcretest commands.
44  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
45    
46    
# Line 41  End Line 48  End
48    
49  echo "Making pcre.txt"  echo "Making pcre.txt"
50  for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \  for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \
51              pcrepattern pcrepartial pcreprecompile \              pcrepattern pcresyntax pcrepartial pcreprecompile \
52              pcreperform pcreposix pcrecpp pcresample pcrestack ; do              pcreperform pcreposix pcrecpp pcresample pcrestack ; do
53    echo "  Processing $file.3"    echo "  Processing $file.3"
54    nroff -c -man $file.3 >$file.rawtxt    nroff -c -man $file.3 >$file.rawtxt
55    ../maintain/CleanTxt <$file.rawtxt >>pcre.txt    ../CleanTxt <$file.rawtxt >>pcre.txt
56    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
57    echo "------------------------------------------------------------------------------" >>pcre.txt    echo "------------------------------------------------------------------------------" >>pcre.txt
58    if [ "$file" != "pcresample" ] ; then    if [ "$file" != "pcresample" ] ; then
# Line 54  for file in pcre pcrebuild pcrematching Line 61  for file in pcre pcrebuild pcrematching
61    fi    fi
62  done  done
63    
64  # The two commands  # The three commands
65  for file in pcretest pcregrep ; do  for file in pcretest pcregrep pcre-config ; do
66    echo Making $file.txt    echo Making $file.txt
67    nroff -c -man $file.1 >$file.rawtxt    nroff -c -man $file.1 >$file.rawtxt
68    ../maintain/CleanTxt <$file.rawtxt >$file.txt    ../CleanTxt <$file.rawtxt >$file.txt
69    /bin/rm $file.rawtxt    /bin/rm $file.rawtxt
70  done  done
71    
72    
73    # 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  # Make HTML form of the documentation.  # Make HTML form of the documentation.
109    
110    echo "Making HTML documentation"
111  /bin/rm html/*  /bin/rm html/*
112  cp ../maintain/Index.html html/index.html  cp index.html.src html/index.html
113    
114  for file in *.1 ; do  for file in *.1 ; do
115    base=`basename $file .1`    base=`basename $file .1`
116    echo Making $base.html    echo "  Making $base.html"
117    ../maintain/132html -toc $base <$file >html/$base.html    ../132html -toc $base <$file >html/$base.html
118  done  done
119    
120  # Exclude table of contents for function summaries. It seems that expr  # Exclude table of contents for function summaries. It seems that expr
121  # forces an anchored regex. Also exclude them for small pages that have  # forces an anchored regex. Also exclude them for small pages that have
122  # only one section.  # only one section.
123    
124  for file in *.3 ; do  for file in *.3 ; do
125    base=`basename $file .3`    base=`basename $file .3`
126    toc=-toc    toc=-toc
# Line 87  for file in *.3 ; do Line 131  for file in *.3 ; do
131       [ "$base" = "pcreperform" ] ; then       [ "$base" = "pcreperform" ] ; then
132      toc=""      toc=""
133    fi    fi
134    echo Making $base.html    echo "  Making $base.html"
135    ../maintain/132html $toc $base <$file >html/$base.html    ../132html $toc $base <$file >html/$base.html
136      if [ $? != 0 ] ; then exit 1; fi
137  done  done
138    
139  # End of documentation processing  # End of documentation processing; stop if only documentation required.
140    
141  cd ..  cd ..
142  echo Documentation done  echo Documentation done
143    if [ "$1" = "doc" ] ; then exit; fi
144    
145  if [ "$doconly" = "yes" ] ; then  # These files are detrailed; do not detrail the test data because there may be
146    exit 0  # significant trailing spaces. The configure files are also omitted from the
147  fi  # detrailing.
148    
149  # These files are detrailed and copied; do not detrail the test data  files="\
150  # because there may be significant trailing spaces. The configure files    Makefile.am \
151  # are also omitted from the detrailing.    Makefile.in \
152      configure.ac \
153  files="Makefile.in configure.ac config.h.in \    README \
154    README LICENCE COPYING AUTHORS NEWS NON-UNIX-USE INSTALL ChangeLog \    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      RunGrepTest \
166      RunTest \
167      RunTest.bat \
168    pcre-config.in \    pcre-config.in \
169    libpcre.pc.in \    libpcre.pc.in \
170      libpcreposix.pc.in \
171    libpcrecpp.pc.in \    libpcrecpp.pc.in \
172      config.h.in \
173    pcre_printint.src \    pcre_printint.src \
174      pcre_chartables.c.dist \
175    pcredemo.c \    pcredemo.c \
176    pcregrep.c \    pcregrep.c \
177    pcretest.c \    pcretest.c \
178    dftables.c \    dftables.c \
179    pcreposix.c \    pcreposix.c \
180    pcreposix.h \    pcreposix.h \
181    pcre.h \    pcre.h.in \
182    pcre_internal.h    pcre_internal.h
183    pcre_compile.c \    pcre_compile.c \
184    pcre_config.c \    pcre_config.c \
# Line 152  files="Makefile.in configure.ac config.h Line 214  files="Makefile.in configure.ac config.h
214    ucpinternal.h \    ucpinternal.h \
215    ucptable.h \    ucptable.h \
216    makevp.bat \    makevp.bat \
   RunTest.bat \  
217    pcre.def \    pcre.def \
218    libpcre.def \    libpcre.def \
219    libpcreposix.def"    libpcreposix.def"
220    
 docfiles="doc/Tech.Notes doc/p*"  
   
221  echo Detrailing  echo Detrailing
222  ./maintain/Detrail $files doc/p* doc/html/*  ./Detrail $files doc/p* doc/html/*
223    
224  echo Building release  echo Doing basic configure to get default pcre.h and config.h
225  echo " "  # 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    echo Converting pcre.h and config.h to generic forms
230    cp -f pcre.h pcre.h.generic
231    
232    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    
252  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  
253    
254  #End  #End

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

  ViewVC Help
Powered by ViewVC 1.1.5