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