Admin/Release/makedist
author wenzelm
Fri, 17 Aug 2012 11:23:57 +0200
changeset 48835 574042d14fd9
parent 48790 6e739225dd8a
child 48972 196520d51afd
permissions -rwxr-xr-x
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     2
#
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     3
# makedist -- make Isabelle source distribution
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     4
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     5
## global settings
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
     6
47887
4e9c06c194d9 back to post-release mode -- after fork point;
wenzelm
parents: 47862
diff changeset
     7
REPOS_NAME="isabelle"
46929
f159e227703a corrected slip
haftmann
parents: 46926
diff changeset
     8
REPOS="${REPOS:-http://isabelle.in.tum.de/repos/${REPOS_NAME}}"
47011
1d8601c642cc more robust bash interpolation;
wenzelm
parents: 47010
diff changeset
     9
DISTPREFIX="${DISTPREFIX:-$HOME/tmp/isadist}"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    10
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    11
umask 022
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    12
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    13
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    14
## diagnostics
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    15
30885
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
    16
PRG="$(basename "$0")"
44152
a07748619f53 somewhat more uniform THIS;
wenzelm
parents: 43357
diff changeset
    17
THIS="$(cd $(dirname "$0"); pwd)"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    18
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    19
function usage()
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    20
{
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    21
  cat <<EOF
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    22
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    23
Usage: $PRG [OPTIONS] [VERSION]
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    24
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    25
  Options are:
43357
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
    26
    -j JEDIT_BUILD     build Isabelle/jEdit via given jedit_build component
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    27
    -r RELEASE         proper release with name"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    28
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    29
  Make Isabelle distribution from the main Mercurial repository at TUM.
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    30
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    31
  VERSION identifies the snapshot, using usual Mercurial terminology;
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    32
  the default is RELEASE if given, otherwise "tip".
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    33
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    34
EOF
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    35
  exit 1
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    36
}
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    37
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    38
function fail()
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    39
{
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    40
  echo "$1" >&2
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    41
  exit 2
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    42
}
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    43
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    44
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    45
## process command line
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    46
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    47
# options
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    48
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    49
RELEASE=""
43357
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
    50
ISABELLE_JEDIT_BUILD_HOME=""
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    51
48790
6e739225dd8a always retain doc-src (as regular component);
wenzelm
parents: 48606
diff changeset
    52
while getopts "j:r:" OPT
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    53
do
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    54
  case "$OPT" in
43357
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
    55
    j)
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
    56
      ISABELLE_JEDIT_BUILD_HOME="$OPTARG"
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
    57
      ;;
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    58
    r)
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    59
      RELEASE="$OPTARG"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    60
      ;;
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    61
    \?)
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    62
      usage
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    63
      ;;
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    64
  esac
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    65
done
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    66
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    67
shift $(($OPTIND - 1))
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    68
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    69
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    70
# args
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    71
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    72
VERSION=""
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    73
[ "$#" -gt 0 ] && { VERSION="$1"; shift; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    74
[ -z "$VERSION" ] && VERSION="$RELEASE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    75
[ -z "$VERSION" ] && VERSION="tip"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    76
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    77
[ "$#" -gt 0 ] && usage
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    78
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    79
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    80
## main
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    81
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    82
# tmp
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    83
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    84
TMP="tmp-$USER$$"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    85
function purge_tmp () { rm -rf "$DISTPREFIX/$TMP"; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    86
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    87
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    88
# retrieve archive and resolve version identifier
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    89
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    90
mkdir "$DISTPREFIX/$TMP" || fail "Failed to create fresh directory"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    91
cd "$DISTPREFIX/$TMP"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    92
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    93
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    94
echo "### Retrieving Mercurial repository $VERSION"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    95
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
    96
46930
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
    97
if expr match "$REPOS" "https\?://" > /dev/null
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
    98
then
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
    99
  { wget -q "$REPOS/archive/${VERSION}.tar.gz" -O- | tar -xzf -; } || \
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
   100
    fail "Failed to retrieve $VERSION"
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
   101
else
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
   102
  { hg --repository "$REPOS" archive --type tgz - | tar -xzf -; } || \
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
   103
    fail "Failed to retrieve $VERSION"
6d0a5549e2be support for non-HTTP repository locations (important for mira); quasi-hardwired repository name
haftmann
parents: 46929
diff changeset
   104
fi
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   105
33910
bae240a8bfe9 proper quotes;
wenzelm
parents: 33909
diff changeset
   106
IDENT=$(echo * | sed "s/${REPOS_NAME}-//")
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   107
33909
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   108
rm -f "${REPOS_NAME}-${IDENT}/.hg_archival.txt"
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   109
rm -f "${REPOS_NAME}-${IDENT}/.hgtags"
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   110
rm -f "${REPOS_NAME}-${IDENT}/.hgignore"
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   111
rm -f "${REPOS_NAME}-${IDENT}/README_REPOSITORY"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   112
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   113
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   114
# dist name
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   115
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   116
DATE=$(env LC_ALL=C date "+%d-%b-%Y")
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   117
DISTDATE=$(env LC_ALL=C date "+%B %Y")
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   118
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   119
if [ -z "$RELEASE" ]; then
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   120
  DISTNAME="Isabelle_$DATE"
40573
113ccf02d323 less parentheses, cf. Session.welcome;
wenzelm
parents: 37485
diff changeset
   121
  DISTVERSION="Isabelle repository snapshot $IDENT $DATE"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   122
else
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   123
  DISTNAME="$RELEASE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   124
  DISTVERSION="$DISTNAME: $DISTDATE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   125
fi
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   126
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   127
DISTBASE="$DISTPREFIX/dist-$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   128
mkdir -p "$DISTBASE" || { purge_tmp; fail "Unable to create distribution base dir $DISTBASE!"; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   129
[ -e "$DISTBASE/$DISTNAME" ] && { purge_tmp; fail "$DISTBASE/$DISTNAME already exists!"; }
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   130
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   131
cd "$DISTBASE"
33909
24a9d433eb7f more abstract handling of repository name;
wenzelm
parents: 33899
diff changeset
   132
mv "$DISTPREFIX/$TMP/${REPOS_NAME}-${IDENT}" "$DISTNAME"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   133
purge_tmp
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   134
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   135
cd "$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   136
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   137
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   138
# prepare dist for release
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   139
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   140
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   141
echo "### Preparing distribution $DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   142
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   143
30885
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
   144
rm -f .hgignore
47739
wenzelm
parents: 47011
diff changeset
   145
find . "(" -name \*.thy -o -name \*.ML -o -name \*.scala ")" -perm +111 -print | xargs chmod -f -x
30885
a3cfe0e27deb misc tuning and updates;
wenzelm
parents: 30884
diff changeset
   146
find . -print | xargs chmod -f u+rw
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   147
47010
ceba98191816 more ambitious scalac options for makedist;
wenzelm
parents: 46930
diff changeset
   148
perl -pi -e 's/^(ISABELLE_SCALA_BUILD_OPTIONS=")/$1-optimise /,' etc/settings
ceba98191816 more ambitious scalac options for makedist;
wenzelm
parents: 46930
diff changeset
   149
48790
6e739225dd8a always retain doc-src (as regular component);
wenzelm
parents: 48606
diff changeset
   150
cp -a doc-src doc-src.orig
48606
4b6c90e121b1 makedist -D retains doc-src component with its "doc" sessions (relevant for testing);
wenzelm
parents: 48190
diff changeset
   151
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   152
./Admin/build all || fail "Failed to build distribution"
43357
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   153
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   154
if [ -n "$ISABELLE_JEDIT_BUILD_HOME" ]; then
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   155
  [ -d "$ISABELLE_JEDIT_BUILD_HOME" ] || fail "Bad jedit_build component directory: \"$ISABELLE_JEDIT_BUILD_HOME\""
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   156
  eval "$(fgrep ISABELLE_JEDIT_BUILD_VERSION "$ISABELLE_JEDIT_BUILD_HOME/etc/settings")"
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   157
  [ -n "$ISABELLE_JEDIT_BUILD_VERSION" ] || fail "Bad ISABELLE_JEDIT_BUILD_VERSION"
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   158
  export ISABELLE_JEDIT_BUILD_HOME ISABELLE_JEDIT_BUILD_VERSION
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   159
  ./bin/isabelle jedit -b || fail "Failed to build Isabelle/jEdit"
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   160
fi
07889e32bc58 makedist -j: build Isabelle/jEdit via given jedit_build component;
wenzelm
parents: 41984
diff changeset
   161
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   162
rm -rf Admin
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   163
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   164
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')
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   165
mv -f $MOVE doc
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   166
rm doc/Isa-logics.eps
31842
af5221147455 discontinued separate "pdf" archive -- since it is now relatively small compared to the main archive, there is no point to fragment things;
wenzelm
parents: 30885
diff changeset
   167
rm doc/adaptation.dvi doc/adaptation.pdf doc/architecture.dvi doc/architecture.pdf
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   168
rm -rf doc-src
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   169
48790
6e739225dd8a always retain doc-src (as regular component);
wenzelm
parents: 48606
diff changeset
   170
mv doc-src.orig doc-src
48606
4b6c90e121b1 makedist -D retains doc-src component with its "doc" sessions (relevant for testing);
wenzelm
parents: 48190
diff changeset
   171
30140
wenzelm
parents: 30110
diff changeset
   172
mkdir -p contrib
37369
e0460bbf6b39 contrib/README;
wenzelm
parents: 37368
diff changeset
   173
cat >contrib/README <<EOF
e0460bbf6b39 contrib/README;
wenzelm
parents: 37368
diff changeset
   174
This directory contains add-on components that contribute to the main
e0460bbf6b39 contrib/README;
wenzelm
parents: 37368
diff changeset
   175
Isabelle distribution.  Separate licensing conditions apply, see each
e0460bbf6b39 contrib/README;
wenzelm
parents: 37368
diff changeset
   176
directory individually.
e0460bbf6b39 contrib/README;
wenzelm
parents: 37368
diff changeset
   177
EOF
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   178
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   179
cp doc/isabelle*.eps lib/logo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   180
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   181
if [ -z "$RELEASE" ]; then
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   182
  {
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   183
    echo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   184
    echo "IMPORTANT NOTE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   185
    echo "=============="
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   186
    echo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   187
    echo "This is an unofficial snapshot of Isabelle, created by $LOGNAME $DATE."
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   188
    echo "See $REPOS/log/$IDENT for details."
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   189
    echo
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   190
  } >ANNOUNCE
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   191
else
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   192
  perl -pi -e "s,val is_official = false,val is_official = true,g" src/Pure/ROOT.ML
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   193
fi
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   194
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   195
perl -pi -e "s,val changelog = \"\",val changelog = \"$REPOS/log/$IDENT\",g" src/Pure/ROOT.ML
41511
2fe62d602681 isabelle version -i;
wenzelm
parents: 40713
diff changeset
   196
perl -pi -e "s,ISABELLE_ID=\"\",ISABELLE_ID=\"$IDENT\",g" lib/scripts/getsettings
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   197
perl -pi -e "s,ISABELLE_IDENTIFIER=\"\",ISABELLE_IDENTIFIER=\"$DISTNAME\",g" lib/scripts/getsettings
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   198
perl -pi -e "s,{ISABELLE},$DISTNAME,g" lib/html/library_index_header.template
32361
141e5151b918 clarified situation about unidentified repository versions -- in a distributed setting there is not "the" repository;
wenzelm
parents: 31842
diff changeset
   199
perl -pi -e "s,unidentified repository version,$DISTVERSION,g" src/Pure/ROOT.ML lib/Tools/version
141e5151b918 clarified situation about unidentified repository versions -- in a distributed setting there is not "the" repository;
wenzelm
parents: 31842
diff changeset
   200
perl -pi -e "s,some unidentified repository version of Isabelle,$DISTVERSION,g" README
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   201
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   202
37341
wenzelm
parents: 37217
diff changeset
   203
# create archive
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   204
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   205
echo "###"
37341
wenzelm
parents: 37217
diff changeset
   206
echo "### Creating archive ..."
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   207
echo "###"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   208
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   209
cd "$DISTBASE"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   210
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   211
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   212
echo "$IDENT" >../ISABELLE_IDENT
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   213
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   214
chown -R "$LOGNAME" "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   215
chmod -R u+w "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   216
chmod -R g=o "$DISTNAME"
40713
7f745e4b7cce discontinued global "Isabelle" symlink, to make each distribution even more self-contained;
wenzelm
parents: 40573
diff changeset
   217
chgrp -R isabelle "$DISTNAME"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   218
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   219
echo "$DISTNAME.tar.gz"
40713
7f745e4b7cce discontinued global "Isabelle" symlink, to make each distribution even more self-contained;
wenzelm
parents: 40573
diff changeset
   220
tar -czf "$DISTNAME.tar.gz" "$DISTNAME"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   221
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   222
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   223
# cleanup dist
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   224
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   225
mv "$DISTNAME" "${DISTNAME}-old"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   226
mkdir "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   227
37368
1c816f2abb0e removed outdated/confusing INSTALL file;
wenzelm
parents: 37356
diff changeset
   228
mv "${DISTNAME}-old/README" "${DISTNAME}-old/NEWS" "${DISTNAME}-old/ANNOUNCE" \
1c816f2abb0e removed outdated/confusing INSTALL file;
wenzelm
parents: 37356
diff changeset
   229
  "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" "$DISTNAME"
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   230
mkdir "$DISTNAME/doc"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   231
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   232
41984
e5dba3d75e9e recover Isabelle symlink for public distribution, notably website;
wenzelm
parents: 41665
diff changeset
   233
rm -f Isabelle && ln -sf "$DISTNAME" Isabelle
e5dba3d75e9e recover Isabelle symlink for public distribution, notably website;
wenzelm
parents: 41665
diff changeset
   234
28932
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   235
chgrp -R isabelle "$DISTNAME"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   236
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   237
rm -rf "${DISTNAME}-old"
ccaa3355f7d3 makedist -- make Isabelle source distribution (Mercurial version);
wenzelm
parents:
diff changeset
   238
37341
wenzelm
parents: 37217
diff changeset
   239
echo "DONE"