author | kleing |
Tue, 21 Jun 2005 00:45:56 +0200 | |
changeset 16507 | ee552def8721 |
parent 16481 | fe61cdf5af51 |
child 16508 | 5e5945ae284c |
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 |
*) |
16165 | 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. |
16328 | 56 |
* Check ANNOUNCE, README, INSTALL, NEWS, COPYRIGHT, CONTRIBUTORS. |
11062 | 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!" |
15438 | 120 |
|
121 |
if [ -n "$CVS2CL" ]; then |
|
122 |
cd $DISTNAME |
|
123 |
$CVS2CL |
|
124 |
gzip ChangeLog |
|
125 |
mv ChangeLog.gz .. |
|
126 |
cd .. |
|
127 |
fi |
|
128 |
||
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
129 |
$FIND . -name CVS -print | xargs rm -rf |
12986 | 130 |
$FIND . -name .cvsignore -print | xargs rm -rf |
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
131 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
132 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
133 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
16286 | 134 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
135 |
$FIND . "(" -type d -a -empty ")" -print | xargs rm -rf |
|
2667 | 136 |
|
137 |
||
9797 | 138 |
# build docs |
2667 | 139 |
|
9797 | 140 |
echo "###" |
141 |
echo "### Building docs ..." |
|
142 |
echo "###" |
|
143 |
||
144 |
cd "$DISTBASE/$DISTNAME/Doc" |
|
6630 | 145 |
PDFLATEX=$(type -path pdflatex) |
3169 | 146 |
|
147 |
for DOC in $(cat Contents) |
|
2667 | 148 |
do |
9797 | 149 |
cd "$DOC" |
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
150 |
make dvi || fail "DVI document for $DOC failed!" |
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
151 |
([ -n "$PDFLATEX" ] && make clean pdf) || fail "PDF document for $DOC failed!" |
3169 | 152 |
cd .. |
2667 | 153 |
done |
154 |
||
9052 | 155 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
156 |
# prepare dist dir for release |
8059 | 157 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
158 |
echo "###" |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
159 |
echo "### Preparing distribution ..." |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
160 |
echo "###" |
2667 | 161 |
|
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
162 |
cd "$DISTBASE/$DISTNAME" || fail "Something is wrong: dist directory doesn't exist!" |
2667 | 163 |
|
16301 | 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 .. |
|
172 |
mkdir -p ../website/conf |
|
173 |
cat > ../website/conf/distname.mak <<EOF |
|
174 |
# this is a generated file - do not edit unless you know what you are doing |
|
175 |
||
176 |
DISTNAME=$DISTNAME |
|
177 |
EOF |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
178 |
|
16481 | 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') |
6630 | 180 |
mv -f $MOVE Distribution/doc |
3305 | 181 |
rm Distribution/doc/Isa-logics.eps |
9052 | 182 |
rm -rf Doc Tools |
2667 | 183 |
|
7115 | 184 |
mkdir src contrib |
2667 | 185 |
mv $LOGICS src |
186 |
||
187 |
mv Distribution/* . |
|
188 |
rmdir Distribution |
|
189 |
||
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
190 |
( cd lib/browser; make; ) || fail "Graph browser build failed!" |
3638 | 191 |
|
5385 | 192 |
cp doc/isabelle*.eps lib/logo |
193 |
||
3638 | 194 |
|
2667 | 195 |
if [ -n "$UNOFFICIAL" ]; then |
196 |
{ |
|
197 |
echo |
|
198 |
echo "IMPORTANT NOTE" |
|
199 |
echo "==============" |
|
200 |
echo |
|
9925 | 201 |
echo "This is an $UNOFFICIAL release of Isabelle, created by $LOGNAME $DATE." |
2667 | 202 |
echo |
9925 | 203 |
} >ANNOUNCE |
2667 | 204 |
fi |
205 |
||
8810 | 206 |
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html |
9959 | 207 |
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
|
208 |
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" lib/Tools/version |
4986 | 209 |
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html |
3257 | 210 |
lynx -dump README.html >README |
211 |
||
9052 | 212 |
( cd src; ../Admin/maketags; ) |
10077 | 213 |
|
9052 | 214 |
rm -rf Admin |
16286 | 215 |
rm -f TODO |
9052 | 216 |
|
2667 | 217 |
|
218 |
# create archive |
|
219 |
||
9797 | 220 |
echo "###" |
221 |
echo "### Creating archives ..." |
|
222 |
echo "###" |
|
2667 | 223 |
|
9797 | 224 |
cd "$DISTBASE" |
225 |
||
10087 | 226 |
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST |
227 |
||
10068 | 228 |
rm -f Isabelle |
229 |
ln -s "$DISTNAME" Isabelle |
|
230 |
||
9797 | 231 |
chown -R "$LOGNAME" "$DISTNAME" |
232 |
chmod -R u+w "$DISTNAME" |
|
233 |
chmod -R g=o "$DISTNAME" |
|
10077 | 234 |
chgrp -R isabelle "$DISTNAME" Isabelle |
2667 | 235 |
|
9797 | 236 |
mkdir -p "pdf/$DISTNAME/doc" |
237 |
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc" |
|
6748 | 238 |
|
10928 | 239 |
page/bin/mkcontents "$DISTNAME/doc/Contents" "pdf/$DISTNAME/doc/index" |
240 |
cat > "pdf/$DISTNAME/doc/index.html" <<EOF |
|
241 |
<html> |
|
242 |
<head> |
|
243 |
<title>$DISTNAME Documentation</title> |
|
244 |
</head> |
|
245 |
<body> |
|
246 |
<h1>$DISTNAME Documentation</h1> |
|
247 |
$(cat "pdf/$DISTNAME/doc/index") |
|
248 |
</body> |
|
249 |
</html> |
|
250 |
EOF |
|
251 |
rm "pdf/$DISTNAME/doc/index" |
|
252 |
||
10096 | 253 |
echo "$DISTNAME.tar.gz" |
10077 | 254 |
"$TAR" cf "$DISTNAME.tar" Isabelle "$DISTNAME" |
10096 | 255 |
gzip "$DISTNAME.tar" |
256 |
||
257 |
echo "${DISTNAME}_pdf.tar.gz" |
|
10112 | 258 |
( cd pdf; "$TAR" cf "../${DISTNAME}_pdf.tar" "$DISTNAME"; ) |
10096 | 259 |
gzip "${DISTNAME}_pdf.tar" |
6748 | 260 |
|
10928 | 261 |
mv "pdf/$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc/index.html" "$DISTNAME/doc" |
9797 | 262 |
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf |
6750 | 263 |
|
6304 | 264 |
|
9782 | 265 |
# cleanup dist |
266 |
||
9797 | 267 |
mv "$DISTNAME" "${DISTNAME}-old" |
268 |
mkdir "$DISTNAME" |
|
9782 | 269 |
|
16328 | 270 |
mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \ |
271 |
"${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \ |
|
272 |
"$DISTNAME" |
|
9797 | 273 |
mkdir "$DISTNAME/doc" |
10928 | 274 |
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/index.html" "$DISTNAME/doc" |
9782 | 275 |
|
9867 | 276 |
chgrp -R isabelle "$DISTNAME" |
277 |
||
9797 | 278 |
rm -rf "${DISTNAME}-old" |
9782 | 279 |
|
280 |
||
2667 | 281 |
# final note |
282 |
||
9797 | 283 |
echo "###" |
10112 | 284 |
echo "### Finished makedist." |
9797 | 285 |
echo "###" |