#!/bin/bash## $Id$## makedist -- make Isabelle distribution.## global settingsLOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL ZF"CVSROOT=/usr/proj/isabelle-repository/archiveDISTBASE=~/tmp/isadist## diagnosticsPRG=$(basename $0)THIS=$(cd $(dirname "$0"); echo $PWD)function usage(){ echo echo "Usage: $PRG VERSION" echo cat <<EOF Make Isabelle distribution from the master sources at TUM. VERSION may be either a tag like "Isabelle94-XX" that specifies the release to be exported from the repository, or "-" to checkout the current sources as an unofficial release. Checklist for official releases (before running this script): * Check release name and date in NEWS! * Check that README files are up to date (should have Id: lines). * Check Admin/index.html. * Make sure that encoding info is consistent (fixencoding)! * Check ML_SYSTEM defaults!EOF #Wicked! We just won't tell other users ... if [ $LOGNAME = paulson -o $LOGNAME = nipkow -o $LOGNAME = wenzelm -o $LOGNAME = berghofe ]; then cat <<EOF * Tag the current repository version, e.g.: cvs -d $CVSROOT rtag Isabelle94-XX isabelle PLEASE DON'T DO THIS UNLESS YOU KNOW WHAT YOU'RE DOING!EOF fi cat <<EOF After the distribution has been created succesfully, you might want to run some makeall tests using different ML systems.EOF exit 1}function fail(){ echo "$1" >&2 exit 2}## process command line[ $# -ne 1 ] && usageVERSION="$1"shift## main# dist versionDATE=$(date "+%d-%b-%Y")DISTDATE=$(date "+%B %Y")if [ "$VERSION" = "-" ]; then DISTNAME=Isabelle_$DATE DISTVERSION="$DISTNAME" EXPORT="checkout -P" UNOFFICIAL=trueelse DISTNAME="$VERSION" DISTVERSION="$DISTNAME: $DISTDATE" EXPORT="export -r $VERSION" UNOFFICIAL=""fimkdir -p $DISTBASE || fail "Unable to create distribution base dir $DISTBASE!"[ -e $DISTBASE/$DISTNAME ] && fail "$DISTBASE/$DISTNAME already exists!"[ -e $DISTBASE/pdf/$DISTNAME ] && fail "$DISTBASE/pdf/$DISTNAME already exists!"# export from repositoryechoecho "Exporting $DISTNAME from repository. Please be patient ..."echocd $DISTBASEexport CVSROOTcvs -f -q $EXPORT -d $DISTNAME isabellefind . -name CVS -exec rm -rf {} \;# make docscd $DISTBASE/$DISTNAME/DocPDFLATEX=$(type -path pdflatex)for DOC in $(cat Contents)do cd $DOC make dvi [ -n "$PDFLATEX" ] && make clean pdf cd ..done# make web pagesexport DISTNAME(cd $DISTBASE/$DISTNAME/Admin/page; make clean; make dist; cd dist; cp * $DISTBASE)# prepare dist dir for releasecd $DISTBASE/$DISTNAMEMOVE=$(find Doc \( -type f -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf')mv -f $MOVE Distribution/docrm Distribution/doc/Isa-logics.epsrm -rf Admin Doc Toolsmkdir src contribmv $LOGICS srcmv Distribution/* .rmdir Distribution( cd lib/browser; make; )cp doc/isabelle*.eps lib/logoif [ -n "$UNOFFICIAL" ]; then { echo echo "IMPORTANT NOTE" echo "==============" echo echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE." echo } >UNOFFICIALfiperl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index1.html lib/html/index2.htmlperl -pi -e "s/Isabelle repository/$DISTVERSION/" src/Pure/ROOT.MLperl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.htmllynx -dump README.html >README# create archivecd $DISTBASEchown -R $LOGNAME:isabelle $DISTNAMEchmod -R u+w $DISTNAMETAR=tartype -path gtar >/dev/null && TAR=gtarmkdir -p pdf/$DISTNAME/docmv $DISTNAME/doc/*.pdf pdf/$DISTNAME/doc$TAR cf $DISTNAME.tar $DISTNAME( cd pdf; $TAR cf ../${DISTNAME}_pdf.tar $DISTNAME; )mv pdf/$DISTNAME/doc/*.pdf $DISTNAME/docrmdir pdf/$DISTNAME/doc pdf/$DISTNAME pdfgzip $DISTNAME.targzip ${DISTNAME}_pdf.tar# prepare web pages$THIS/filesizes -norpm# final noteechoecho "That's it. You'll find the distribution in $DISTBASE."echo