Admin/makedist
author wenzelm
Tue Sep 05 18:53:42 2000 +0200 (2000-09-05)
changeset 9867 bf8300fa4238
parent 9797 49e55730eb7a
child 9876 a069795f1060
permissions -rwxr-xr-x
tuned;
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@9797
    12
export CVSROOT=/usr/proj/isabelle-repository/archive
wenzelm@9052
    13
DISTPREFIX=~/tmp/isadist
wenzelm@2667
    14
wenzelm@9797
    15
umask 022
wenzelm@9797
    16
wenzelm@2667
    17
wenzelm@2667
    18
## diagnostics
wenzelm@2667
    19
wenzelm@9797
    20
PRG=$(basename "$0")
wenzelm@9797
    21
THIS=$(cd $(dirname "$0"); echo "$PWD")
wenzelm@2667
    22
wenzelm@2667
    23
function usage()
wenzelm@2667
    24
{
wenzelm@9797
    25
  echo "###"
wenzelm@9797
    26
  echo "### Usage: $PRG VERSION"
wenzelm@9797
    27
  echo "###"
wenzelm@2667
    28
  cat <<EOF
wenzelm@2667
    29
  Make Isabelle distribution from the master sources at TUM.
wenzelm@2667
    30
wenzelm@9797
    31
  VERSION may be either a tag like "Isabelle99-XX" that specifies the
wenzelm@2667
    32
  release to be exported from the repository, or "-" to checkout the
wenzelm@9797
    33
  current sources as an unofficial release, or "--" to produce a
wenzelm@9797
    34
  tentative release from the present copy of the Isabelle repository.
wenzelm@2667
    35
wenzelm@2667
    36
  Checklist for official releases (before running this script):
wenzelm@2667
    37
wenzelm@5817
    38
    * Check release name and date in NEWS!
wenzelm@2668
    39
    * Check that README files are up to date (should have Id: lines).
wenzelm@5769
    40
    * Check Admin/index.html.
wenzelm@2667
    41
EOF
wenzelm@2667
    42
  #Wicked! We just won't tell other users ...
wenzelm@7859
    43
  if [ $LOGNAME = paulson -o $LOGNAME = nipkow -o $LOGNAME = wenzelm -o $LOGNAME = berghofe ]; then
wenzelm@2667
    44
    cat <<EOF
wenzelm@2667
    45
    * Tag the current repository version, e.g.:
wenzelm@9797
    46
        cvs -d $CVSROOT rtag Isabelle99-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@9797
    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@9797
    81
if [ "$VERSION" = "--" ]; then
wenzelm@9867
    82
  DISTNAME="Isabelle_${DATE}_test"
wenzelm@4982
    83
  DISTVERSION="$DISTNAME"
wenzelm@9797
    84
  EXPORT="$THIS/cvs-copy $THIS/.. $DISTNAME"
wenzelm@9797
    85
  UNOFFICIAL=""
wenzelm@9797
    86
elif [ "$VERSION" = "-" ]; then
wenzelm@9797
    87
  DISTNAME="Isabelle_$DATE"
wenzelm@9797
    88
  DISTVERSION="$DISTNAME"
wenzelm@9797
    89
  EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle"
wenzelm@2667
    90
  UNOFFICIAL=true
wenzelm@2667
    91
else
wenzelm@2667
    92
  DISTNAME="$VERSION"
wenzelm@4982
    93
  DISTVERSION="$DISTNAME: $DISTDATE"
wenzelm@9797
    94
  EXPORT="cvs -f -q export -r $VERSION -d $DISTNAME isabelle"
wenzelm@2667
    95
  UNOFFICIAL=""
wenzelm@2667
    96
fi
wenzelm@2667
    97
wenzelm@9797
    98
DISTBASE="$DISTPREFIX/dist-$DISTNAME"
wenzelm@9797
    99
mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!"
wenzelm@9797
   100
[ -e "$DISTBASE/$DISTNAME" ] && fail "$DISTBASE/$DISTNAME already exists!"
wenzelm@9797
   101
[ -e "$DISTBASE/pdf/$DISTNAME" ] && fail "$DISTBASE/pdf/$DISTNAME already exists!"
wenzelm@2667
   102
wenzelm@2667
   103
wenzelm@9797
   104
# export repository
wenzelm@2667
   105
wenzelm@9797
   106
echo "###"
wenzelm@9797
   107
echo "### Exporting $DISTNAME ..."
wenzelm@9797
   108
echo "###"
wenzelm@2667
   109
wenzelm@9797
   110
cd "$DISTBASE"
wenzelm@2667
   111
wenzelm@9797
   112
$EXPORT
wenzelm@5622
   113
find . -name CVS -exec rm -rf {} \;
wenzelm@2667
   114
wenzelm@2667
   115
wenzelm@9797
   116
# build docs
wenzelm@2667
   117
wenzelm@9797
   118
echo "###"
wenzelm@9797
   119
echo "### Building docs ..."
wenzelm@9797
   120
echo "###"
wenzelm@9797
   121
wenzelm@9797
   122
cd "$DISTBASE/$DISTNAME/Doc"
wenzelm@6630
   123
PDFLATEX=$(type -path pdflatex)
wenzelm@3169
   124
wenzelm@3169
   125
for DOC in $(cat Contents)
wenzelm@2667
   126
do
wenzelm@9797
   127
  cd "$DOC"
wenzelm@6630
   128
  make dvi
wenzelm@6630
   129
  [ -n "$PDFLATEX" ] && make clean pdf
wenzelm@3169
   130
  cd ..
wenzelm@2667
   131
done
wenzelm@2667
   132
wenzelm@9052
   133
wenzelm@9052
   134
# make WWW pages
kleing@8059
   135
wenzelm@9797
   136
#FIXME
wenzelm@9797
   137
#export DISTNAME
wenzelm@9797
   138
#( cd "$DISTBASE/$DISTNAME/Admin/page"; make clean; make dist; cd dist; cp * "$DISTBASE"; )
kleing@8059
   139
wenzelm@2667
   140
wenzelm@2667
   141
# prepare dist dir for release
wenzelm@2667
   142
wenzelm@9797
   143
cd "$DISTBASE/$DISTNAME"
wenzelm@2667
   144
wenzelm@6758
   145
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
   146
mv -f $MOVE Distribution/doc
wenzelm@3305
   147
rm Distribution/doc/Isa-logics.eps
wenzelm@9052
   148
rm -rf Doc Tools
wenzelm@2667
   149
wenzelm@7115
   150
mkdir src contrib
wenzelm@2667
   151
mv $LOGICS src
wenzelm@2667
   152
wenzelm@2667
   153
mv Distribution/* .
wenzelm@2667
   154
rmdir Distribution
wenzelm@2667
   155
wenzelm@4180
   156
( cd lib/browser; make; )
berghofe@3638
   157
wenzelm@5385
   158
cp doc/isabelle*.eps lib/logo
wenzelm@5385
   159
berghofe@3638
   160
wenzelm@2667
   161
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   162
  {
wenzelm@2667
   163
    echo
wenzelm@2667
   164
    echo "IMPORTANT NOTE"
wenzelm@2667
   165
    echo "=============="
wenzelm@2667
   166
    echo
wenzelm@2667
   167
    echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   168
    echo
wenzelm@2667
   169
  } >UNOFFICIAL
wenzelm@2667
   170
fi
wenzelm@2667
   171
wenzelm@8810
   172
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html
wenzelm@4986
   173
perl -pi -e "s/Isabelle repository/$DISTVERSION/" src/Pure/ROOT.ML
wenzelm@4986
   174
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
wenzelm@3257
   175
lynx -dump README.html >README
wenzelm@3257
   176
wenzelm@9052
   177
( cd src; ../Admin/maketags; )
wenzelm@9052
   178
rm -rf Admin
wenzelm@9052
   179
wenzelm@2667
   180
wenzelm@2667
   181
# create archive
wenzelm@2667
   182
wenzelm@9797
   183
echo "###"
wenzelm@9797
   184
echo "### Creating archives ..."
wenzelm@9797
   185
echo "###"
wenzelm@2667
   186
wenzelm@9797
   187
cd "$DISTBASE"
wenzelm@9797
   188
wenzelm@9797
   189
chown -R "$LOGNAME" "$DISTNAME"
wenzelm@9797
   190
chgrp -R isabelle "$DISTNAME"
wenzelm@9797
   191
chmod -R u+w "$DISTNAME"
wenzelm@9797
   192
chmod -R g=o "$DISTNAME"
wenzelm@2667
   193
wenzelm@6748
   194
TAR=tar
wenzelm@6748
   195
type -path gtar >/dev/null && TAR=gtar
wenzelm@2667
   196
wenzelm@9797
   197
mkdir -p "pdf/$DISTNAME/doc"
wenzelm@9797
   198
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc"
wenzelm@6748
   199
wenzelm@9797
   200
"$TAR" cf "$DISTNAME.tar" "$DISTNAME"
wenzelm@9797
   201
( cd pdf; "$TAR" cf "../${DISTNAME}_pdf.tar" "$DISTNAME"; )
wenzelm@6748
   202
wenzelm@9797
   203
mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc"
wenzelm@9797
   204
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf
wenzelm@6750
   205
wenzelm@9797
   206
gzip "$DISTNAME.tar"
wenzelm@9797
   207
gzip "${DISTNAME}_pdf.tar"
wenzelm@4549
   208
wenzelm@6304
   209
wenzelm@9782
   210
# cleanup dist
wenzelm@9782
   211
wenzelm@9797
   212
mv "$DISTNAME" "${DISTNAME}-old"
wenzelm@9797
   213
mkdir "$DISTNAME"
wenzelm@9782
   214
wenzelm@9797
   215
mv "${DISTNAME}-old/lib/logo/isabelle.gif" .
wenzelm@9797
   216
mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "$DISTNAME"
wenzelm@9797
   217
mkdir "$DISTNAME/doc"
wenzelm@9797
   218
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc"
wenzelm@9782
   219
wenzelm@9867
   220
chgrp -R isabelle "$DISTNAME"
wenzelm@9867
   221
wenzelm@9797
   222
rm -rf "${DISTNAME}-old"
wenzelm@9782
   223
wenzelm@9782
   224
kleing@8059
   225
# prepare web pages
kleing@8059
   226
wenzelm@9782
   227
#FIXME
wenzelm@9782
   228
#$THIS/filesizes -norpm
wenzelm@6304
   229
wenzelm@6304
   230
wenzelm@2667
   231
# final note
wenzelm@2667
   232
wenzelm@9797
   233
echo "###"
wenzelm@9797
   234
echo "### Finished. You will find the distribution in $DISTBASE."
wenzelm@9797
   235
echo "###"