| 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". It makes use of the |
| 8 |
fi |
# following files: |
| 9 |
|
|
| 10 |
# The name of the release directory |
# 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 |
dir=pcre-$1 |
# constructs that are used in the PCRE man pages. |
| 13 |
|
|
| 14 |
# But sometimes we just want to process the documentation |
# 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 |
if [ "$1" = "doconly" ] ; then |
# a readable .txt file. |
| 17 |
doconly=yes |
|
| 18 |
fi |
# Detrail A Perl script that removes trailing spaces from files. |
| 19 |
|
|
| 20 |
|
# doc/index.html.src |
| 21 |
|
# 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 |
|
|
| 25 |
|
|
| 26 |
# First, sort out the documentation |
# First, sort out the documentation |
| 46 |
|
|
| 47 |
echo "Making pcre.txt" |
echo "Making pcre.txt" |
| 48 |
for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \ |
for file in pcre pcrebuild pcrematching pcreapi pcrecallout pcrecompat \ |
| 49 |
pcrepattern pcrepartial pcreprecompile \ |
pcrepattern pcresyntax pcrepartial pcreprecompile \ |
| 50 |
pcreperform pcreposix pcrecpp pcresample pcrestack ; do |
pcreperform pcreposix pcrecpp pcresample pcrestack ; do |
| 51 |
echo " Processing $file.3" |
echo " Processing $file.3" |
| 52 |
nroff -c -man $file.3 >$file.rawtxt |
nroff -c -man $file.3 >$file.rawtxt |
| 53 |
../maintain/CleanTxt <$file.rawtxt >>pcre.txt |
../CleanTxt <$file.rawtxt >>pcre.txt |
| 54 |
/bin/rm $file.rawtxt |
/bin/rm $file.rawtxt |
| 55 |
echo "------------------------------------------------------------------------------" >>pcre.txt |
echo "------------------------------------------------------------------------------" >>pcre.txt |
| 56 |
if [ "$file" != "pcresample" ] ; then |
if [ "$file" != "pcresample" ] ; then |
| 59 |
fi |
fi |
| 60 |
done |
done |
| 61 |
|
|
| 62 |
# The two commands |
# The three commands |
| 63 |
for file in pcretest pcregrep ; do |
for file in pcretest pcregrep pcre-config ; do |
| 64 |
echo Making $file.txt |
echo Making $file.txt |
| 65 |
nroff -c -man $file.1 >$file.rawtxt |
nroff -c -man $file.1 >$file.rawtxt |
| 66 |
../maintain/CleanTxt <$file.rawtxt >$file.txt |
../CleanTxt <$file.rawtxt >$file.txt |
| 67 |
/bin/rm $file.rawtxt |
/bin/rm $file.rawtxt |
| 68 |
done |
done |
| 69 |
|
|
| 70 |
|
|
| 71 |
# Make HTML form of the documentation. |
# Make HTML form of the documentation. |
| 72 |
|
|
| 73 |
|
echo "Making HTML documentation" |
| 74 |
/bin/rm html/* |
/bin/rm html/* |
| 75 |
cp ../maintain/Index.html html/index.html |
cp index.html.src html/index.html |
| 76 |
|
|
| 77 |
for file in *.1 ; do |
for file in *.1 ; do |
| 78 |
base=`basename $file .1` |
base=`basename $file .1` |
| 79 |
echo Making $base.html |
echo " Making $base.html" |
| 80 |
../maintain/132html -toc $base <$file >html/$base.html |
../132html -toc $base <$file >html/$base.html |
| 81 |
done |
done |
| 82 |
|
|
| 83 |
# Exclude table of contents for function summaries. It seems that expr |
# Exclude table of contents for function summaries. It seems that expr |
| 93 |
[ "$base" = "pcreperform" ] ; then |
[ "$base" = "pcreperform" ] ; then |
| 94 |
toc="" |
toc="" |
| 95 |
fi |
fi |
| 96 |
echo Making $base.html |
echo " Making $base.html" |
| 97 |
../maintain/132html $toc $base <$file >html/$base.html |
../132html $toc $base <$file >html/$base.html |
| 98 |
|
if [ $? != 0 ] ; then exit 1; fi |
| 99 |
done |
done |
| 100 |
|
|
| 101 |
# End of documentation processing |
# End of documentation processing |
| 103 |
cd .. |
cd .. |
| 104 |
echo Documentation done |
echo Documentation done |
| 105 |
|
|
| 106 |
if [ "$doconly" = "yes" ] ; then |
# These files are detrailed; do not detrail the test data because there may be |
| 107 |
exit 0 |
# significant trailing spaces. The configure files are also omitted from the |
| 108 |
fi |
# detrailing. |
| 109 |
|
|
| 110 |
# These files are detrailed and copied; do not detrail the test data |
files="\ |
| 111 |
# because there may be significant trailing spaces. The configure files |
Makefile.am \ |
| 112 |
# are also omitted from the detrailing. |
Makefile.in \ |
| 113 |
|
configure.ac \ |
| 114 |
files="Makefile.in configure.ac config.h.in \ |
README \ |
| 115 |
README LICENCE COPYING AUTHORS NEWS NON-UNIX-USE INSTALL ChangeLog \ |
LICENCE \ |
| 116 |
|
COPYING \ |
| 117 |
|
AUTHORS \ |
| 118 |
|
NEWS \ |
| 119 |
|
NON-UNIX-USE \ |
| 120 |
|
INSTALL \ |
| 121 |
|
132html \ |
| 122 |
|
CleanTxt \ |
| 123 |
|
Detrail \ |
| 124 |
|
ChangeLog \ |
| 125 |
|
CMakeLists.txt \ |
| 126 |
|
RunGrepTest \ |
| 127 |
|
RunTest \ |
| 128 |
|
RunTest.bat \ |
| 129 |
pcre-config.in \ |
pcre-config.in \ |
| 130 |
libpcre.pc.in \ |
libpcre.pc.in \ |
| 131 |
libpcrecpp.pc.in \ |
libpcrecpp.pc.in \ |
| 132 |
|
config.h \ |
| 133 |
|
config.h.in \ |
| 134 |
pcre_printint.src \ |
pcre_printint.src \ |
| 135 |
|
pcre_chartables.c.dist \ |
| 136 |
pcredemo.c \ |
pcredemo.c \ |
| 137 |
pcregrep.c \ |
pcregrep.c \ |
| 138 |
pcretest.c \ |
pcretest.c \ |
| 140 |
pcreposix.c \ |
pcreposix.c \ |
| 141 |
pcreposix.h \ |
pcreposix.h \ |
| 142 |
pcre.h \ |
pcre.h \ |
| 143 |
|
pcre.h.in \ |
| 144 |
pcre_internal.h |
pcre_internal.h |
| 145 |
pcre_compile.c \ |
pcre_compile.c \ |
| 146 |
pcre_config.c \ |
pcre_config.c \ |
| 176 |
ucpinternal.h \ |
ucpinternal.h \ |
| 177 |
ucptable.h \ |
ucptable.h \ |
| 178 |
makevp.bat \ |
makevp.bat \ |
|
RunTest.bat \ |
|
| 179 |
pcre.def \ |
pcre.def \ |
| 180 |
libpcre.def \ |
libpcre.def \ |
| 181 |
libpcreposix.def" |
libpcreposix.def" |
| 182 |
|
|
|
docfiles="doc/Tech.Notes doc/p*" |
|
|
|
|
| 183 |
echo Detrailing |
echo Detrailing |
| 184 |
./maintain/Detrail $files doc/p* doc/html/* |
./Detrail $files doc/p* doc/html/* |
| 185 |
|
|
| 186 |
echo Building release |
echo Doing basic configure to get default pcre.h and config.h |
| 187 |
echo " " |
# This is in case the caller has set aliases (as I do - PH) |
| 188 |
|
unset cp ls mv rm |
| 189 |
|
./configure >/dev/null |
| 190 |
|
|
| 191 |
|
echo Converting pcre.h and config.h to generic forms |
| 192 |
|
cp -f pcre.h pcre.h.generic |
| 193 |
|
|
| 194 |
|
perl <<'END' |
| 195 |
|
open(IN, "<config.h") || die "Can't open config.h: $!\n"; |
| 196 |
|
open(OUT, ">config.h.generic") || die "Can't open config.h.generic: $!\n"; |
| 197 |
|
while (<IN>) |
| 198 |
|
{ |
| 199 |
|
if (/^#define\s(?!PACKAGE)(\w+)/) |
| 200 |
|
{ |
| 201 |
|
print OUT "#ifndef $1\n"; |
| 202 |
|
print OUT; |
| 203 |
|
print OUT "#endif\n"; |
| 204 |
|
} |
| 205 |
|
else |
| 206 |
|
{ |
| 207 |
|
print OUT; |
| 208 |
|
} |
| 209 |
|
} |
| 210 |
|
close IN; |
| 211 |
|
close OUT; |
| 212 |
|
END |
| 213 |
|
|
| 214 |
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 |
|
| 215 |
|
|
| 216 |
#End |
#End |