Admin/makedist
author wenzelm
Mon Feb 05 14:31:49 2001 +0100 (2001-02-05)
changeset 11062 e86340dc1d28
parent 10928 e040e8627bbb
child 11392 3078f52ee552
permissions -rwxr-xr-x
tuned;
wenzelm@3060
     1
#!/bin/bash
wenzelm@2667
     2
#
wenzelm@2667
     3
# $Id$
wenzelm@2667
     4
#
wenzelm@10077
     5
# makedist -- make Isabelle source 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@10533
    12
case $(hostname) in
wenzelm@10532
    13
  *broy*)
wenzelm@10532
    14
    export CVSROOT=/usr/proj/isabelle-repository/archive
wenzelm@10532
    15
    ;;
wenzelm@10532
    16
  *.cl.cam.ac.uk)
wenzelm@10532
    17
    export CVSROOT=sunbroy1.informatik.tu-muenchen.de:/usr/proj/isabelle-repository/archive
wenzelm@10532
    18
    ;;
wenzelm@10532
    19
esac
wenzelm@10532
    20
wenzelm@9052
    21
DISTPREFIX=~/tmp/isadist
wenzelm@2667
    22
wenzelm@9797
    23
umask 022
wenzelm@9797
    24
wenzelm@9920
    25
TAR=tar
wenzelm@9920
    26
type -path gtar >/dev/null && TAR=gtar
wenzelm@9920
    27
wenzelm@9920
    28
FIND=find
wenzelm@9920
    29
type -path gfind >/dev/null && FIND=gfind
wenzelm@9920
    30
wenzelm@2667
    31
wenzelm@2667
    32
## diagnostics
wenzelm@2667
    33
wenzelm@9797
    34
PRG=$(basename "$0")
wenzelm@9797
    35
THIS=$(cd $(dirname "$0"); echo "$PWD")
wenzelm@2667
    36
wenzelm@2667
    37
function usage()
wenzelm@2667
    38
{
wenzelm@2667
    39
  cat <<EOF
wenzelm@11062
    40
wenzelm@11062
    41
Usage: $PRG VERSION
wenzelm@11062
    42
wenzelm@2667
    43
  Make Isabelle distribution from the master sources at TUM.
wenzelm@2667
    44
wenzelm@9797
    45
  VERSION may be either a tag like "Isabelle99-XX" that specifies the
wenzelm@2667
    46
  release to be exported from the repository, or "-" to checkout the
wenzelm@9797
    47
  current sources as an unofficial release, or "--" to produce a
wenzelm@9797
    48
  tentative release from the present copy of the Isabelle repository.
wenzelm@2667
    49
wenzelm@2667
    50
  Checklist for official releases (before running this script):
wenzelm@2667
    51
wenzelm@11062
    52
    * Check Admin/page contents.
wenzelm@11062
    53
    * Check ANNOUNCE, README, INSTALL, NEWS.
wenzelm@11062
    54
    * Try "isatool makeall all" with Poly/ML, SML/NJ, etc.
wenzelm@2667
    55
    * Tag the current repository version, e.g.:
wenzelm@10169
    56
        cvs -d /usr/proj/isabelle-repository/archive rtag Isabelle99-X isabelle
wenzelm@11062
    57
      PLEASE DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING!
wenzelm@5727
    58
wenzelm@2667
    59
EOF
wenzelm@2667
    60
  exit 1
wenzelm@2667
    61
}
wenzelm@2667
    62
wenzelm@2667
    63
function fail()
wenzelm@2667
    64
{
wenzelm@2667
    65
  echo "$1" >&2
wenzelm@2667
    66
  exit 2
wenzelm@2667
    67
}
wenzelm@2667
    68
wenzelm@2667
    69
wenzelm@2667
    70
## process command line
wenzelm@2667
    71
wenzelm@9797
    72
[ "$#" -ne 1 ] && usage
wenzelm@2667
    73
wenzelm@2667
    74
VERSION="$1"
wenzelm@2667
    75
shift
wenzelm@2667
    76
wenzelm@2667
    77
wenzelm@2667
    78
## main
wenzelm@2667
    79
wenzelm@2667
    80
# dist version
wenzelm@2667
    81
wenzelm@2667
    82
DATE=$(date "+%d-%b-%Y")
wenzelm@4979
    83
DISTDATE=$(date "+%B %Y")
wenzelm@2667
    84
wenzelm@9797
    85
if [ "$VERSION" = "--" ]; then
wenzelm@9925
    86
  DISTNAME="Isabelle_$DATE"
wenzelm@4982
    87
  DISTVERSION="$DISTNAME"
wenzelm@9797
    88
  EXPORT="$THIS/cvs-copy $THIS/.. $DISTNAME"
wenzelm@9925
    89
  UNOFFICIAL="unofficial test"
wenzelm@9797
    90
elif [ "$VERSION" = "-" ]; then
wenzelm@9797
    91
  DISTNAME="Isabelle_$DATE"
wenzelm@9797
    92
  DISTVERSION="$DISTNAME"
wenzelm@9797
    93
  EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle"
wenzelm@9925
    94
  UNOFFICIAL="unofficial"
wenzelm@2667
    95
else
wenzelm@2667
    96
  DISTNAME="$VERSION"
wenzelm@4982
    97
  DISTVERSION="$DISTNAME: $DISTDATE"
wenzelm@9797
    98
  EXPORT="cvs -f -q export -r $VERSION -d $DISTNAME isabelle"
wenzelm@2667
    99
  UNOFFICIAL=""
wenzelm@2667
   100
fi
wenzelm@2667
   101
wenzelm@9797
   102
DISTBASE="$DISTPREFIX/dist-$DISTNAME"
wenzelm@9797
   103
mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!"
wenzelm@9797
   104
[ -e "$DISTBASE/$DISTNAME" ] && fail "$DISTBASE/$DISTNAME already exists!"
wenzelm@9797
   105
[ -e "$DISTBASE/pdf/$DISTNAME" ] && fail "$DISTBASE/pdf/$DISTNAME already exists!"
wenzelm@2667
   106
wenzelm@2667
   107
wenzelm@9797
   108
# export repository
wenzelm@2667
   109
wenzelm@9797
   110
echo "###"
wenzelm@9797
   111
echo "### Exporting $DISTNAME ..."
wenzelm@9797
   112
echo "###"
wenzelm@2667
   113
wenzelm@9797
   114
cd "$DISTBASE"
wenzelm@2667
   115
wenzelm@9797
   116
$EXPORT
wenzelm@9920
   117
$FIND . -name CVS -print | xargs rm -rf
wenzelm@9920
   118
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
wenzelm@9920
   119
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
wenzelm@9920
   120
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
wenzelm@2667
   121
wenzelm@2667
   122
wenzelm@9797
   123
# build docs
wenzelm@2667
   124
wenzelm@9797
   125
echo "###"
wenzelm@9797
   126
echo "### Building docs ..."
wenzelm@9797
   127
echo "###"
wenzelm@9797
   128
wenzelm@9797
   129
cd "$DISTBASE/$DISTNAME/Doc"
wenzelm@6630
   130
PDFLATEX=$(type -path pdflatex)
wenzelm@3169
   131
wenzelm@3169
   132
for DOC in $(cat Contents)
wenzelm@2667
   133
do
wenzelm@9797
   134
  cd "$DOC"
wenzelm@9925
   135
  make dvi
wenzelm@9925
   136
  [ -n "$PDFLATEX" ] && make clean pdf
wenzelm@3169
   137
  cd ..
wenzelm@2667
   138
done
wenzelm@2667
   139
wenzelm@9052
   140
wenzelm@9920
   141
# prepare dist dir for release
kleing@8059
   142
wenzelm@9920
   143
echo "###"
wenzelm@9920
   144
echo "### Preparing distribution ..."
wenzelm@9920
   145
echo "###"
wenzelm@2667
   146
wenzelm@9797
   147
cd "$DISTBASE/$DISTNAME"
wenzelm@2667
   148
wenzelm@9925
   149
cp -R Admin/page ..
wenzelm@9925
   150
cp Distribution/doc/Contents ../page
wenzelm@9920
   151
cp Distribution/lib/logo/isabelle.gif ../page/main-content
wenzelm@9920
   152
cp Distribution/lib/logo/isabelle.gif ../page/dist-content
wenzelm@9920
   153
echo "$DISTNAME" > ../page/DISTNAME
wenzelm@9920
   154
wenzelm@9920
   155
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
   156
mv -f $MOVE Distribution/doc
wenzelm@3305
   157
rm Distribution/doc/Isa-logics.eps
wenzelm@9052
   158
rm -rf Doc Tools
wenzelm@2667
   159
wenzelm@7115
   160
mkdir src contrib
wenzelm@2667
   161
mv $LOGICS src
wenzelm@2667
   162
wenzelm@2667
   163
mv Distribution/* .
wenzelm@2667
   164
rmdir Distribution
wenzelm@2667
   165
wenzelm@4180
   166
( cd lib/browser; make; )
berghofe@3638
   167
wenzelm@5385
   168
cp doc/isabelle*.eps lib/logo
wenzelm@5385
   169
berghofe@3638
   170
wenzelm@2667
   171
if [ -n "$UNOFFICIAL" ]; then
wenzelm@2667
   172
  {
wenzelm@2667
   173
    echo
wenzelm@2667
   174
    echo "IMPORTANT NOTE"
wenzelm@2667
   175
    echo "=============="
wenzelm@2667
   176
    echo
wenzelm@9925
   177
    echo "This is an $UNOFFICIAL release of Isabelle, created by $LOGNAME $DATE."
wenzelm@2667
   178
    echo
wenzelm@9925
   179
  } >ANNOUNCE
wenzelm@2667
   180
fi
wenzelm@2667
   181
wenzelm@8810
   182
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html
wenzelm@9959
   183
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML
wenzelm@4986
   184
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
wenzelm@3257
   185
lynx -dump README.html >README
wenzelm@3257
   186
wenzelm@9052
   187
( cd src; ../Admin/maketags; )
wenzelm@10077
   188
wenzelm@10077
   189
( env BASH_PATH=/bin/bash PERL_PATH=/usr/bin/perl ./configure )
wenzelm@10077
   190
wenzelm@9052
   191
rm -rf Admin
wenzelm@9052
   192
wenzelm@2667
   193
wenzelm@2667
   194
# create archive
wenzelm@2667
   195
wenzelm@9797
   196
echo "###"
wenzelm@9797
   197
echo "### Creating archives ..."
wenzelm@9797
   198
echo "###"
wenzelm@2667
   199
wenzelm@9797
   200
cd "$DISTBASE"
wenzelm@9797
   201
wenzelm@10087
   202
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST
wenzelm@10087
   203
wenzelm@10068
   204
rm -f Isabelle
wenzelm@10068
   205
ln -s "$DISTNAME" Isabelle
wenzelm@10068
   206
wenzelm@9797
   207
chown -R "$LOGNAME" "$DISTNAME"
wenzelm@9797
   208
chmod -R u+w "$DISTNAME"
wenzelm@9797
   209
chmod -R g=o "$DISTNAME"
wenzelm@10077
   210
chgrp -R isabelle "$DISTNAME" Isabelle
wenzelm@2667
   211
wenzelm@9797
   212
mkdir -p "pdf/$DISTNAME/doc"
wenzelm@9797
   213
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc"
wenzelm@6748
   214
wenzelm@10928
   215
page/bin/mkcontents "$DISTNAME/doc/Contents" "pdf/$DISTNAME/doc/index"
wenzelm@10928
   216
cat > "pdf/$DISTNAME/doc/index.html" <<EOF
wenzelm@10928
   217
<html>
wenzelm@10928
   218
<head>
wenzelm@10928
   219
<title>$DISTNAME Documentation</title>
wenzelm@10928
   220
</head>
wenzelm@10928
   221
<body>
wenzelm@10928
   222
<h1>$DISTNAME Documentation</h1>
wenzelm@10928
   223
$(cat "pdf/$DISTNAME/doc/index")
wenzelm@10928
   224
</body>
wenzelm@10928
   225
</html>
wenzelm@10928
   226
EOF
wenzelm@10928
   227
rm "pdf/$DISTNAME/doc/index"
wenzelm@10928
   228
wenzelm@10096
   229
echo "$DISTNAME.tar.gz"
wenzelm@10077
   230
"$TAR" cf "$DISTNAME.tar" Isabelle "$DISTNAME"
wenzelm@10096
   231
gzip "$DISTNAME.tar"
wenzelm@10096
   232
wenzelm@10096
   233
echo "${DISTNAME}_pdf.tar.gz"
wenzelm@10112
   234
( cd pdf; "$TAR" cf "../${DISTNAME}_pdf.tar" "$DISTNAME"; )
wenzelm@10096
   235
gzip "${DISTNAME}_pdf.tar"
wenzelm@6748
   236
wenzelm@10928
   237
mv "pdf/$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc/index.html" "$DISTNAME/doc"
wenzelm@9797
   238
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf
wenzelm@6750
   239
wenzelm@6304
   240
wenzelm@9782
   241
# cleanup dist
wenzelm@9782
   242
wenzelm@9797
   243
mv "$DISTNAME" "${DISTNAME}-old"
wenzelm@9797
   244
mkdir "$DISTNAME"
wenzelm@9782
   245
wenzelm@10017
   246
mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" "${DISTNAME}-old/ANNOUNCE" "$DISTNAME"
wenzelm@9797
   247
mkdir "$DISTNAME/doc"
wenzelm@10928
   248
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/index.html" "$DISTNAME/doc"
wenzelm@9782
   249
wenzelm@9867
   250
chgrp -R isabelle "$DISTNAME"
wenzelm@9867
   251
wenzelm@9797
   252
rm -rf "${DISTNAME}-old"
wenzelm@9782
   253
wenzelm@9782
   254
wenzelm@2667
   255
# final note
wenzelm@2667
   256
wenzelm@9797
   257
echo "###"
wenzelm@10112
   258
echo "### Finished makedist."
wenzelm@9797
   259
echo "###"