author | wenzelm |
Fri, 30 May 2008 23:26:51 +0200 | |
changeset 27029 | 0006d6a6d21d |
parent 26372 | f882403f0d56 |
child 27090 | 2f45c1b1b05d |
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 |
||
17554 | 10 |
DISTPREFIX=${DISTPREFIX:-~/tmp/isadist} |
23149 | 11 |
SRCS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents Tools ZF" |
2667 | 12 |
|
26372 | 13 |
export CVSROOT=/home/isabelle-repository/archive |
26370
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
14 |
[ ! -d "$CVSROOT" ] && CVSROOT="${ISABELLE_USER:-$USER}@atbroy100.informatik.tu-muenchen.de:$CVSROOT" |
2667 | 15 |
|
9797 | 16 |
umask 022 |
17 |
||
26370
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
18 |
|
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
19 |
## executables |
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
20 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
21 |
TAR=tar |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
22 |
type -path gtar >/dev/null && TAR=gtar |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
23 |
|
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
24 |
FIND=find |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
25 |
type -path gfind >/dev/null && FIND=gfind |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
26 |
|
26370
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
27 |
[ -z "$CVS2CL" ] && type -path cvs2cl && CVS2CL=cvs2cl |
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
28 |
|
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
29 |
#paranoia setting for sunbroy |
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
30 |
PATH="/usr/local/dist/DIR/j2sdk1.5.0/bin:$PATH" |
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
31 |
|
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
32 |
PATH="/home/scala/bin:$PATH" |
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
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 |
|
17554 | 44 |
Usage: $PRG VERSION [NAME] |
11062 | 45 |
|
2667 | 46 |
Make Isabelle distribution from the master sources at TUM. |
47 |
||
17693 | 48 |
VERSION may be either a tag like "IsabelleXXXX" that specifies the |
2667 | 49 |
release to be exported from the repository, or "-" to checkout the |
17554 | 50 |
current sources as an unofficial release. |
51 |
||
52 |
NAME specifies an explicit distribution name, by default it is |
|
53 |
derived from VERSION. |
|
2667 | 54 |
|
55 |
Checklist for official releases (before running this script): |
|
56 |
||
25214 | 57 |
* Check ANNOUNCE, README, INSTALL, NEWS, COPYRIGHT, CONTRIBUTORS. |
11062 | 58 |
* Try "isatool makeall all" with Poly/ML, SML/NJ, etc. |
2667 | 59 |
* Tag the current repository version, e.g.: |
26370
2a4f0d0621f1
remote CVSROOT: default to atbroy100 instead of sunbroy2;
wenzelm
parents:
26133
diff
changeset
|
60 |
cvs -d /home/isabelle-repository/archive rtag IsabelleXXXX isabelle |
11062 | 61 |
PLEASE DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING! |
5727 | 62 |
|
25237 | 63 |
After running this script: |
64 |
||
65 |
* Symlink generated files in website/ directory to their appropriate |
|
66 |
places in the isabelle website sources. |
|
67 |
||
2667 | 68 |
EOF |
69 |
exit 1 |
|
70 |
} |
|
71 |
||
72 |
function fail() |
|
73 |
{ |
|
74 |
echo "$1" >&2 |
|
75 |
exit 2 |
|
76 |
} |
|
77 |
||
78 |
||
79 |
## process command line |
|
80 |
||
17554 | 81 |
[ "$#" -ne 1 -a "$#" -ne 2 ] && usage |
82 |
||
83 |
VERSION="$1"; shift |
|
2667 | 84 |
|
17554 | 85 |
if [ "$#" -eq 0 ]; then |
86 |
DISTNAME="" |
|
87 |
else |
|
88 |
DISTNAME="$1"; shift |
|
89 |
fi |
|
2667 | 90 |
|
91 |
||
92 |
## main |
|
93 |
||
94 |
# dist version |
|
95 |
||
21712
8b2fd895a7fc
date: forcing LC_ALL=C prevents funny file names;
wenzelm
parents:
20990
diff
changeset
|
96 |
DATE=$(env LC_ALL=C date "+%d-%b-%Y") |
8b2fd895a7fc
date: forcing LC_ALL=C prevents funny file names;
wenzelm
parents:
20990
diff
changeset
|
97 |
DISTDATE=$(env LC_ALL=C date "+%B %Y") |
2667 | 98 |
|
17554 | 99 |
if [ "$VERSION" = "-" ]; then |
100 |
DISTIDENT="Isabelle_$DATE" |
|
101 |
[ -z "$DISTNAME" ] && DISTNAME="$DISTIDENT" |
|
9797 | 102 |
DISTVERSION="$DISTNAME" |
103 |
EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle" |
|
17558 | 104 |
UNOFFICIAL=true |
2667 | 105 |
else |
17554 | 106 |
DISTIDENT="$VERSION" |
107 |
[ -z "$DISTNAME" ] && DISTNAME="$DISTIDENT" |
|
4982 | 108 |
DISTVERSION="$DISTNAME: $DISTDATE" |
17561 | 109 |
EXPORT="cvs -f -q export -r $VERSION -d $DISTNAME isabelle" |
2667 | 110 |
UNOFFICIAL="" |
111 |
fi |
|
112 |
||
9797 | 113 |
DISTBASE="$DISTPREFIX/dist-$DISTNAME" |
114 |
mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!" |
|
115 |
[ -e "$DISTBASE/$DISTNAME" ] && fail "$DISTBASE/$DISTNAME already exists!" |
|
116 |
[ -e "$DISTBASE/pdf/$DISTNAME" ] && fail "$DISTBASE/pdf/$DISTNAME already exists!" |
|
2667 | 117 |
|
118 |
||
9797 | 119 |
# export repository |
2667 | 120 |
|
9797 | 121 |
echo "###" |
17554 | 122 |
echo "### Exporting $DISTIDENT ..." |
9797 | 123 |
echo "###" |
2667 | 124 |
|
9797 | 125 |
cd "$DISTBASE" |
2667 | 126 |
|
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
127 |
$EXPORT || fail "Export failed!" |
15438 | 128 |
|
27029 | 129 |
if [ -n "$CVS2CL" -a -n "$UNOFFICIAL" ]; then |
15438 | 130 |
cd $DISTNAME |
131 |
$CVS2CL |
|
132 |
gzip ChangeLog |
|
26108 | 133 |
cp ChangeLog.gz .. |
15438 | 134 |
cd .. |
135 |
fi |
|
136 |
||
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
137 |
$FIND . -name CVS -print | xargs rm -rf |
12986 | 138 |
$FIND . -name .cvsignore -print | xargs rm -rf |
17554 | 139 |
$FIND . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -x |
23895 | 140 |
$FIND . -print | xargs chmod u+rw |
2667 | 141 |
|
142 |
||
9797 | 143 |
# build docs |
2667 | 144 |
|
9797 | 145 |
echo "###" |
146 |
echo "### Building docs ..." |
|
147 |
echo "###" |
|
148 |
||
149 |
cd "$DISTBASE/$DISTNAME/Doc" |
|
6630 | 150 |
PDFLATEX=$(type -path pdflatex) |
3169 | 151 |
|
152 |
for DOC in $(cat Contents) |
|
2667 | 153 |
do |
20990 | 154 |
pushd "$DOC" > /dev/null |
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
155 |
make dvi || fail "DVI document for $DOC failed!" |
17554 | 156 |
{ [ -n "$PDFLATEX" ] && make clean pdf; } || fail "PDF document for $DOC failed!" |
20990 | 157 |
popd |
2667 | 158 |
done |
159 |
||
9052 | 160 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
161 |
# prepare dist dir for release |
8059 | 162 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
163 |
echo "###" |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
164 |
echo "### Preparing distribution ..." |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
165 |
echo "###" |
2667 | 166 |
|
17554 | 167 |
cd "$DISTBASE/$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME" |
2667 | 168 |
|
25237 | 169 |
mkdir -p ../website |
170 |
cat > ../website/distinfo.mak <<EOF |
|
17942
68988fd2fd27
towards an improved website/makedist integration
haftmann
parents:
17910
diff
changeset
|
171 |
# this is a generated file - do not edit unless you know what you are doing! |
16301 | 172 |
|
173 |
DISTNAME=$DISTNAME |
|
17554 | 174 |
DISTIDENT=$DISTIDENT |
17910 | 175 |
DISTBASE=$DISTBASE |
16301 | 176 |
EOF |
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
177 |
|
25237 | 178 |
cp Distribution/lib/html/library_index_content.template ../website/ |
179 |
||
23160 | 180 |
MOVE=$($FIND Doc \( -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') |
6630 | 181 |
mv -f $MOVE Distribution/doc |
3305 | 182 |
rm Distribution/doc/Isa-logics.eps |
23201 | 183 |
rm -rf Doc |
2667 | 184 |
|
7115 | 185 |
mkdir src contrib |
23149 | 186 |
mv $SRCS src |
2667 | 187 |
|
188 |
mv Distribution/* . |
|
189 |
rmdir Distribution |
|
190 |
||
25949
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
191 |
|
25856 | 192 |
( cd lib/browser; make; ) || fail "Failed to build graph browser!" |
193 |
||
25949
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
194 |
( cd lib/classes; ./mk; ) |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
195 |
[ -f lib/classes/isabelle.jar ] || fail "Failed to build Isabelle process wrapper!" |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
196 |
|
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
197 |
if type -p scalac >/dev/null |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
198 |
then |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
199 |
( cd lib/jedit/plugin; ./mk; ) |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
200 |
[ -f lib/jedit/isabelle.jar ] || fail "Failed to build jEdit plugin!" |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
201 |
else |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
202 |
echo "Warning: Scala unavailable -- skipping jEdit plugin" |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
203 |
fi |
850b4c2d0f17
reactivated mk of java/scala sources, with paranoia PATH setting for sunbroy;
wenzelm
parents:
25859
diff
changeset
|
204 |
|
3638 | 205 |
|
5385 | 206 |
cp doc/isabelle*.eps lib/logo |
207 |
||
3638 | 208 |
|
2667 | 209 |
if [ -n "$UNOFFICIAL" ]; then |
210 |
{ |
|
211 |
echo |
|
212 |
echo "IMPORTANT NOTE" |
|
213 |
echo "==============" |
|
214 |
echo |
|
17554 | 215 |
echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE." |
2667 | 216 |
echo |
9925 | 217 |
} >ANNOUNCE |
26133 | 218 |
perl -pi -e "s/val is_official = true/val is_official = false/" src/Pure/ROOT.ML |
2667 | 219 |
fi |
220 |
||
25433 | 221 |
perl -pi -e "s/ISABELLE_IDENTIFIER=\"\"/ISABELLE_IDENTIFIER=\"$DISTNAME\"/g;" lib/scripts/getsettings |
25237 | 222 |
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/library_index_header.template |
17554 | 223 |
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML lib/Tools/version |
25214 | 224 |
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README |
3257 | 225 |
|
9052 | 226 |
( cd src; ../Admin/maketags; ) |
10077 | 227 |
|
9052 | 228 |
rm -rf Admin |
16286 | 229 |
rm -f TODO |
9052 | 230 |
|
2667 | 231 |
|
232 |
# create archive |
|
233 |
||
9797 | 234 |
echo "###" |
235 |
echo "### Creating archives ..." |
|
236 |
echo "###" |
|
2667 | 237 |
|
9797 | 238 |
cd "$DISTBASE" |
239 |
||
10087 | 240 |
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST |
241 |
||
10068 | 242 |
rm -f Isabelle |
243 |
ln -s "$DISTNAME" Isabelle |
|
244 |
||
9797 | 245 |
chown -R "$LOGNAME" "$DISTNAME" |
246 |
chmod -R u+w "$DISTNAME" |
|
247 |
chmod -R g=o "$DISTNAME" |
|
10077 | 248 |
chgrp -R isabelle "$DISTNAME" Isabelle |
2667 | 249 |
|
9797 | 250 |
mkdir -p "pdf/$DISTNAME/doc" |
17655 | 251 |
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc" |
252 |
||
253 |
sync; sleep 3 |
|
6748 | 254 |
|
10096 | 255 |
echo "$DISTNAME.tar.gz" |
10077 | 256 |
"$TAR" cf "$DISTNAME.tar" Isabelle "$DISTNAME" |
10096 | 257 |
gzip "$DISTNAME.tar" |
258 |
||
259 |
echo "${DISTNAME}_pdf.tar.gz" |
|
10112 | 260 |
( cd pdf; "$TAR" cf "../${DISTNAME}_pdf.tar" "$DISTNAME"; ) |
10096 | 261 |
gzip "${DISTNAME}_pdf.tar" |
6748 | 262 |
|
17655 | 263 |
mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc" |
9797 | 264 |
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf |
6750 | 265 |
|
6304 | 266 |
|
9782 | 267 |
# cleanup dist |
268 |
||
9797 | 269 |
mv "$DISTNAME" "${DISTNAME}-old" |
270 |
mkdir "$DISTNAME" |
|
9782 | 271 |
|
25214 | 272 |
mv "${DISTNAME}-old/README" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \ |
17554 | 273 |
"${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \ |
274 |
"$DISTNAME" |
|
9797 | 275 |
mkdir "$DISTNAME/doc" |
17655 | 276 |
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc" |
9782 | 277 |
|
9867 | 278 |
chgrp -R isabelle "$DISTNAME" |
279 |
||
9797 | 280 |
rm -rf "${DISTNAME}-old" |
9782 | 281 |
|
282 |
||
2667 | 283 |
# final note |
284 |
||
9797 | 285 |
echo "###" |
10112 | 286 |
echo "### Finished makedist." |
9797 | 287 |
echo "###" |