Admin/makedist
author wenzelm
Fri Feb 21 11:18:33 1997 +0100 (1997-02-21)
changeset 2668 72a962676702
parent 2667 b2172eab9ba6
child 2686 351c45bb338d
permissions -rwxr-xr-x
fixed Id comment;
wenzelm@2667
     1
#!/bin/bash -norc
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@2667
    10
LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF LK Modal Provers Pure Sequents TFL Tools ZF"
wenzelm@2667
    11
DOCS="Intro Ref Logics"
wenzelm@2667
    12
wenzelm@2667
    13
CVSROOT=/isabelle/archive
wenzelm@2667
    14
DISTBASE=~/tmp/isadist
wenzelm@2667
    15
wenzelm@2667
    16
wenzelm@2667
    17
## diagnostics
wenzelm@2667
    18
wenzelm@2667
    19
PRG=$(basename $0)
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@2668
    35
    * Check that README files are up to date (should have Id: lines).
wenzelm@2667
    36
    * Check that Pure/ROOT.ML/version is up to date!
wenzelm@2667
    37
    * Make sure that the repository version of Doc is consistent
wenzelm@2667
    38
      (watch out for *.bbl, *.rao, *.ind)!
wenzelm@2667
    39
EOF
wenzelm@2667
    40
  #Wicked! We just won't tell other users ...
wenzelm@2667
    41
  if [ $LOGNAME = paulson -o $LOGNAME = nipkow -o $LOGNAME = wenzelm ]; then
wenzelm@2667
    42
    cat <<EOF
wenzelm@2667
    43
    * Tag the current repository version, e.g.:
wenzelm@2667
    44
        cvs rtag Isabelle94-XX isabelle
wenzelm@2667
    45
      PLEASE DON'T DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
wenzelm@2667
    46
EOF
wenzelm@2667
    47
  fi
wenzelm@2667
    48
  cat <<EOF
wenzelm@2667
    49
wenzelm@2667
    50
  After the distribution has been created succesfully, you might want
wenzelm@2667
    51
  to run some makeall tests using different ML systems.
wenzelm@2667
    52
  
wenzelm@2667
    53
EOF
wenzelm@2667
    54
  exit 1
wenzelm@2667
    55
}
wenzelm@2667
    56
wenzelm@2667
    57
function fail()
wenzelm@2667
    58
{
wenzelm@2667
    59
  echo "$1" >&2
wenzelm@2667
    60
  exit 2
wenzelm@2667
    61
}
wenzelm@2667
    62
wenzelm@2667
    63
wenzelm@2667
    64
## process command line
wenzelm@2667
    65
wenzelm@2667
    66
[ $# -ne 1 ] && usage
wenzelm@2667
    67
wenzelm@2667
    68
VERSION="$1"
wenzelm@2667
    69
shift
wenzelm@2667
    70
wenzelm@2667
    71
wenzelm@2667
    72
## main
wenzelm@2667
    73
wenzelm@2667
    74
# dist version
wenzelm@2667
    75
wenzelm@2667
    76
DATE=$(date "+%d-%b-%Y")
wenzelm@2667
    77
wenzelm@2667
    78
if [ "$VERSION" = "-" ]; then
wenzelm@2667
    79
  DISTNAME=Isabelle_$DATE
wenzelm@2667
    80
  EXPORT="checkout"
wenzelm@2667
    81
  UNOFFICIAL=true
wenzelm@2667
    82
else
wenzelm@2667
    83
  DISTNAME="$VERSION"
wenzelm@2667
    84
  EXPORT="export -r $VERSION"
wenzelm@2667
    85
  UNOFFICIAL=""
wenzelm@2667
    86
fi
wenzelm@2667
    87
wenzelm@2667
    88
mkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"
wenzelm@2667
    89
[ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"
wenzelm@2667
    90
wenzelm@2667
    91
wenzelm@2667
    92
# export from repository
wenzelm@2667
    93
wenzelm@2667
    94
echo
wenzelm@2667
    95
echo "Exporting $DISTNAME from repository. Please be patient ..."
wenzelm@2667
    96
echo
wenzelm@2667
    97
wenzelm@2667
    98
cd $DISTBASE
wenzelm@2667
    99
wenzelm@2667
   100
export CVSROOT
wenzelm@2667
   101
cvs -f -q $EXPORT -d $DISTNAME isabelle
wenzelm@2667
   102
wenzelm@2667
   103
wenzelm@2667
   104
# make docs
wenzelm@2667
   105
wenzelm@2667
   106
for D in $DOCS
wenzelm@2667
   107
do
wenzelm@2667
   108
  cd $DISTBASE/$DISTNAME/Doc/$D
wenzelm@2667
   109
  make dist
wenzelm@2667
   110
done
wenzelm@2667
   111
wenzelm@2667
   112
wenzelm@2667
   113
# prepare dist dir for release
wenzelm@2667
   114
wenzelm@2667
   115
cd $DISTBASE/$DISTNAME
wenzelm@2667
   116
wenzelm@2667
   117
find . -name CVS -exec rm -rf {} \;
wenzelm@2667
   118
wenzelm@2667
   119
find Doc -name \*.dvi -exec mv {} Distribution/doc \;
wenzelm@2667
   120
rm -rf Admin Doc examples index.html
wenzelm@2667
   121
wenzelm@2667
   122
mkdir src
wenzelm@2667
   123
mv $LOGICS src
wenzelm@2667
   124
wenzelm@2667
   125
mv Distribution/* .
wenzelm@2667
   126
rmdir Distribution
wenzelm@2667
   127
wenzelm@2667
   128
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   129
  {
wenzelm@2667
   130
    echo
wenzelm@2667
   131
    echo "IMPORTANT NOTE"
wenzelm@2667
   132
    echo "=============="
wenzelm@2667
   133
    echo
wenzelm@2667
   134
    echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   135
    echo
wenzelm@2667
   136
  } >UNOFFICIAL
wenzelm@2667
   137
fi
wenzelm@2667
   138
wenzelm@2667
   139
wenzelm@2667
   140
# create archive
wenzelm@2667
   141
wenzelm@2667
   142
cd $DISTBASE
wenzelm@2667
   143
wenzelm@2667
   144
chown -R $LOGNAME:isabelle $DISTNAME
wenzelm@2667
   145
chmod -R u+w $DISTNAME
wenzelm@2667
   146
chmod -R g-w $DISTNAME
wenzelm@2667
   147
wenzelm@2667
   148
tar cf - $DISTNAME | gzip >$DISTNAME.tar.gz
wenzelm@2667
   149
wenzelm@2667
   150
wenzelm@2667
   151
# final note
wenzelm@2667
   152
wenzelm@2667
   153
echo
wenzelm@2667
   154
echo "That's it. You'll find the distribution in $DISTBASE."
wenzelm@2667
   155
echo