Admin/makedist
author wenzelm
Wed, 21 May 1997 17:31:12 +0200
changeset 3281 d4ddd43f418a
parent 3257 4e3724e0659f
child 3305 d8114e93ef66
permissions -rwxr-xr-x
fixed find cmd;
     1 #!/bin/bash
     2 #
     3 # $Id$
     4 #
     5 # makedist -- make Isabelle distribution.
     6 
     7 
     8 ## global settings
     9 
    10 LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL Tools ZF"
    11 
    12 CVSROOT=/isabelle/archive
    13 DISTBASE=~/tmp/isadist
    14 
    15 
    16 ## diagnostics
    17 
    18 PRG=$(basename $0)
    19 
    20 function usage()
    21 {
    22   echo
    23   echo "Usage: $PRG VERSION"
    24   echo
    25   cat <<EOF
    26   Make Isabelle distribution from the master sources at TUM.
    27 
    28   VERSION may be either a tag like "Isabelle94-XX" that specifies the
    29   release to be exported from the repository, or "-" to checkout the
    30   current sources as an unofficial release.
    31 
    32   Checklist for official releases (before running this script):
    33 
    34     * Check that README files are up to date (should have Id: lines).
    35     * Check that Pure/ROOT.ML/version is up to date!
    36     * Check release name and date in NEWS!
    37     * Make sure that encoding info is consistent (fixencoding)!
    38     * Make sure that the repository version of Doc is consistent
    39       (watch out for *.bbl, *.rao, *.ind)!
    40     * Check ML_SYSTEM defaults!
    41 EOF
    42   #Wicked! We just won't tell other users ...
    43   if [ $LOGNAME = paulson -o $LOGNAME = nipkow -o $LOGNAME = wenzelm ]; then
    44     cat <<EOF
    45     * Tag the current repository version, e.g.:
    46         cvs rtag Isabelle94-XX isabelle
    47       PLEASE DON'T DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
    48 EOF
    49   fi
    50   cat <<EOF
    51 
    52   After the distribution has been created succesfully, you might want
    53   to run some makeall tests using different ML systems.
    54   
    55 EOF
    56   exit 1
    57 }
    58 
    59 function fail()
    60 {
    61   echo "$1" >&2
    62   exit 2
    63 }
    64 
    65 
    66 ## process command line
    67 
    68 [ $# -ne 1 ] && usage
    69 
    70 VERSION="$1"
    71 shift
    72 
    73 
    74 ## main
    75 
    76 # dist version
    77 
    78 DATE=$(date "+%d-%b-%Y")
    79 
    80 if [ "$VERSION" = "-" ]; then
    81   DISTNAME=Isabelle_$DATE
    82   EXPORT="checkout"
    83   UNOFFICIAL=true
    84 else
    85   DISTNAME="$VERSION"
    86   EXPORT="export -r $VERSION"
    87   UNOFFICIAL=""
    88 fi
    89 
    90 mkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"
    91 [ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"
    92 
    93 
    94 # export from repository
    95 
    96 echo
    97 echo "Exporting $DISTNAME from repository. Please be patient ..."
    98 echo
    99 
   100 cd $DISTBASE
   101 
   102 export CVSROOT
   103 cvs -f -q $EXPORT -P -d $DISTNAME isabelle
   104 
   105 
   106 # make docs
   107 
   108 cd $DISTBASE/$DISTNAME/Doc
   109 
   110 for DOC in $(cat Contents)
   111 do
   112   cd $DOC
   113   make dist
   114   cd ..
   115 done
   116 
   117 
   118 # prepare dist dir for release
   119 
   120 cd $DISTBASE/$DISTNAME
   121 
   122 find . -name CVS -exec rm -rf {} \;
   123 
   124 mkdir -p Tools/8bit/bin    #FIXME tmp
   125 find Doc -name \*.dvi -o -name \*.eps -o -name \*.ps -exec mv {} Distribution/doc \;
   126 rm -rf Admin Doc
   127 
   128 mkdir src
   129 mv $LOGICS src
   130 mv index.html src
   131 
   132 mv Distribution/* .
   133 rmdir Distribution
   134 
   135 if [ -n "$UNOFFICIAL" ]; then
   136   {
   137     echo
   138     echo "IMPORTANT NOTE"
   139     echo "=============="
   140     echo
   141     echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
   142     echo
   143   } >UNOFFICIAL
   144 fi
   145 
   146 lynx -dump README.html >README
   147 
   148 
   149 # create archive
   150 
   151 cd $DISTBASE
   152 
   153 #FIXME sometimes doesn't work!?
   154 chown -R $LOGNAME:isabelle $DISTNAME
   155 chmod -R u+w $DISTNAME
   156 chmod -R g+w $DISTNAME
   157 
   158 tar cf - $DISTNAME | gzip >$DISTNAME.tar.gz
   159 
   160 
   161 # final note
   162 
   163 echo
   164 echo "That's it. You'll find the distribution in $DISTBASE."
   165 echo