Admin/makedist
author wenzelm
Wed Jun 07 14:20:16 2000 +0200 (2000-06-07)
changeset 9052 7db48fe85b05
parent 8810 d0eae42f6d12
child 9782 63b195acdaaa
permissions -rwxr-xr-x
provide TAGS file for Isabelle sources;
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@7993
    10
LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL ZF"
wenzelm@2667
    11
wenzelm@5171
    12
CVSROOT=/usr/proj/isabelle-repository/archive
wenzelm@9052
    13
DISTPREFIX=~/tmp/isadist
wenzelm@2667
    14
wenzelm@2667
    15
wenzelm@2667
    16
## diagnostics
wenzelm@2667
    17
wenzelm@2667
    18
PRG=$(basename $0)
kleing@8059
    19
THIS=$(cd $(dirname "$0"); echo $PWD)
wenzelm@2667
    20
wenzelm@2667
    21
function usage()
wenzelm@2667
    22
{
wenzelm@2667
    23
  echo
wenzelm@2667
    24
  echo "Usage: $PRG VERSION"
wenzelm@2667
    25
  echo
wenzelm@2667
    26
  cat <<EOF
wenzelm@2667
    27
  Make Isabelle distribution from the master sources at TUM.
wenzelm@2667
    28
wenzelm@2667
    29
  VERSION may be either a tag like "Isabelle94-XX" that specifies the
wenzelm@2667
    30
  release to be exported from the repository, or "-" to checkout the
wenzelm@2667
    31
  current sources as an unofficial release.
wenzelm@2667
    32
wenzelm@2667
    33
  Checklist for official releases (before running this script):
wenzelm@2667
    34
wenzelm@5817
    35
    * Check release name and date in NEWS!
wenzelm@2668
    36
    * Check that README files are up to date (should have Id: lines).
wenzelm@5769
    37
    * Check Admin/index.html.
wenzelm@2970
    38
    * Make sure that encoding info is consistent (fixencoding)!
wenzelm@3186
    39
    * Check ML_SYSTEM defaults!
wenzelm@2667
    40
EOF
wenzelm@2667
    41
  #Wicked! We just won't tell other users ...
wenzelm@7859
    42
  if [ $LOGNAME = paulson -o $LOGNAME = nipkow -o $LOGNAME = wenzelm -o $LOGNAME = berghofe ]; then
wenzelm@2667
    43
    cat <<EOF
wenzelm@2667
    44
    * Tag the current repository version, e.g.:
wenzelm@4542
    45
        cvs -d $CVSROOT rtag Isabelle94-XX isabelle
wenzelm@2667
    46
      PLEASE DON'T DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
wenzelm@2667
    47
EOF
wenzelm@2667
    48
  fi
wenzelm@2667
    49
  cat <<EOF
wenzelm@2667
    50
wenzelm@2667
    51
  After the distribution has been created succesfully, you might want
wenzelm@2667
    52
  to run some makeall tests using different ML systems.
wenzelm@5727
    53
wenzelm@2667
    54
EOF
wenzelm@2667
    55
  exit 1
wenzelm@2667
    56
}
wenzelm@2667
    57
wenzelm@2667
    58
function fail()
wenzelm@2667
    59
{
wenzelm@2667
    60
  echo "$1" >&2
wenzelm@2667
    61
  exit 2
wenzelm@2667
    62
}
wenzelm@2667
    63
wenzelm@2667
    64
wenzelm@2667
    65
## process command line
wenzelm@2667
    66
wenzelm@2667
    67
[ $# -ne 1 ] && usage
wenzelm@2667
    68
wenzelm@2667
    69
VERSION="$1"
wenzelm@2667
    70
shift
wenzelm@2667
    71
wenzelm@2667
    72
wenzelm@2667
    73
## main
wenzelm@2667
    74
wenzelm@2667
    75
# dist version
wenzelm@2667
    76
wenzelm@2667
    77
DATE=$(date "+%d-%b-%Y")
wenzelm@4979
    78
DISTDATE=$(date "+%B %Y")
wenzelm@2667
    79
wenzelm@2667
    80
if [ "$VERSION" = "-" ]; then
wenzelm@2667
    81
  DISTNAME=Isabelle_$DATE
wenzelm@4982
    82
  DISTVERSION="$DISTNAME"
wenzelm@3363
    83
  EXPORT="checkout -P"
wenzelm@2667
    84
  UNOFFICIAL=true
wenzelm@2667
    85
else
wenzelm@2667
    86
  DISTNAME="$VERSION"
wenzelm@4982
    87
  DISTVERSION="$DISTNAME: $DISTDATE"
wenzelm@2667
    88
  EXPORT="export -r $VERSION"
wenzelm@2667
    89
  UNOFFICIAL=""
wenzelm@2667
    90
fi
wenzelm@2667
    91
wenzelm@9052
    92
DISTBASE=$DISTPREFIX/dist-$DISTNAME
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@9052
   124
wenzelm@9052
   125
# make WWW pages
kleing@8059
   126
kleing@8059
   127
export DISTNAME
kleing@8059
   128
(cd $DISTBASE/$DISTNAME/Admin/page; make clean; make dist; cd dist; cp * $DISTBASE)
kleing@8059
   129
wenzelm@2667
   130
wenzelm@2667
   131
# prepare dist dir for release
wenzelm@2667
   132
wenzelm@2667
   133
cd $DISTBASE/$DISTNAME
wenzelm@2667
   134
wenzelm@6758
   135
MOVE=$(find Doc \( -type f -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf')
wenzelm@6630
   136
mv -f $MOVE Distribution/doc
wenzelm@3305
   137
rm Distribution/doc/Isa-logics.eps
wenzelm@9052
   138
rm -rf Doc Tools
wenzelm@2667
   139
wenzelm@7115
   140
mkdir src contrib
wenzelm@2667
   141
mv $LOGICS src
wenzelm@2667
   142
wenzelm@2667
   143
mv Distribution/* .
wenzelm@2667
   144
rmdir Distribution
wenzelm@2667
   145
wenzelm@4180
   146
( cd lib/browser; make; )
berghofe@3638
   147
wenzelm@5385
   148
cp doc/isabelle*.eps lib/logo
wenzelm@5385
   149
berghofe@3638
   150
wenzelm@2667
   151
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   152
  {
wenzelm@2667
   153
    echo
wenzelm@2667
   154
    echo "IMPORTANT NOTE"
wenzelm@2667
   155
    echo "=============="
wenzelm@2667
   156
    echo
wenzelm@2667
   157
    echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   158
    echo
wenzelm@2667
   159
  } >UNOFFICIAL
wenzelm@2667
   160
fi
wenzelm@2667
   161
wenzelm@8810
   162
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html
wenzelm@4986
   163
perl -pi -e "s/Isabelle repository/$DISTVERSION/" src/Pure/ROOT.ML
wenzelm@4986
   164
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
wenzelm@3257
   165
lynx -dump README.html >README
wenzelm@3257
   166
wenzelm@9052
   167
( cd src; ../Admin/maketags; )
wenzelm@9052
   168
rm -rf Admin
wenzelm@9052
   169
wenzelm@2667
   170
wenzelm@2667
   171
# create archive
wenzelm@2667
   172
wenzelm@2667
   173
cd $DISTBASE
wenzelm@2667
   174
wenzelm@2794
   175
chown -R $LOGNAME:isabelle $DISTNAME
wenzelm@2794
   176
chmod -R u+w $DISTNAME
wenzelm@2667
   177
wenzelm@6748
   178
TAR=tar
wenzelm@6748
   179
type -path gtar >/dev/null && TAR=gtar
wenzelm@2667
   180
wenzelm@6748
   181
mkdir -p pdf/$DISTNAME/doc
wenzelm@6748
   182
mv $DISTNAME/doc/*.pdf pdf/$DISTNAME/doc
wenzelm@6748
   183
wenzelm@6748
   184
$TAR cf $DISTNAME.tar $DISTNAME
wenzelm@6748
   185
( cd pdf; $TAR cf ../${DISTNAME}_pdf.tar $DISTNAME; )
wenzelm@6748
   186
wenzelm@6750
   187
mv pdf/$DISTNAME/doc/*.pdf $DISTNAME/doc
wenzelm@6958
   188
rmdir pdf/$DISTNAME/doc pdf/$DISTNAME pdf
wenzelm@6750
   189
wenzelm@4549
   190
gzip $DISTNAME.tar
wenzelm@6748
   191
gzip ${DISTNAME}_pdf.tar
wenzelm@4549
   192
wenzelm@6304
   193
kleing@8059
   194
# prepare web pages
kleing@8059
   195
kleing@8059
   196
$THIS/filesizes -norpm
wenzelm@6304
   197
wenzelm@6304
   198
wenzelm@2667
   199
# final note
wenzelm@2667
   200
wenzelm@2667
   201
echo
wenzelm@2667
   202
echo "That's it. You'll find the distribution in $DISTBASE."
wenzelm@2667
   203
echo