Admin/makedist_mercurial
author wenzelm
Thu, 17 Jul 2008 20:40:05 +0200
changeset 27644 ddfba93b861f
child 27645 a1d7ee46387a
permissions -rwxr-xr-x
make Isabelle source distribution (via Mercurial);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27644
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     2
#
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     3
# $Id$
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     4
#
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     5
# makedist_mercurial -- make Isabelle source distribution (via Mercurial)
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     6
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     7
## global settings
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     8
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
     9
REPOS="http://isabelle.in.tum.de/isabelle-bin/mercurial.cgi"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    10
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    11
DISTPREFIX=${DISTPREFIX:-~/tmp/isadist}
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    12
TMP="tmp-$USER$$"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    13
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    14
umask 022
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    15
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    16
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    17
## diagnostics
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    18
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    19
PRG=$(basename "$0")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    20
THIS=$(cd $(dirname "$0"); echo "$PWD")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    21
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    22
function usage()
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    23
{
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    24
  cat <<EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    25
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    26
Usage: $PRG [OPTIONS] [VERSION]
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    27
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    28
  Options are:
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    29
    -r NAME         proper release with name"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    30
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    31
  FIXME Make Isabelle distribution from the master sources at TUM.
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    32
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    33
  VERSION may be either a tag like "IsabelleXXXX" that specifies the
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    34
  release to be exported from the repository, or "-" to checkout the
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    35
  current sources as an unofficial release.
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    36
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    37
  NAME specifies an explicit distribution name, by default it is
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    38
  derived from VERSION.
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    39
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    40
EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    41
  exit 1
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    42
}
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    43
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    44
function fail()
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    45
{
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    46
  echo "$1" >&2
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    47
  exit 2
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    48
}
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    49
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    50
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    51
## process command line
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    52
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    53
# options
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    54
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    55
RELEASE=""
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    56
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    57
while getopts "r:" OPT
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    58
do
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    59
  case "$OPT" in
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    60
    r)
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    61
      RELEASE="$OPTARG"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    62
      ;;
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    63
    \?)
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    64
      usage
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    65
      ;;
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    66
  esac
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    67
done
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    68
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    69
shift $(($OPTIND - 1))
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    70
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    71
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    72
# args
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    73
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    74
VERSION="tip"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    75
[ "$#" -gt 0 ] && { VERSION="$1"; shift; }
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    76
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    77
[ "$#" -gt 0 ] && usage
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    78
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    79
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    80
## main
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    81
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    82
# retrieve archive and resolve version identifier
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    83
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    84
mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    85
cd "$DISTPREFIX/$TMP"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    86
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    87
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    88
echo "### Retrieving $REPOS/archive/${VERSION}.tar.gz"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    89
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    90
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    91
{ wget -q "$REPOS/archive/${VERSION}.tar.gz" && tar -x -z -f "${VERSION}.tar.gz"; } || \
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    92
  fail "Failed to retrieve $VERSION"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    93
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    94
rm "${VERSION}.tar.gz"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    95
IDENT=$(echo * | sed 's/Isabelle-repository-//')
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    96
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    97
rm "Isabelle-repository-$IDENT/.hg_archival.txt"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    98
rm "Isabelle-repository-$IDENT/.hgtags"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
    99
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   100
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   101
# dist name
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   102
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   103
DATE=$(env LC_ALL=C date "+%d-%b-%Y")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   104
DISTDATE=$(env LC_ALL=C date "+%B %Y")
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   105
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   106
if [ -z "$RELEASE" ]; then
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   107
  DISTNAME="Isabelle_$DATE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   108
  DISTVERSION="Isabelle repository snapshot $IDENT ($DATE)"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   109
else
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   110
  DISTNAME="$RELEASE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   111
  DISTVERSION="$DISTNAME: $DISTDATE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   112
fi
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   113
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   114
DISTBASE="$DISTPREFIX/dist-$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   115
mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   116
[ -e "$DISTBASE/$DISTNAME" ] && fail "$DISTBASE/$DISTNAME already exists!"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   117
[ -e "$DISTBASE/pdf/$DISTNAME" ] && fail "$DISTBASE/pdf/$DISTNAME already exists!"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   118
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   119
cd "$DISTBASE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   120
mv "$DISTPREFIX/$TMP/Isabelle-repository-$IDENT" "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   121
rm -rf "$DISTPREFIX/$TMP"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   122
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   123
cd "$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   124
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   125
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   126
# website
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   127
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   128
mkdir -p ../website
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   129
cat > ../website/distinfo.mak <<EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   130
# this is a generated file - do not edit unless you know what you are doing!
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   131
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   132
DISTNAME=$DISTNAME
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   133
DISTBASE=$DISTBASE
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   134
EOF
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   135
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   136
cp lib/html/library_index_content.template ../website/
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   137
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   138
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   139
# prepare dist for release
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   140
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   141
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   142
echo "### Preparing distribution $DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   143
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   144
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   145
find . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -x
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   146
find . -print | xargs chmod u+rw
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   147
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   148
./Admin/build all || fail "Failed to build distribution"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   149
rm -rf Admin
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   150
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   151
MOVE=$(find doc-src \( -type f -a -not -type l -a -not -name isabelle_isar.pdf -a -not -name pghead.pdf -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf')
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   152
mv -f $MOVE doc
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   153
rm doc/Isa-logics.eps
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   154
rm doc/codegen_process.pdf
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   155
rm -rf doc-src
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   156
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   157
mkdir contrib
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   158
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   159
cp doc/isabelle*.eps lib/logo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   160
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   161
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   162
if [ -z "$RELEASE" ]; then
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   163
  {
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   164
    echo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   165
    echo "IMPORTANT NOTE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   166
    echo "=============="
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   167
    echo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   168
    echo "This is an unofficial snapshot of Isabelle, created by $LOGNAME $DATE."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   169
    echo "See $REPOS/log/$IDENT for details."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   170
    echo
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   171
  } >ANNOUNCE
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   172
else
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   173
  perl -pi -e "s/val is_official = false/val is_official = true/" src/Pure/ROOT.ML
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   174
fi
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   175
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   176
perl -pi -e "s/val changelog = \"\"/val changelog = \"$REPOS/log/$IDENT\"/" src/Pure/ROOT.ML
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   177
perl -pi -e "s/ISABELLE_IDENTIFIER=\"\"/ISABELLE_IDENTIFIER=\"$DISTNAME\"/g;" lib/scripts/getsettings
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   178
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/library_index_header.template
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   179
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML lib/Tools/version
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   180
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   181
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   182
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   183
# create archives
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   184
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   185
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   186
echo "### Creating archives ..."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   187
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   188
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   189
cd "$DISTBASE"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   190
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   191
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   192
echo "$IDENT" >../ISABELLE_IDENT
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   193
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   194
rm -f Isabelle
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   195
ln -s "$DISTNAME" Isabelle
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   196
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   197
chown -R "$LOGNAME" "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   198
chmod -R u+w "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   199
chmod -R g=o "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   200
chgrp -R isabelle "$DISTNAME" Isabelle
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   201
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   202
mkdir -p "pdf/$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   203
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   204
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   205
echo "$DISTNAME.tar.gz"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   206
tar -c -z -f "$DISTNAME.tar.gz" Isabelle "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   207
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   208
echo "${DISTNAME}_pdf.tar.gz"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   209
tar -C pdf -c -z -f "${DISTNAME}_pdf.tar.gz" "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   210
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   211
mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   212
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   213
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   214
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   215
# cleanup dist
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   216
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   217
mv "$DISTNAME" "${DISTNAME}-old"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   218
mkdir "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   219
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   220
mv "${DISTNAME}-old/README" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   221
  "${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   222
  "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   223
mkdir "$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   224
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   225
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   226
chgrp -R isabelle "$DISTNAME"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   227
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   228
rm -rf "${DISTNAME}-old"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   229
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   230
echo "###"
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   231
echo "### Finished makedist."
ddfba93b861f make Isabelle source distribution (via Mercurial);
wenzelm
parents:
diff changeset
   232
echo "###"