"Fossies" - the Fresh Open Source Software Archive

Member "vfu-4.18/vslib/pcre2/pcre2-10.20/PrepareRelease" (25 Oct 2014, 6957 Bytes) of package /linux/privat/vfu-4.18.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #/bin/sh
    2 
    3 # Script to prepare the files for building a PCRE2 release. It does some
    4 # processing of the documentation, detrails files, and creates pcre2.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". 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 
   11 # 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 PCRE2
   13 #             man pages.
   14 
   15 # CheckMan    A Perl script that checks man pages for typos in the mark up.
   16 
   17 # 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 # Detrail     A Perl script that removes trailing spaces from files.
   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 # README & NON-AUTOTOOLS-BUILD
   29 #             These files are copied into the doc/html directory, with .txt
   30 #             extensions so that they can by hyperlinked from the HTML
   31 #             documentation, because some people just go to the HTML without
   32 #             looking for text files.
   33 
   34 
   35 # First, sort out the documentation. Remove pcre2demo.3 first because it won't
   36 # pass the markup check (it is created below, using markup that none of the
   37 # other pages use).
   38 
   39 cd doc
   40 echo Processing documentation
   41 
   42 /bin/rm -f pcre2demo.3
   43 
   44 # Check the remaining man pages
   45 
   46 perl ../CheckMan *.1 *.3
   47 if [ $? != 0 ] ; then exit 1; fi
   48 
   49 # Make Text form of the documentation. It needs some mangling to make it
   50 # tidy for online reading. Concatenate all the .3 stuff, but omit the
   51 # individual function pages.
   52 
   53 cat <<End >pcre2.txt
   54 -----------------------------------------------------------------------------
   55 This file contains a concatenation of the PCRE2 man pages, converted to plain
   56 text format for ease of searching with a text editor, or for use on systems
   57 that do not have a man page processor. The small individual files that give
   58 synopses of each function in the library have not been included. Neither has
   59 the pcre2demo program. There are separate text files for the pcre2grep and
   60 pcre2test commands.
   61 -----------------------------------------------------------------------------
   62 
   63 
   64 End
   65 
   66 echo "Making pcre2.txt"
   67 for file in pcre2 pcre2api pcre2build pcre2callout pcre2compat pcre2jit \
   68             pcre2limits pcre2matching pcre2partial pcre2unicode ; do
   69 
   70 #for file in  \
   71 #            pcre2syntax \
   72 #            pcre2precompile pcre2perform pcre2posix pcre2sample \
   73 #            pcre2stack ; do
   74 
   75   echo "  Processing $file.3"
   76   nroff -c -man $file.3 >$file.rawtxt
   77   perl ../CleanTxt <$file.rawtxt >>pcre2.txt
   78   /bin/rm $file.rawtxt
   79   echo "------------------------------------------------------------------------------" >>pcre2.txt
   80   if [ "$file" != "pcre2sample" ] ; then
   81     echo " " >>pcre2.txt
   82     echo " " >>pcre2.txt
   83   fi
   84 done
   85 
   86 # The three commands
   87 for file in pcre2test pcre2grep pcre2-config ; do
   88   echo Making $file.txt
   89   nroff -c -man $file.1 >$file.rawtxt
   90   perl ../CleanTxt <$file.rawtxt >$file.txt
   91   /bin/rm $file.rawtxt
   92 done
   93 
   94 
   95 # Make pcre2demo.3 from the pcre2demo.c source file
   96 
   97 echo "Making pcre2demo.3"
   98 perl <<"END" >pcre2demo.3
   99   open(IN, "../src/pcre2demo.c") || die "Failed to open src/pcre2demo.c\n";
  100   open(OUT, ">pcre2demo.3") || die "Failed to open pcre2demo.3\n";
  101   print OUT ".\\\" Start example.\n" .
  102             ".de EX\n" .
  103             ".  nr mE \\\\n(.f\n" .
  104             ".  nf\n" .
  105             ".  nh\n" .
  106             ".  ft CW\n" .
  107             "..\n" .
  108             ".\n" .
  109             ".\n" .
  110             ".\\\" End example.\n" .
  111             ".de EE\n" .
  112             ".  ft \\\\n(mE\n" .
  113             ".  fi\n" .
  114             ".  hy \\\\n(HY\n" .
  115             "..\n" .
  116             ".\n" .
  117             ".EX\n" ;
  118   while (<IN>)
  119     {
  120     s/\\/\\e/g;
  121     print OUT;
  122     }
  123   print OUT ".EE\n";
  124   close(IN);
  125   close(OUT);
  126 END
  127 if [ $? != 0 ] ; then exit 1; fi
  128 
  129 
  130 # Make HTML form of the documentation.
  131 
  132 echo "Making HTML documentation"
  133 /bin/rm html/*
  134 cp index.html.src html/index.html
  135 cp ../README html/README.txt
  136 cp ../NON-AUTOTOOLS-BUILD html/NON-AUTOTOOLS-BUILD.txt
  137 
  138 for file in *.1 ; do
  139   base=`basename $file .1`
  140   echo "  Making $base.html"
  141   perl ../132html -toc $base <$file >html/$base.html
  142 done
  143 
  144 # Exclude table of contents for function summaries. It seems that expr
  145 # forces an anchored regex. Also exclude them for small pages that have
  146 # only one section.
  147 
  148 for file in *.3 ; do
  149   base=`basename $file .3`
  150   toc=-toc
  151   if [ `expr $base : '.*_'` -ne 0 ] ; then toc="" ; fi
  152   if [ "$base" = "pcre2sample" ]  || \
  153      [ "$base" = "pcre2stack" ]   || \
  154      [ "$base" = "pcre2compat" ]  || \
  155      [ "$base" = "pcre2limits" ]  || \
  156      [ "$base" = "pcre2perform" ] || \
  157      [ "$base" = "pcre2unicode" ] ; then
  158     toc=""
  159   fi
  160   echo "  Making $base.html"
  161   perl ../132html $toc $base <$file >html/$base.html
  162   if [ $? != 0 ] ; then exit 1; fi
  163 done
  164 
  165 # End of documentation processing; stop if only documentation required.
  166 
  167 cd ..
  168 echo Documentation done
  169 if [ "$1" = "doc" ] ; then exit; fi
  170 
  171 # These files are detrailed; do not detrail the test data because there may be
  172 # significant trailing spaces. Do not detrail RunTest.bat, because it has CRLF
  173 # line endings and the detrail script removes all trailing white space. The
  174 # configure files are also omitted from the detrailing.
  175 
  176 files="\
  177   Makefile.am \
  178   configure.ac \
  179   README \
  180   LICENCE \
  181   COPYING \
  182   AUTHORS \
  183   NEWS \
  184   NON-AUTOTOOLS-BUILD \
  185   INSTALL \
  186   132html \
  187   CleanTxt \
  188   Detrail \
  189   ChangeLog \
  190   CMakeLists.txt \
  191   RunGrepTest \
  192   RunTest \
  193   pcre2-config.in \
  194   perltest.sh \
  195   libpcre2-8.pc.in \
  196   libpcre2-16.pc.in \
  197   libpcre2-32.pc.in \
  198   libpcre2-posix.pc.in \
  199   src/dftables.c \
  200   src/pcre2.h.in \
  201   src/pcre2_auto_possess.c \
  202   src/pcre2_compile.c \
  203   src/pcre2_config.c \
  204   src/pcre2_context.c \
  205   src/pcre2_dfa_match.c \
  206   src/pcre2_error.c \
  207   src/pcre2_internal.h \
  208   src/pcre2_intmodedep.h \
  209   src/pcre2_jit_compile.c \
  210   src/pcre2_jit_match.c \
  211   src/pcre2_jit_misc.c \
  212   src/pcre2_jit_test.c \
  213   src/pcre2_maketables.c \
  214   src/pcre2_match.c \
  215   src/pcre2_match_data.c \
  216   src/pcre2_newline.c \
  217   src/pcre2_ord2utf.c \
  218   src/pcre2_pattern_info.c \
  219   src/pcre2_printint.c \
  220   src/pcre2_string_utils.c \
  221   src/pcre2_study.c \
  222   src/pcre2_substring.c \
  223   src/pcre2_tables.c \
  224   src/pcre2_ucd.c \
  225   src/pcre2_ucp.h \
  226   src/pcre2_valid_utf.c \
  227   src/pcre2_xclass.c \
  228   src/pcre2demo.c \
  229   src/pcre2grep.c \
  230   src/pcre2posix.c \
  231   src/pcre2posix.h \
  232   src/pcre2test.c"
  233 
  234 echo Detrailing
  235 perl ./Detrail $files doc/p* doc/html/*
  236 
  237 echo Done
  238 
  239 #End