Admin/makedist
author wenzelm
Fri May 05 22:24:03 2000 +0200 (2000-05-05)
changeset 8810 d0eae42f6d12
parent 8059 9128e934bf51
child 9052 7db48fe85b05
permissions -rwxr-xr-x
removed index2;
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@2667
    13
DISTBASE=~/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@2667
    92
mkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"
wenzelm@2667
    93
[ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"
wenzelm@6748
    94
[ -e $DISTBASE/pdf/$DISTNAME ] && fail "$DISTBASE/pdf/$DISTNAME already exists!"
wenzelm@2667
    95
wenzelm@2667
    96
wenzelm@2667
    97
# export from repository
wenzelm@2667
    98
wenzelm@2667
    99
echo
wenzelm@2667
   100
echo "Exporting $DISTNAME from repository. Please be patient ..."
wenzelm@2667
   101
echo
wenzelm@2667
   102
wenzelm@2667
   103
cd $DISTBASE
wenzelm@2667
   104
wenzelm@2667
   105
export CVSROOT
wenzelm@3363
   106
cvs -f -q $EXPORT -d $DISTNAME isabelle
wenzelm@5622
   107
find . -name CVS -exec rm -rf {} \;
wenzelm@2667
   108
wenzelm@2667
   109
wenzelm@2667
   110
# make docs
wenzelm@2667
   111
wenzelm@3169
   112
cd $DISTBASE/$DISTNAME/Doc
wenzelm@6630
   113
PDFLATEX=$(type -path pdflatex)
wenzelm@3169
   114
wenzelm@3169
   115
for DOC in $(cat Contents)
wenzelm@2667
   116
do
wenzelm@3169
   117
  cd $DOC
wenzelm@6630
   118
  make dvi
wenzelm@6630
   119
  [ -n "$PDFLATEX" ] && make clean pdf
wenzelm@3169
   120
  cd ..
wenzelm@2667
   121
done
wenzelm@2667
   122
kleing@8059
   123
# make web pages
kleing@8059
   124
kleing@8059
   125
export DISTNAME
kleing@8059
   126
(cd $DISTBASE/$DISTNAME/Admin/page; make clean; make dist; cd dist; cp * $DISTBASE)
kleing@8059
   127
wenzelm@2667
   128
wenzelm@2667
   129
# prepare dist dir for release
wenzelm@2667
   130
wenzelm@2667
   131
cd $DISTBASE/$DISTNAME
wenzelm@2667
   132
wenzelm@6758
   133
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
   134
mv -f $MOVE Distribution/doc
wenzelm@3305
   135
rm Distribution/doc/Isa-logics.eps
wenzelm@7781
   136
rm -rf Admin Doc Tools
wenzelm@2667
   137
wenzelm@7115
   138
mkdir src contrib
wenzelm@2667
   139
mv $LOGICS src
wenzelm@2667
   140
wenzelm@2667
   141
mv Distribution/* .
wenzelm@2667
   142
rmdir Distribution
wenzelm@2667
   143
wenzelm@4180
   144
( cd lib/browser; make; )
berghofe@3638
   145
wenzelm@5385
   146
cp doc/isabelle*.eps lib/logo
wenzelm@5385
   147
berghofe@3638
   148
wenzelm@2667
   149
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   150
  {
wenzelm@2667
   151
    echo
wenzelm@2667
   152
    echo "IMPORTANT NOTE"
wenzelm@2667
   153
    echo "=============="
wenzelm@2667
   154
    echo
wenzelm@2667
   155
    echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   156
    echo
wenzelm@2667
   157
  } >UNOFFICIAL
wenzelm@2667
   158
fi
wenzelm@2667
   159
wenzelm@8810
   160
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html
wenzelm@4986
   161
perl -pi -e "s/Isabelle repository/$DISTVERSION/" src/Pure/ROOT.ML
wenzelm@4986
   162
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
wenzelm@3257
   163
lynx -dump README.html >README
wenzelm@3257
   164
wenzelm@2667
   165
wenzelm@2667
   166
# create archive
wenzelm@2667
   167
wenzelm@2667
   168
cd $DISTBASE
wenzelm@2667
   169
wenzelm@2794
   170
chown -R $LOGNAME:isabelle $DISTNAME
wenzelm@2794
   171
chmod -R u+w $DISTNAME
wenzelm@2667
   172
wenzelm@6748
   173
TAR=tar
wenzelm@6748
   174
type -path gtar >/dev/null && TAR=gtar
wenzelm@2667
   175
wenzelm@6748
   176
mkdir -p pdf/$DISTNAME/doc
wenzelm@6748
   177
mv $DISTNAME/doc/*.pdf pdf/$DISTNAME/doc
wenzelm@6748
   178
wenzelm@6748
   179
$TAR cf $DISTNAME.tar $DISTNAME
wenzelm@6748
   180
( cd pdf; $TAR cf ../${DISTNAME}_pdf.tar $DISTNAME; )
wenzelm@6748
   181
wenzelm@6750
   182
mv pdf/$DISTNAME/doc/*.pdf $DISTNAME/doc
wenzelm@6958
   183
rmdir pdf/$DISTNAME/doc pdf/$DISTNAME pdf
wenzelm@6750
   184
wenzelm@4549
   185
gzip $DISTNAME.tar
wenzelm@6748
   186
gzip ${DISTNAME}_pdf.tar
wenzelm@4549
   187
wenzelm@6304
   188
kleing@8059
   189
# prepare web pages
kleing@8059
   190
kleing@8059
   191
$THIS/filesizes -norpm
wenzelm@6304
   192
wenzelm@6304
   193
wenzelm@2667
   194
# final note
wenzelm@2667
   195
wenzelm@2667
   196
echo
wenzelm@2667
   197
echo "That's it. You'll find the distribution in $DISTBASE."
wenzelm@2667
   198
echo