author | ballarin |
Thu, 19 Feb 2004 16:44:21 +0100 | |
changeset 14399 | dc677b35e54f |
parent 13803 | 84cb1ff80f25 |
child 15438 | dfc7d2a824d6 |
permissions | -rwxr-xr-x |
12721 | 1 |
#!/usr/bin/env bash |
2667 | 2 |
# |
3 |
# $Id$ |
|
4 |
# |
|
10077 | 5 |
# makedist -- make Isabelle source distribution. |
2667 | 6 |
|
7 |
||
8 |
## global settings |
|
9 |
||
7993 | 10 |
LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL ZF" |
2667 | 11 |
|
10533 | 12 |
case $(hostname) in |
11981 | 13 |
*lapbroy*) |
13100
ff00791319e2
physical location of isabelle repository is now sunbroy2
kleing
parents:
13050
diff
changeset
|
14 |
export CVSROOT=sunbroy2:/usr/proj/isabelle-repository/archive |
11981 | 15 |
;; |
10532 | 16 |
*broy*) |
17 |
export CVSROOT=/usr/proj/isabelle-repository/archive |
|
18 |
;; |
|
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
19 |
*) |
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
20 |
export CVSROOT=sunbroy2.informatik.tu-muenchen.de:/usr/proj/isabelle-repository/archive |
10532 | 21 |
;; |
22 |
esac |
|
23 |
||
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
24 |
DISTPREFIX=${DISTPREFIX:-~/tmp/isadist} |
2667 | 25 |
|
9797 | 26 |
umask 022 |
27 |
||
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
28 |
TAR=tar |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
29 |
type -path gtar >/dev/null && TAR=gtar |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
30 |
|
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
31 |
FIND=find |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
32 |
type -path gfind >/dev/null && FIND=gfind |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
33 |
|
2667 | 34 |
|
35 |
## diagnostics |
|
36 |
||
9797 | 37 |
PRG=$(basename "$0") |
38 |
THIS=$(cd $(dirname "$0"); echo "$PWD") |
|
2667 | 39 |
|
40 |
function usage() |
|
41 |
{ |
|
42 |
cat <<EOF |
|
11062 | 43 |
|
44 |
Usage: $PRG VERSION |
|
45 |
||
2667 | 46 |
Make Isabelle distribution from the master sources at TUM. |
47 |
||
13050 | 48 |
VERSION may be either a tag like "Isabelle2002-XX" that specifies the |
2667 | 49 |
release to be exported from the repository, or "-" to checkout the |
9797 | 50 |
current sources as an unofficial release, or "--" to produce a |
51 |
tentative release from the present copy of the Isabelle repository. |
|
2667 | 52 |
|
53 |
Checklist for official releases (before running this script): |
|
54 |
||
11062 | 55 |
* Check Admin/page contents. |
56 |
* Check ANNOUNCE, README, INSTALL, NEWS. |
|
57 |
* Try "isatool makeall all" with Poly/ML, SML/NJ, etc. |
|
2667 | 58 |
* Tag the current repository version, e.g.: |
13050 | 59 |
cvs -d /usr/proj/isabelle-repository/archive rtag Isabelle2002 isabelle |
11062 | 60 |
PLEASE DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING! |
5727 | 61 |
|
2667 | 62 |
EOF |
63 |
exit 1 |
|
64 |
} |
|
65 |
||
66 |
function fail() |
|
67 |
{ |
|
68 |
echo "$1" >&2 |
|
69 |
exit 2 |
|
70 |
} |
|
71 |
||
72 |
||
73 |
## process command line |
|
74 |
||
9797 | 75 |
[ "$#" -ne 1 ] && usage |
2667 | 76 |
|
77 |
VERSION="$1" |
|
78 |
shift |
|
79 |
||
80 |
||
81 |
## main |
|
82 |
||
83 |
# dist version |
|
84 |
||
85 |
DATE=$(date "+%d-%b-%Y") |
|
4979 | 86 |
DISTDATE=$(date "+%B %Y") |
2667 | 87 |
|
9797 | 88 |
if [ "$VERSION" = "--" ]; then |
9925 | 89 |
DISTNAME="Isabelle_$DATE" |
4982 | 90 |
DISTVERSION="$DISTNAME" |
9797 | 91 |
EXPORT="$THIS/cvs-copy $THIS/.. $DISTNAME" |
9925 | 92 |
UNOFFICIAL="unofficial test" |
9797 | 93 |
elif [ "$VERSION" = "-" ]; then |
94 |
DISTNAME="Isabelle_$DATE" |
|
95 |
DISTVERSION="$DISTNAME" |
|
96 |
EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle" |
|
9925 | 97 |
UNOFFICIAL="unofficial" |
2667 | 98 |
else |
99 |
DISTNAME="$VERSION" |
|
4982 | 100 |
DISTVERSION="$DISTNAME: $DISTDATE" |
9797 | 101 |
EXPORT="cvs -f -q export -r $VERSION -d $DISTNAME isabelle" |
2667 | 102 |
UNOFFICIAL="" |
103 |
fi |
|
104 |
||
9797 | 105 |
DISTBASE="$DISTPREFIX/dist-$DISTNAME" |
106 |
mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!" |
|
107 |
[ -e "$DISTBASE/$DISTNAME" ] && fail "$DISTBASE/$DISTNAME already exists!" |
|
108 |
[ -e "$DISTBASE/pdf/$DISTNAME" ] && fail "$DISTBASE/pdf/$DISTNAME already exists!" |
|
2667 | 109 |
|
110 |
||
9797 | 111 |
# export repository |
2667 | 112 |
|
9797 | 113 |
echo "###" |
114 |
echo "### Exporting $DISTNAME ..." |
|
115 |
echo "###" |
|
2667 | 116 |
|
9797 | 117 |
cd "$DISTBASE" |
2667 | 118 |
|
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
119 |
$EXPORT || fail "Export failed!" |
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
120 |
$FIND . -name CVS -print | xargs rm -rf |
12986 | 121 |
$FIND . -name .cvsignore -print | xargs rm -rf |
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
122 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
123 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
124 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
2667 | 125 |
|
126 |
||
9797 | 127 |
# build docs |
2667 | 128 |
|
9797 | 129 |
echo "###" |
130 |
echo "### Building docs ..." |
|
131 |
echo "###" |
|
132 |
||
133 |
cd "$DISTBASE/$DISTNAME/Doc" |
|
6630 | 134 |
PDFLATEX=$(type -path pdflatex) |
3169 | 135 |
|
136 |
for DOC in $(cat Contents) |
|
2667 | 137 |
do |
9797 | 138 |
cd "$DOC" |
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
139 |
make dvi || fail "DVI document for $DOC failed!" |
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
140 |
([ -n "$PDFLATEX" ] && make clean pdf) || fail "PDF document for $DOC failed!" |
3169 | 141 |
cd .. |
2667 | 142 |
done |
143 |
||
9052 | 144 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
145 |
# prepare dist dir for release |
8059 | 146 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
147 |
echo "###" |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
148 |
echo "### Preparing distribution ..." |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
149 |
echo "###" |
2667 | 150 |
|
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
151 |
cd "$DISTBASE/$DISTNAME" || fail "Something is wrong: dist directory doesn't exist!" |
2667 | 152 |
|
9925 | 153 |
cp -R Admin/page .. |
154 |
cp Distribution/doc/Contents ../page |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
155 |
cp Distribution/lib/logo/isabelle.gif ../page/main-content |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
156 |
cp Distribution/lib/logo/isabelle.gif ../page/dist-content |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
157 |
echo "$DISTNAME" > ../page/DISTNAME |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
158 |
|
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
159 |
MOVE=$($FIND Doc \( -type f -a \( -name \*.dvi -o -name \*.eps -o -name \*.ps -o -name \*.pdf \) -a -print \) | grep -v 'gfx/.*pdf') |
6630 | 160 |
mv -f $MOVE Distribution/doc |
3305 | 161 |
rm Distribution/doc/Isa-logics.eps |
9052 | 162 |
rm -rf Doc Tools |
2667 | 163 |
|
7115 | 164 |
mkdir src contrib |
2667 | 165 |
mv $LOGICS src |
166 |
||
167 |
mv Distribution/* . |
|
168 |
rmdir Distribution |
|
169 |
||
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
170 |
( cd lib/browser; make; ) || fail "Graph browser build failed!" |
3638 | 171 |
|
5385 | 172 |
cp doc/isabelle*.eps lib/logo |
173 |
||
3638 | 174 |
|
2667 | 175 |
if [ -n "$UNOFFICIAL" ]; then |
176 |
{ |
|
177 |
echo |
|
178 |
echo "IMPORTANT NOTE" |
|
179 |
echo "==============" |
|
180 |
echo |
|
9925 | 181 |
echo "This is an $UNOFFICIAL release of Isabelle, created by $LOGNAME $DATE." |
2667 | 182 |
echo |
9925 | 183 |
} >ANNOUNCE |
2667 | 184 |
fi |
185 |
||
8810 | 186 |
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html |
9959 | 187 |
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML |
13803
84cb1ff80f25
Fill in version information in lib/Tools/version.
berghofe
parents:
13230
diff
changeset
|
188 |
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" lib/Tools/version |
4986 | 189 |
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html |
3257 | 190 |
lynx -dump README.html >README |
191 |
||
9052 | 192 |
( cd src; ../Admin/maketags; ) |
10077 | 193 |
|
9052 | 194 |
rm -rf Admin |
195 |
||
2667 | 196 |
|
197 |
# create archive |
|
198 |
||
9797 | 199 |
echo "###" |
200 |
echo "### Creating archives ..." |
|
201 |
echo "###" |
|
2667 | 202 |
|
9797 | 203 |
cd "$DISTBASE" |
204 |
||
10087 | 205 |
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST |
206 |
||
10068 | 207 |
rm -f Isabelle |
208 |
ln -s "$DISTNAME" Isabelle |
|
209 |
||
9797 | 210 |
chown -R "$LOGNAME" "$DISTNAME" |
211 |
chmod -R u+w "$DISTNAME" |
|
212 |
chmod -R g=o "$DISTNAME" |
|
10077 | 213 |
chgrp -R isabelle "$DISTNAME" Isabelle |
2667 | 214 |
|
9797 | 215 |
mkdir -p "pdf/$DISTNAME/doc" |
216 |
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc" |
|
6748 | 217 |
|
10928 | 218 |
page/bin/mkcontents "$DISTNAME/doc/Contents" "pdf/$DISTNAME/doc/index" |
219 |
cat > "pdf/$DISTNAME/doc/index.html" <<EOF |
|
220 |
<html> |
|
221 |
<head> |
|
222 |
<title>$DISTNAME Documentation</title> |
|
223 |
</head> |
|
224 |
<body> |
|
225 |
<h1>$DISTNAME Documentation</h1> |
|
226 |
$(cat "pdf/$DISTNAME/doc/index") |
|
227 |
</body> |
|
228 |
</html> |
|
229 |
EOF |
|
230 |
rm "pdf/$DISTNAME/doc/index" |
|
231 |
||
10096 | 232 |
echo "$DISTNAME.tar.gz" |
10077 | 233 |
"$TAR" cf "$DISTNAME.tar" Isabelle "$DISTNAME" |
10096 | 234 |
gzip "$DISTNAME.tar" |
235 |
||
236 |
echo "${DISTNAME}_pdf.tar.gz" |
|
10112 | 237 |
( cd pdf; "$TAR" cf "../${DISTNAME}_pdf.tar" "$DISTNAME"; ) |
10096 | 238 |
gzip "${DISTNAME}_pdf.tar" |
6748 | 239 |
|
10928 | 240 |
mv "pdf/$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc/index.html" "$DISTNAME/doc" |
9797 | 241 |
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf |
6750 | 242 |
|
6304 | 243 |
|
9782 | 244 |
# cleanup dist |
245 |
||
9797 | 246 |
mv "$DISTNAME" "${DISTNAME}-old" |
247 |
mkdir "$DISTNAME" |
|
9782 | 248 |
|
10017 | 249 |
mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" "${DISTNAME}-old/ANNOUNCE" "$DISTNAME" |
9797 | 250 |
mkdir "$DISTNAME/doc" |
10928 | 251 |
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/index.html" "$DISTNAME/doc" |
9782 | 252 |
|
9867 | 253 |
chgrp -R isabelle "$DISTNAME" |
254 |
||
9797 | 255 |
rm -rf "${DISTNAME}-old" |
9782 | 256 |
|
257 |
||
2667 | 258 |
# final note |
259 |
||
9797 | 260 |
echo "###" |
10112 | 261 |
echo "### Finished makedist." |
9797 | 262 |
echo "###" |