Admin/makedist
author wenzelm
Thu May 22 16:44:47 1997 +0200 (1997-05-22)
changeset 3305 d8114e93ef66
parent 3281 d4ddd43f418a
child 3363 8557c2a1750c
permissions -rwxr-xr-x
fixed doc;
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@2667
    12
CVSROOT=/isabelle/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@2668
    34
    * Check that README files are up to date (should have Id: lines).
wenzelm@2667
    35
    * Check that Pure/ROOT.ML/version is up to date!
wenzelm@2686
    36
    * Check release name and date in NEWS!
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@2667
    46
        cvs 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@2667
    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@2667
    79
wenzelm@2667
    80
if [ "$VERSION" = "-" ]; then
wenzelm@2667
    81
  DISTNAME=Isabelle_$DATE
wenzelm@2667
    82
  EXPORT="checkout"
wenzelm@2667
    83
  UNOFFICIAL=true
wenzelm@2667
    84
else
wenzelm@2667
    85
  DISTNAME="$VERSION"
wenzelm@2667
    86
  EXPORT="export -r $VERSION"
wenzelm@2667
    87
  UNOFFICIAL=""
wenzelm@2667
    88
fi
wenzelm@2667
    89
wenzelm@2667
    90
mkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"
wenzelm@2667
    91
[ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"
wenzelm@2667
    92
wenzelm@2667
    93
wenzelm@2667
    94
# export from repository
wenzelm@2667
    95
wenzelm@2667
    96
echo
wenzelm@2667
    97
echo "Exporting $DISTNAME from repository. Please be patient ..."
wenzelm@2667
    98
echo
wenzelm@2667
    99
wenzelm@2667
   100
cd $DISTBASE
wenzelm@2667
   101
wenzelm@2667
   102
export CVSROOT
wenzelm@3099
   103
cvs -f -q $EXPORT -P -d $DISTNAME isabelle
wenzelm@2667
   104
wenzelm@2667
   105
wenzelm@2667
   106
# make docs
wenzelm@2667
   107
wenzelm@3169
   108
cd $DISTBASE/$DISTNAME/Doc
wenzelm@3169
   109
wenzelm@3169
   110
for DOC in $(cat Contents)
wenzelm@2667
   111
do
wenzelm@3169
   112
  cd $DOC
wenzelm@2667
   113
  make dist
wenzelm@3169
   114
  cd ..
wenzelm@2667
   115
done
wenzelm@2667
   116
wenzelm@2667
   117
wenzelm@2667
   118
# prepare dist dir for release
wenzelm@2667
   119
wenzelm@2667
   120
cd $DISTBASE/$DISTNAME
wenzelm@2667
   121
wenzelm@2667
   122
find . -name CVS -exec rm -rf {} \;
wenzelm@2667
   123
wenzelm@3099
   124
mkdir -p Tools/8bit/bin    #FIXME tmp
wenzelm@3305
   125
find Doc \( -name \*.dvi -o -name \*.eps -o -name \*.ps \) -exec mv {} Distribution/doc \;
wenzelm@3305
   126
rm Distribution/doc/Isa-logics.eps
wenzelm@3099
   127
rm -rf Admin Doc
wenzelm@2667
   128
wenzelm@2667
   129
mkdir src
wenzelm@2667
   130
mv $LOGICS src
wenzelm@2829
   131
mv index.html src
wenzelm@2667
   132
wenzelm@2667
   133
mv Distribution/* .
wenzelm@2667
   134
rmdir Distribution
wenzelm@2667
   135
wenzelm@2667
   136
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   137
  {
wenzelm@2667
   138
    echo
wenzelm@2667
   139
    echo "IMPORTANT NOTE"
wenzelm@2667
   140
    echo "=============="
wenzelm@2667
   141
    echo
wenzelm@2667
   142
    echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   143
    echo
wenzelm@2667
   144
  } >UNOFFICIAL
wenzelm@2667
   145
fi
wenzelm@2667
   146
wenzelm@3257
   147
lynx -dump README.html >README
wenzelm@3257
   148
wenzelm@2667
   149
wenzelm@2667
   150
# create archive
wenzelm@2667
   151
wenzelm@2667
   152
cd $DISTBASE
wenzelm@2667
   153
wenzelm@2794
   154
#FIXME sometimes doesn't work!?
wenzelm@2794
   155
chown -R $LOGNAME:isabelle $DISTNAME
wenzelm@2794
   156
chmod -R u+w $DISTNAME
wenzelm@2794
   157
chmod -R g+w $DISTNAME
wenzelm@2667
   158
wenzelm@2667
   159
tar cf - $DISTNAME | gzip >$DISTNAME.tar.gz
wenzelm@2667
   160
wenzelm@2667
   161
wenzelm@2667
   162
# final note
wenzelm@2667
   163
wenzelm@2667
   164
echo
wenzelm@2667
   165
echo "That's it. You'll find the distribution in $DISTBASE."
wenzelm@2667
   166
echo