Admin/makedist
author wenzelm
Fri May 28 18:20:58 1999 +0200 (1999-05-28)
changeset 6750 0681dd2211b5
parent 6748 f1f70344b749
child 6758 8fc15183f549
permissions -rwxr-xr-x
move pdfs back into dist;
wenzelm@3060
     1
#!/bin/bash
wenzelm@2667
     2
#
wenzelm@2667
     3
# $Id$
wenzelm@2667
     4
#
wenzelm@2667
     5
# makedist -- make Isabelle distribution.
wenzelm@2667
     6
wenzelm@2667
     7
wenzelm@2667
     8
## global settings
wenzelm@2667
     9
wenzelm@2829
    10
LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL Tools ZF"
wenzelm@2667
    11
wenzelm@5171
    12
CVSROOT=/usr/proj/isabelle-repository/archive
wenzelm@2667
    13
DISTBASE=~/tmp/isadist
wenzelm@2667
    14
wenzelm@2667
    15
wenzelm@2667
    16
## diagnostics
wenzelm@2667
    17
wenzelm@2667
    18
PRG=$(basename $0)
wenzelm@2667
    19
wenzelm@2667
    20
function usage()
wenzelm@2667
    21
{
wenzelm@2667
    22
  echo
wenzelm@2667
    23
  echo "Usage: $PRG VERSION"
wenzelm@2667
    24
  echo
wenzelm@2667
    25
  cat <<EOF
wenzelm@2667
    26
  Make Isabelle distribution from the master sources at TUM.
wenzelm@2667
    27
wenzelm@2667
    28
  VERSION may be either a tag like "Isabelle94-XX" that specifies the
wenzelm@2667
    29
  release to be exported from the repository, or "-" to checkout the
wenzelm@2667
    30
  current sources as an unofficial release.
wenzelm@2667
    31
wenzelm@2667
    32
  Checklist for official releases (before running this script):
wenzelm@2667
    33
wenzelm@5817
    34
    * Check release name and date in NEWS!
wenzelm@2668
    35
    * Check that README files are up to date (should have Id: lines).
wenzelm@5769
    36
    * Check Admin/index.html.
wenzelm@2970
    37
    * Make sure that encoding info is consistent (fixencoding)!
wenzelm@2667
    38
    * Make sure that the repository version of Doc is consistent
wenzelm@2667
    39
      (watch out for *.bbl, *.rao, *.ind)!
wenzelm@3186
    40
    * Check ML_SYSTEM defaults!
wenzelm@2667
    41
EOF
wenzelm@2667
    42
  #Wicked! We just won't tell other users ...
wenzelm@2667
    43
  if [ $LOGNAME = paulson -o $LOGNAME = nipkow -o $LOGNAME = wenzelm ]; then
wenzelm@2667
    44
    cat <<EOF
wenzelm@2667
    45
    * Tag the current repository version, e.g.:
wenzelm@4542
    46
        cvs -d $CVSROOT rtag Isabelle94-XX isabelle
wenzelm@2667
    47
      PLEASE DON'T DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
wenzelm@2667
    48
EOF
wenzelm@2667
    49
  fi
wenzelm@2667
    50
  cat <<EOF
wenzelm@2667
    51
wenzelm@2667
    52
  After the distribution has been created succesfully, you might want
wenzelm@2667
    53
  to run some makeall tests using different ML systems.
wenzelm@5727
    54
wenzelm@2667
    55
EOF
wenzelm@2667
    56
  exit 1
wenzelm@2667
    57
}
wenzelm@2667
    58
wenzelm@2667
    59
function fail()
wenzelm@2667
    60
{
wenzelm@2667
    61
  echo "$1" >&2
wenzelm@2667
    62
  exit 2
wenzelm@2667
    63
}
wenzelm@2667
    64
wenzelm@2667
    65
wenzelm@2667
    66
## process command line
wenzelm@2667
    67
wenzelm@2667
    68
[ $# -ne 1 ] && usage
wenzelm@2667
    69
wenzelm@2667
    70
VERSION="$1"
wenzelm@2667
    71
shift
wenzelm@2667
    72
wenzelm@2667
    73
wenzelm@2667
    74
## main
wenzelm@2667
    75
wenzelm@2667
    76
# dist version
wenzelm@2667
    77
wenzelm@2667
    78
DATE=$(date "+%d-%b-%Y")
wenzelm@4979
    79
DISTDATE=$(date "+%B %Y")
wenzelm@2667
    80
wenzelm@2667
    81
if [ "$VERSION" = "-" ]; then
wenzelm@2667
    82
  DISTNAME=Isabelle_$DATE
wenzelm@4982
    83
  DISTVERSION="$DISTNAME"
wenzelm@3363
    84
  EXPORT="checkout -P"
wenzelm@2667
    85
  UNOFFICIAL=true
wenzelm@2667
    86
else
wenzelm@2667
    87
  DISTNAME="$VERSION"
wenzelm@4982
    88
  DISTVERSION="$DISTNAME: $DISTDATE"
wenzelm@2667
    89
  EXPORT="export -r $VERSION"
wenzelm@2667
    90
  UNOFFICIAL=""
wenzelm@2667
    91
fi
wenzelm@2667
    92
wenzelm@2667
    93
mkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"
wenzelm@2667
    94
[ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"
wenzelm@6748
    95
[ -e $DISTBASE/pdf/$DISTNAME ] && fail "$DISTBASE/pdf/$DISTNAME already exists!"
wenzelm@2667
    96
wenzelm@2667
    97
wenzelm@2667
    98
# export from repository
wenzelm@2667
    99
wenzelm@2667
   100
echo
wenzelm@2667
   101
echo "Exporting $DISTNAME from repository. Please be patient ..."
wenzelm@2667
   102
echo
wenzelm@2667
   103
wenzelm@2667
   104
cd $DISTBASE
wenzelm@2667
   105
wenzelm@2667
   106
export CVSROOT
wenzelm@3363
   107
cvs -f -q $EXPORT -d $DISTNAME isabelle
wenzelm@5622
   108
find . -name CVS -exec rm -rf {} \;
wenzelm@2667
   109
wenzelm@2667
   110
wenzelm@2667
   111
# make docs
wenzelm@2667
   112
wenzelm@3169
   113
cd $DISTBASE/$DISTNAME/Doc
wenzelm@6630
   114
PDFLATEX=$(type -path pdflatex)
wenzelm@3169
   115
wenzelm@3169
   116
for DOC in $(cat Contents)
wenzelm@2667
   117
do
wenzelm@3169
   118
  cd $DOC
wenzelm@6630
   119
  make dvi
wenzelm@6630
   120
  [ -n "$PDFLATEX" ] && make clean pdf
wenzelm@3169
   121
  cd ..
wenzelm@2667
   122
done
wenzelm@2667
   123
wenzelm@2667
   124
wenzelm@2667
   125
# prepare dist dir for release
wenzelm@2667
   126
wenzelm@2667
   127
cd $DISTBASE/$DISTNAME
wenzelm@2667
   128
wenzelm@6630
   129
MOVE=$(find Doc \( -type f -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) \) \
wenzelm@6630
   130
  | grep -v 'gfx/.*pdf')
wenzelm@6630
   131
mv -f $MOVE Distribution/doc
wenzelm@3305
   132
rm Distribution/doc/Isa-logics.eps
wenzelm@4549
   133
cp Admin/index.html $DISTBASE
wenzelm@3099
   134
rm -rf Admin Doc
wenzelm@2667
   135
wenzelm@2667
   136
mkdir src
wenzelm@2667
   137
mv $LOGICS src
wenzelm@2667
   138
wenzelm@2667
   139
mv Distribution/* .
wenzelm@2667
   140
rmdir Distribution
wenzelm@2667
   141
wenzelm@4180
   142
( cd lib/browser; make; )
berghofe@3638
   143
wenzelm@5385
   144
cp doc/isabelle*.eps lib/logo
wenzelm@5385
   145
berghofe@3638
   146
wenzelm@2667
   147
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   148
  {
wenzelm@2667
   149
    echo
wenzelm@2667
   150
    echo "IMPORTANT NOTE"
wenzelm@2667
   151
    echo "=============="
wenzelm@2667
   152
    echo
wenzelm@2667
   153
    echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   154
    echo
wenzelm@2667
   155
  } >UNOFFICIAL
wenzelm@2667
   156
fi
wenzelm@2667
   157
wenzelm@6304
   158
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index1.html lib/html/index2.html
wenzelm@4986
   159
perl -pi -e "s/Isabelle repository/$DISTVERSION/" src/Pure/ROOT.ML
wenzelm@4986
   160
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
wenzelm@3257
   161
lynx -dump README.html >README
wenzelm@3257
   162
wenzelm@2667
   163
wenzelm@2667
   164
# create archive
wenzelm@2667
   165
wenzelm@2667
   166
cd $DISTBASE
wenzelm@2667
   167
wenzelm@2794
   168
chown -R $LOGNAME:isabelle $DISTNAME
wenzelm@2794
   169
chmod -R u+w $DISTNAME
wenzelm@2667
   170
wenzelm@6748
   171
TAR=tar
wenzelm@6748
   172
type -path gtar >/dev/null && TAR=gtar
wenzelm@2667
   173
wenzelm@6748
   174
mkdir -p pdf/$DISTNAME/doc
wenzelm@6748
   175
mv $DISTNAME/doc/*.pdf pdf/$DISTNAME/doc
wenzelm@6748
   176
wenzelm@6748
   177
$TAR cf $DISTNAME.tar $DISTNAME
wenzelm@6748
   178
( cd pdf; $TAR cf ../${DISTNAME}_pdf.tar $DISTNAME; )
wenzelm@6748
   179
wenzelm@6750
   180
mv pdf/$DISTNAME/doc/*.pdf $DISTNAME/doc
wenzelm@6750
   181
rmdir pdf/$DISTNAME/doc pdf/$DISTNAME
wenzelm@6750
   182
wenzelm@6748
   183
UNPACKED_SIZE=$[ $(cat $DISTNAME.tar ${DISTNAME}_pdf.tar | wc -c) / 1024 ]
wenzelm@4549
   184
wenzelm@4549
   185
gzip $DISTNAME.tar
wenzelm@6748
   186
gzip ${DISTNAME}_pdf.tar
wenzelm@4549
   187
wenzelm@4549
   188
PACKED_SIZE=$[ $(wc -c <$DISTNAME.tar.gz) / 1024 ]
wenzelm@6748
   189
PACKED_SIZE_PDF=$[ $(wc -c <${DISTNAME}_pdf.tar.gz) / 1024 ]
wenzelm@4549
   190
wenzelm@4549
   191
wenzelm@6304
   192
# prepare dist index.html
wenzelm@6304
   193
wenzelm@6304
   194
perl -pi -e \
wenzelm@6304
   195
 "s/{ISABELLE}/$DISTNAME/g; \
wenzelm@6304
   196
  s/{PACKED_SIZE}/$PACKED_SIZE/g; \
wenzelm@6748
   197
  s/{PACKED_SIZE_PDF}/$PACKED_SIZE_PDF/g; \
wenzelm@6304
   198
  s/{UNPACKED_SIZE}/$UNPACKED_SIZE/g; \
wenzelm@6304
   199
  s/{AUTHOR}/$LOGNAME/g; \
wenzelm@6304
   200
  s/{DATE}/$DATE/g;" \
wenzelm@6304
   201
    index.html
wenzelm@6304
   202
wenzelm@6304
   203
wenzelm@2667
   204
# final note
wenzelm@2667
   205
wenzelm@2667
   206
echo
wenzelm@2667
   207
echo "That's it. You'll find the distribution in $DISTBASE."
wenzelm@2667
   208
echo