author | krauss |
Tue, 23 Jan 2007 20:29:03 +0100 | |
changeset 22170 | 5682eeaefaf4 |
parent 21712 | 8b2fd895a7fc |
child 23149 | ddc5800b699f |
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} |
7993 | 11 |
LOGICS="CCL CTT Cube FOL FOLP HOL HOLCF LCF Provers Pure Sequents TFL 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 |
||
20990 | 47 |
* Symlink website to Admin/website |
17554 | 48 |
* Check Admin/website contents. |
49 |
* Check ANNOUNCE, README.html, INSTALL, NEWS, COPYRIGHT, CONTRIBUTORS. |
|
11062 | 50 |
* Try "isatool makeall all" with Poly/ML, SML/NJ, etc. |
2667 | 51 |
* Tag the current repository version, e.g.: |
17693 | 52 |
cvs -d /usr/proj/isabelle-repository/archive rtag IsabelleXXXX isabelle |
11062 | 53 |
PLEASE DO NOT DO THIS UNLESS YOU KNOW WHAT YOU ARE DOING! |
5727 | 54 |
|
2667 | 55 |
EOF |
56 |
exit 1 |
|
57 |
} |
|
58 |
||
59 |
function fail() |
|
60 |
{ |
|
61 |
echo "$1" >&2 |
|
62 |
exit 2 |
|
63 |
} |
|
64 |
||
65 |
||
66 |
## process command line |
|
67 |
||
17554 | 68 |
[ "$#" -ne 1 -a "$#" -ne 2 ] && usage |
69 |
||
70 |
VERSION="$1"; shift |
|
2667 | 71 |
|
17554 | 72 |
if [ "$#" -eq 0 ]; then |
73 |
DISTNAME="" |
|
74 |
else |
|
75 |
DISTNAME="$1"; shift |
|
76 |
fi |
|
2667 | 77 |
|
78 |
||
79 |
## main |
|
80 |
||
81 |
# dist version |
|
82 |
||
21712
8b2fd895a7fc
date: forcing LC_ALL=C prevents funny file names;
wenzelm
parents:
20990
diff
changeset
|
83 |
DATE=$(env LC_ALL=C date "+%d-%b-%Y") |
8b2fd895a7fc
date: forcing LC_ALL=C prevents funny file names;
wenzelm
parents:
20990
diff
changeset
|
84 |
DISTDATE=$(env LC_ALL=C date "+%B %Y") |
2667 | 85 |
|
17554 | 86 |
if [ "$VERSION" = "-" ]; then |
87 |
DISTIDENT="Isabelle_$DATE" |
|
88 |
[ -z "$DISTNAME" ] && DISTNAME="$DISTIDENT" |
|
9797 | 89 |
DISTVERSION="$DISTNAME" |
90 |
EXPORT="cvs -f -q checkout -P -d $DISTNAME isabelle" |
|
17558 | 91 |
UNOFFICIAL=true |
2667 | 92 |
else |
17554 | 93 |
DISTIDENT="$VERSION" |
94 |
[ -z "$DISTNAME" ] && DISTNAME="$DISTIDENT" |
|
4982 | 95 |
DISTVERSION="$DISTNAME: $DISTDATE" |
17561 | 96 |
EXPORT="cvs -f -q export -r $VERSION -d $DISTNAME isabelle" |
2667 | 97 |
UNOFFICIAL="" |
98 |
fi |
|
99 |
||
9797 | 100 |
DISTBASE="$DISTPREFIX/dist-$DISTNAME" |
101 |
mkdir -p "$DISTBASE" || fail "Unable to create distribution base dir $DISTBASE!" |
|
102 |
[ -e "$DISTBASE/$DISTNAME" ] && fail "$DISTBASE/$DISTNAME already exists!" |
|
103 |
[ -e "$DISTBASE/pdf/$DISTNAME" ] && fail "$DISTBASE/pdf/$DISTNAME already exists!" |
|
2667 | 104 |
|
105 |
||
9797 | 106 |
# export repository |
2667 | 107 |
|
9797 | 108 |
echo "###" |
17554 | 109 |
echo "### Exporting $DISTIDENT ..." |
9797 | 110 |
echo "###" |
2667 | 111 |
|
9797 | 112 |
cd "$DISTBASE" |
2667 | 113 |
|
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
114 |
$EXPORT || fail "Export failed!" |
15438 | 115 |
|
116 |
if [ -n "$CVS2CL" ]; then |
|
117 |
cd $DISTNAME |
|
118 |
$CVS2CL |
|
119 |
gzip ChangeLog |
|
120 |
mv ChangeLog.gz .. |
|
121 |
cd .. |
|
122 |
fi |
|
123 |
||
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
124 |
$FIND . -name CVS -print | xargs rm -rf |
12986 | 125 |
$FIND . -name .cvsignore -print | xargs rm -rf |
17554 | 126 |
$FIND . "(" -name \*.thy -o -name \*.ML ")" -perm +111 -print | xargs chmod -x |
2667 | 127 |
|
128 |
||
9797 | 129 |
# build docs |
2667 | 130 |
|
9797 | 131 |
echo "###" |
132 |
echo "### Building docs ..." |
|
133 |
echo "###" |
|
134 |
||
135 |
cd "$DISTBASE/$DISTNAME/Doc" |
|
6630 | 136 |
PDFLATEX=$(type -path pdflatex) |
3169 | 137 |
|
138 |
for DOC in $(cat Contents) |
|
2667 | 139 |
do |
20990 | 140 |
pushd "$DOC" > /dev/null |
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
141 |
make dvi || fail "DVI document for $DOC failed!" |
17554 | 142 |
{ [ -n "$PDFLATEX" ] && make clean pdf; } || fail "PDF document for $DOC failed!" |
20990 | 143 |
popd |
2667 | 144 |
done |
145 |
||
9052 | 146 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
147 |
# prepare dist dir for release |
8059 | 148 |
|
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
149 |
echo "###" |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
150 |
echo "### Preparing distribution ..." |
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
151 |
echo "###" |
2667 | 152 |
|
17554 | 153 |
cd "$DISTBASE/$DISTNAME" || fail "No dist directory: $DISTBASE/$DISTNAME" |
2667 | 154 |
|
16301 | 155 |
cp -R Admin/website .. |
156 |
mkdir -p ../website/conf |
|
17942
68988fd2fd27
towards an improved website/makedist integration
haftmann
parents:
17910
diff
changeset
|
157 |
cat > ../website/conf/distinfo.mak <<EOF |
68988fd2fd27
towards an improved website/makedist integration
haftmann
parents:
17910
diff
changeset
|
158 |
# this is a generated file - do not edit unless you know what you are doing! |
16301 | 159 |
|
160 |
DISTNAME=$DISTNAME |
|
17554 | 161 |
DISTIDENT=$DISTIDENT |
17910 | 162 |
DISTBASE=$DISTBASE |
16301 | 163 |
EOF |
9920
9734f2717203
improved WWW page generation (still somewhat experimental);
wenzelm
parents:
9880
diff
changeset
|
164 |
|
16481 | 165 |
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 | 166 |
mv -f $MOVE Distribution/doc |
3305 | 167 |
rm Distribution/doc/Isa-logics.eps |
9052 | 168 |
rm -rf Doc Tools |
2667 | 169 |
|
7115 | 170 |
mkdir src contrib |
2667 | 171 |
mv $LOGICS src |
172 |
||
173 |
mv Distribution/* . |
|
174 |
rmdir Distribution |
|
175 |
||
13230
c5fad3c40d45
fail more gracefully, return proper exit codes, allow preset DISTPREFIX
kleing
parents:
13100
diff
changeset
|
176 |
( cd lib/browser; make; ) || fail "Graph browser build failed!" |
3638 | 177 |
|
5385 | 178 |
cp doc/isabelle*.eps lib/logo |
179 |
||
3638 | 180 |
|
2667 | 181 |
if [ -n "$UNOFFICIAL" ]; then |
182 |
{ |
|
183 |
echo |
|
184 |
echo "IMPORTANT NOTE" |
|
185 |
echo "==============" |
|
186 |
echo |
|
17554 | 187 |
echo "This is an unofficial release of Isabelle, created by $LOGNAME $DATE." |
2667 | 188 |
echo |
9925 | 189 |
} >ANNOUNCE |
2667 | 190 |
fi |
191 |
||
8810 | 192 |
perl -pi -e "s/{ISABELLE}/$DISTNAME/g;" lib/html/index.html |
17554 | 193 |
perl -pi -e "s/Isabelle repository version/$DISTVERSION/" src/Pure/ROOT.ML lib/Tools/version |
4986 | 194 |
perl -pi -e "s/the internal repository version of Isabelle/$DISTVERSION/" README.html |
3257 | 195 |
lynx -dump README.html >README |
196 |
||
9052 | 197 |
( cd src; ../Admin/maketags; ) |
10077 | 198 |
|
9052 | 199 |
rm -rf Admin |
16286 | 200 |
rm -f TODO |
9052 | 201 |
|
2667 | 202 |
|
203 |
# create archive |
|
204 |
||
9797 | 205 |
echo "###" |
206 |
echo "### Creating archives ..." |
|
207 |
echo "###" |
|
2667 | 208 |
|
9797 | 209 |
cd "$DISTBASE" |
210 |
||
10087 | 211 |
echo "$DISTBASE/$DISTNAME.tar.gz" > ../ISABELLE_DIST |
212 |
||
10068 | 213 |
rm -f Isabelle |
214 |
ln -s "$DISTNAME" Isabelle |
|
215 |
||
9797 | 216 |
chown -R "$LOGNAME" "$DISTNAME" |
217 |
chmod -R u+w "$DISTNAME" |
|
218 |
chmod -R g=o "$DISTNAME" |
|
10077 | 219 |
chgrp -R isabelle "$DISTNAME" Isabelle |
2667 | 220 |
|
9797 | 221 |
mkdir -p "pdf/$DISTNAME/doc" |
17655 | 222 |
mv "$DISTNAME/doc/"*.pdf "pdf/$DISTNAME/doc" |
223 |
||
224 |
sync; sleep 3 |
|
6748 | 225 |
|
10096 | 226 |
echo "$DISTNAME.tar.gz" |
10077 | 227 |
"$TAR" cf "$DISTNAME.tar" Isabelle "$DISTNAME" |
10096 | 228 |
gzip "$DISTNAME.tar" |
229 |
||
230 |
echo "${DISTNAME}_pdf.tar.gz" |
|
10112 | 231 |
( cd pdf; "$TAR" cf "../${DISTNAME}_pdf.tar" "$DISTNAME"; ) |
10096 | 232 |
gzip "${DISTNAME}_pdf.tar" |
6748 | 233 |
|
17655 | 234 |
mv "pdf/$DISTNAME/doc/"*.pdf "$DISTNAME/doc" |
9797 | 235 |
rmdir "pdf/$DISTNAME/doc" "pdf/$DISTNAME" pdf |
6750 | 236 |
|
6304 | 237 |
|
9782 | 238 |
# cleanup dist |
239 |
||
9797 | 240 |
mv "$DISTNAME" "${DISTNAME}-old" |
241 |
mkdir "$DISTNAME" |
|
9782 | 242 |
|
16328 | 243 |
mv "${DISTNAME}-old/README.html" "${DISTNAME}-old/INSTALL" "${DISTNAME}-old/NEWS" \ |
17554 | 244 |
"${DISTNAME}-old/ANNOUNCE" "${DISTNAME}-old/COPYRIGHT" "${DISTNAME}-old/CONTRIBUTORS" \ |
245 |
"$DISTNAME" |
|
9797 | 246 |
mkdir "$DISTNAME/doc" |
17655 | 247 |
mv "${DISTNAME}-old/doc/"*.pdf "${DISTNAME}-old/doc/Contents" "$DISTNAME/doc" |
9782 | 248 |
|
9867 | 249 |
chgrp -R isabelle "$DISTNAME" |
250 |
||
9797 | 251 |
rm -rf "${DISTNAME}-old" |
9782 | 252 |
|
253 |
||
2667 | 254 |
# final note |
255 |
||
9797 | 256 |
echo "###" |
10112 | 257 |
echo "### Finished makedist." |
9797 | 258 |
echo "###" |