Admin/makedist
changeset 17554 d16abc8f4fb0
parent 16508 5e5945ae284c
child 17558 de236aeb867c
equal deleted inserted replaced
17553:d7b304d05956 17554:d16abc8f4fb0
     5 # makedist -- make Isabelle source distribution.
     5 # makedist -- make Isabelle source distribution.
     6 
     6 
     7 
     7 
     8 ## global settings
     8 ## global settings
     9 
     9 
       
    10 DISTPREFIX=${DISTPREFIX:-~/tmp/isadist}
    10 LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL ZF"
    11 LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL ZF"
    11 
    12 
    12 case $(hostname) in
    13 export CVSROOT=/usr/proj/isabelle-repository/archive
    13   *lapbroy*)
    14 [ ! -d "$CVSROOT" ] && CVSROOT="sunbroy2.informatik.tu-muenchen.de:$CVSROOT"
    14     export CVSROOT=sunbroy2:/usr/proj/isabelle-repository/archive
       
    15     ;;
       
    16   *broy*)
       
    17     export CVSROOT=/usr/proj/isabelle-repository/archive
       
    18     ;;
       
    19   *)
       
    20     export CVSROOT=sunbroy2.informatik.tu-muenchen.de:/usr/proj/isabelle-repository/archive
       
    21     ;;
       
    22 esac
       
    23 
       
    24 DISTPREFIX=${DISTPREFIX:-~/tmp/isadist}
       
    25 
    15 
    26 umask 022
    16 umask 022
    27 
    17 
    28 TAR=tar
    18 TAR=tar
    29 type -path gtar >/dev/null && TAR=gtar
    19 type -path gtar >/dev/null && TAR=gtar
    39 
    29 
    40 function usage()
    30 function usage()
    41 {
    31 {
    42   cat <<EOF
    32   cat <<EOF
    43 
    33 
    44 Usage: $PRG VERSION
    34 Usage: $PRG VERSION [NAME]
    45 
    35 
    46   Make Isabelle distribution from the master sources at TUM.
    36   Make Isabelle distribution from the master sources at TUM.
    47 
    37 
    48   VERSION may be either a tag like "Isabelle2002-XX" that specifies the
    38   VERSION may be either a tag like "Isabelle2005" that specifies the
    49   release to be exported from the repository, or "-" to checkout the
    39   release to be exported from the repository, or "-" to checkout the
    50   current sources as an unofficial release, or "--" to produce a
    40   current sources as an unofficial release.
    51   tentative release from the present copy of the Isabelle repository.
    41 
       
    42   NAME specifies an explicit distribution name, by default it is
       
    43   derived from VERSION.
    52 
    44 
    53   Checklist for official releases (before running this script):
    45   Checklist for official releases (before running this script):
    54 
    46 
    55     * Check Admin/page contents.
    47     * Check Admin/website contents.
    56     * Check ANNOUNCE, README, INSTALL, NEWS, COPYRIGHT, CONTRIBUTORS.
    48     * Check ANNOUNCE, README.html, INSTALL, NEWS, COPYRIGHT, CONTRIBUTORS.
    57     * Try "isatool makeall all" with Poly/ML, SML/NJ, etc.
    49     * Try "isatool makeall all" with Poly/ML, SML/NJ, etc.
    58     * Tag the current repository version, e.g.:
    50     * Tag the current repository version, e.g.:
    59         cvs -d /usr/proj/isabelle-repository/archive rtag Isabelle2002 isabelle
    51         cvs -d /usr/proj/isabelle-repository/archive rtag Isabelle2005 isabelle
    60       PLEASE DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING!
    52       PLEASE DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING!
    61 
    53 
    62 EOF
    54 EOF
    63   exit 1
    55   exit 1
    64 }
    56 }
    70 }
    62 }
    71 
    63 
    72 
    64 
    73 ## process command line
    65 ## process command line
    74 
    66 
    75 [ "$#" -ne 1 ] && usage
    67 [ "$#" -ne 1 -a "$#" -ne 2 ] && usage
    76 
    68 
    77 VERSION="$1"
    69 VERSION="$1"; shift
    78 shift
    70 
       
    71 if [ "$#" -eq 0 ]; then
       
    72   DISTNAME=""
       
    73 else
       
    74   DISTNAME="$1"; shift
       
    75 fi
    79 
    76 
    80 
    77 
    81 ## main
    78 ## main
    82 
    79 
    83 # dist version
    80 # dist version
    84 
    81 
    85 DATE=$(date "+%d-%b-%Y")
    82 DATE=$(date "+%d-%b-%Y")
    86 DISTDATE=$(date "+%B %Y")
    83 DISTDATE=$(date "+%B %Y")
    87 
    84 
    88 if [ "$VERSION" = "--" ]; then
    85 if [ "$VERSION" = "-" ]; then
    89   DISTNAME="Isabelle_$DATE"
    86   DISTIDENT="Isabelle_$DATE"
    90   DISTVERSION="$DISTNAME"
    87   [ -z "$DISTNAME" ] && DISTNAME="$DISTIDENT"
    91   EXPORT="$THIS/cvs-copy $THIS/.. $DISTNAME"
       
    92   UNOFFICIAL="unofficial test"
       
    93 elif [ "$VERSION" = "-" ]; then
       
    94   DISTNAME="Isabelle_$DATE"
       
    95   DISTVERSION="$DISTNAME"
    88   DISTVERSION="$DISTNAME"
    96   EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle"
    89   EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle"
    97   UNOFFICIAL="unofficial"
    90   UNOFFICIAL="unofficial"
    98 else
    91 else
    99   DISTNAME="$VERSION"
    92   DISTIDENT="$VERSION"
       
    93   [ -z "$DISTNAME" ] && DISTNAME="$DISTIDENT"
   100   DISTVERSION="$DISTNAME: $DISTDATE"
    94   DISTVERSION="$DISTNAME: $DISTDATE"
   101   EXPORT="cvs -f -q export -r $VERSION -d $DISTNAME isabelle"
    95   EXPORT="cvs -f -q export -P -r $VERSION -d $DISTNAME isabelle"
   102   UNOFFICIAL=""
    96   UNOFFICIAL=""
   103 fi
    97 fi
   104 
    98 
   105 DISTBASE="$DISTPREFIX/dist-$DISTNAME"
    99 DISTBASE="$DISTPREFIX/dist-$DISTNAME"
   106 mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!"
   100 mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!"
   109 
   103 
   110 
   104 
   111 # export repository
   105 # export repository
   112 
   106 
   113 echo "###"
   107 echo "###"
   114 echo "### Exporting $DISTNAME ..."
   108 echo "### Exporting $DISTIDENT ..."
   115 echo "###"
   109 echo "###"
   116 
   110 
   117 cd "$DISTBASE"
   111 cd "$DISTBASE"
   118 
   112 
   119 $EXPORT || fail "Export failed!"
   113 $EXPORT || fail "Export failed!"
   126   cd ..
   120   cd ..
   127 fi
   121 fi
   128 
   122 
   129 $FIND . -name CVS -print | xargs rm -rf
   123 $FIND . -name CVS -print | xargs rm -rf
   130 $FIND . -name .cvsignore -print | xargs rm -rf
   124 $FIND . -name .cvsignore -print | xargs rm -rf
   131 $FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
   125 $FIND . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -x
   132 $FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
       
   133 $FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
       
   134 $FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
       
   135 $FIND . "(" -type d -a -empty ")" -print | xargs rm -rf
       
   136 
   126 
   137 
   127 
   138 # build docs
   128 # build docs
   139 
   129 
   140 echo "###"
   130 echo "###"
   146 
   136 
   147 for DOC in $(cat Contents)
   137 for DOC in $(cat Contents)
   148 do
   138 do
   149   cd "$DOC"
   139   cd "$DOC"
   150   make dvi || fail "DVI document for $DOC failed!"
   140   make dvi || fail "DVI document for $DOC failed!"
   151   ([ -n "$PDFLATEX" ] && make clean pdf) || fail "PDF document for $DOC failed!"
   141   { [ -n "$PDFLATEX" ] && make clean pdf; } || fail "PDF document for $DOC failed!"
   152   cd ..
   142   cd ..
   153 done
   143 done
   154 
   144 
   155 
   145 
   156 # prepare dist dir for release
   146 # prepare dist dir for release
   157 
   147 
   158 echo "###"
   148 echo "###"
   159 echo "### Preparing distribution ..."
   149 echo "### Preparing distribution ..."
   160 echo "###"
   150 echo "###"
   161 
   151 
   162 cd "$DISTBASE/$DISTNAME" || fail "Something is wrong: dist directory doesn't exist!"
   152 cd "$DISTBASE/$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME"
   163 
   153 
   164 #~ # old site framework
       
   165 #~ cp -R Admin/page ..
       
   166 #~ cp Distribution/doc/Contents ../page
       
   167 #~ cp Distribution/lib/logo/isabelle.gif ../page/main-content
       
   168 #~ cp Distribution/lib/logo/isabelle.gif ../page/dist-content
       
   169 #~ echo "$DISTNAME" > ../page/DISTNAME
       
   170 # new site framework
       
   171 cp -R Admin/website ..
   154 cp -R Admin/website ..
   172 mkdir -p ../website/conf
   155 mkdir -p ../website/conf
   173 cat > ../website/conf/distname.mak <<EOF
   156 cat > ../website/conf/distname.mak <<EOF
   174 # this is a generated file - do not edit unless you know what you are doing
   157 # this is a generated file - do not edit!
   175 
   158 
   176 DISTNAME=$DISTNAME
   159 DISTNAME=$DISTNAME
       
   160 DISTIDENT=$DISTIDENT
   177 EOF
   161 EOF
   178 
   162 
   179 MOVE=$($FIND Doc \( -type f -a -not -type l -a -not -name pghead.pdf -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf')
   163 MOVE=$($FIND Doc \( -type f -a -not -type l -a -not -name pghead.pdf -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf')
   180 mv -f $MOVE Distribution/doc
   164 mv -f $MOVE Distribution/doc
   181 rm Distribution/doc/Isa-logics.eps
   165 rm Distribution/doc/Isa-logics.eps
   196   {
   180   {
   197     echo
   181     echo
   198     echo "IMPORTANT NOTE"
   182     echo "IMPORTANT NOTE"
   199     echo "=============="
   183     echo "=============="
   200     echo
   184     echo
   201     echo "This is an $UNOFFICIAL release of Isabelle, created by $LOGNAME $DATE."
   185     echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE."
   202     echo
   186     echo
   203   } >ANNOUNCE
   187   } >ANNOUNCE
   204 fi
   188 fi
   205 
   189 
   206 perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html
   190 perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html
   207 perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML
   191 perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML lib/Tools/version
   208 perl -pi -e "s/Isabelle repository version/$DISTVERSION/" lib/Tools/version
       
   209 perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
   192 perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html
   210 lynx -dump README.html >README
   193 lynx -dump README.html >README
   211 
   194 
   212 ( cd src; ../Admin/maketags; )
   195 ( cd src; ../Admin/maketags; )
   213 
   196 
   266 
   249 
   267 mv "$DISTNAME" "${DISTNAME}-old"
   250 mv "$DISTNAME" "${DISTNAME}-old"
   268 mkdir "$DISTNAME"
   251 mkdir "$DISTNAME"
   269 
   252 
   270 mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \
   253 mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \
   271    "${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \
   254   "${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \
   272    "$DISTNAME"
   255   "$DISTNAME"
   273 mkdir "$DISTNAME/doc"
   256 mkdir "$DISTNAME/doc"
   274 mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/index.html" "$DISTNAME/doc"
   257 mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/index.html" "$DISTNAME/doc"
   275 
   258 
   276 chgrp -R isabelle "$DISTNAME"
   259 chgrp -R isabelle "$DISTNAME"
   277 
   260