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