Admin/makedist
author wenzelm
Mon Nov 09 12:27:41 1998 +0100 (1998-11-09)
changeset 5817 02f4ff005a78
parent 5769 6a422b22ba02
child 6296 9da8f9262c4c
permissions -rwxr-xr-x
Check release name and date in NEWS!
     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=/usr/proj/isabelle-repository/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 release name and date in NEWS!
    35     * Check that README files are up to date (should have Id: lines).
    36     * Check Admin/index.html.
    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 -d $CVSROOT 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 DISTDATE=$(date "+%B %Y")
    80 
    81 if [ "$VERSION" = "-" ]; then
    82   DISTNAME=Isabelle_$DATE
    83   DISTVERSION="$DISTNAME"
    84   EXPORT="checkout -P"
    85   UNOFFICIAL=true
    86 else
    87   DISTNAME="$VERSION"
    88   DISTVERSION="$DISTNAME: $DISTDATE"
    89   EXPORT="export -r $VERSION"
    90   UNOFFICIAL=""
    91 fi
    92 
    93 mkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"
    94 [ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"
    95 
    96 
    97 # export from repository
    98 
    99 echo
   100 echo "Exporting $DISTNAME from repository. Please be patient ..."
   101 echo
   102 
   103 cd $DISTBASE
   104 
   105 export CVSROOT
   106 cvs -f -q $EXPORT -d $DISTNAME isabelle
   107 find . -name CVS -exec rm -rf {} \;
   108 
   109 
   110 # make docs
   111 
   112 cd $DISTBASE/$DISTNAME/Doc
   113 
   114 for DOC in $(cat Contents)
   115 do
   116   cd $DOC
   117   make dist
   118   cd ..
   119 done
   120 
   121 
   122 # prepare dist dir for release
   123 
   124 cd $DISTBASE/$DISTNAME
   125 
   126 find Doc \( -type f -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps \) \) \
   127   -exec mv -f {} Distribution/doc \;
   128 rm Distribution/doc/Isa-logics.eps
   129 cp Admin/index.html $DISTBASE
   130 rm -rf Admin Doc
   131 
   132 mkdir src
   133 mv $LOGICS src
   134 
   135 mv Distribution/* .
   136 rmdir Distribution
   137 
   138 ( cd lib/browser; make; )
   139 
   140 cp doc/isabelle*.eps lib/logo
   141 
   142 
   143 if [ -n "$UNOFFICIAL" ]; then
   144   {
   145     echo
   146     echo "IMPORTANT NOTE"
   147     echo "=============="
   148     echo
   149     echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
   150     echo
   151   } >UNOFFICIAL
   152 fi
   153 
   154 perl -pi -e "s/Isabelle repository/$DISTVERSION/" src/Pure/ROOT.ML
   155 perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
   156 lynx -dump README.html >README
   157 
   158 
   159 # create archive
   160 
   161 cd $DISTBASE
   162 
   163 chown -R $LOGNAME:isabelle $DISTNAME
   164 chmod -R u+w $DISTNAME
   165 
   166 if type -path gtar
   167 then
   168   gtar cf $DISTNAME.tar $DISTNAME
   169 else
   170   tar cf $DISTNAME.tar $DISTNAME
   171 fi
   172 
   173 UNPACKED_SIZE=$[ $(wc -c <$DISTNAME.tar) / 1024 ]
   174 
   175 gzip $DISTNAME.tar
   176 
   177 PACKED_SIZE=$[ $(wc -c <$DISTNAME.tar.gz) / 1024 ]
   178 
   179 
   180 # prepare index.html
   181 
   182 perl -pi -e \
   183  "s/{ISABELLE}/$DISTNAME/g; \
   184   s/{PACKED_SIZE}/$PACKED_SIZE/g; \
   185   s/{UNPACKED_SIZE}/$UNPACKED_SIZE/g; \
   186   s/{AUTHOR}/$LOGNAME/g; \
   187   s/{DATE}/$DATE/g;" \
   188     $DISTBASE/index.html \
   189     $DISTBASE/$DISTNAME/lib/html/index1.html \
   190     $DISTBASE/$DISTNAME/lib/html/index2.html
   191 
   192 
   193 # final note
   194 
   195 echo
   196 echo "That's it. You'll find the distribution in $DISTBASE."
   197 echo