CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418346
1
#!/bin/sh -e
2
#
3
# This script generates a .tar.gz, .tar.bz2 and -win.zip for ANUPQ.
4
# This requires that a tag has been set of the form "v3.1". You then
5
# may invoke this script like this:
6
# ./make_dist.sh 3.1
7
# and the rest happens automatically.
8
# If a checkout of the website repository is present, this script
9
# also copies relevant files (PackageInfo.g, documentation) there.
10
#
11
# TODO: Right now this only works in a git clone of the repository;
12
# make it possible to also use this in a Mercurial clone, by
13
# using "hg export" instead of "git archive"
14
15
if [ $# -lt 1 ]; then
16
echo "Usage: $0 <version> [<tag-or-date>]"
17
exit 1
18
fi
19
20
PKG="anupq"
21
VER=$1
22
if [ $# -lt 2 ]; then
23
REF=v$VER # a 'tag' by default, but allow overriding it
24
else
25
REF=$2
26
fi
27
28
FULLPKG="$PKG-$VER"
29
30
SRC_DIR=$PWD
31
DEST_DIR=$PWD/..
32
#DEST_DIR=/tmp
33
WEB_DIR=$SRC_DIR/$PKG.gh-pages
34
35
# Clean any remains of previous export attempts
36
rm -rf $DEST_DIR/$FULLPKG*
37
38
echo "Exporting repository content for ref '$REF'"
39
if [ -d .git ] ; then
40
git archive --prefix=$FULLPKG/ $REF | tar xf - -C $DEST_DIR/
41
elif [ -d .hg ] ; then
42
hg archive -r $REF $DEST_DIR/$FULLPKG
43
else
44
echo "Error, only git and mercurial repositories are currently supported"
45
exit 1
46
fi
47
48
echo "Creating tarball $FULLPKG.tar"
49
cd $DEST_DIR/$FULLPKG
50
rm -f .git* .hg* .cvs*
51
52
# Build documentation and later remove aux files created by this.
53
echo "Building GAP package documentation"
54
cd $DEST_DIR/$FULLPKG/doc
55
./make_doc #> /dev/null 2> /dev/null
56
rm -f \
57
manual.example*.tst \
58
manual.aux \
59
manual.bbl \
60
manual.blg \
61
manual.idx \
62
manual.ilg \
63
manual.ind \
64
manual.log \
65
manual.mst \
66
manual.toc
67
68
echo "Building documentation for standalone binary"
69
cd $DEST_DIR/$FULLPKG/standalone-doc
70
for i in 1 2 3 ; do
71
latex guide.tex > /dev/null 2> /dev/null
72
done
73
for i in 1 2 3 ; do
74
pdflatex guide.tex > /dev/null 2> /dev/null
75
done
76
rm -f guide.aux guide.log guide.toc
77
78
cd $DEST_DIR
79
tar cf $FULLPKG.tar $FULLPKG
80
81
echo "Compressing (using gzip) tarball $FULLPKG.tar.gz"
82
gzip -9c $FULLPKG.tar > $FULLPKG.tar.gz
83
84
echo "Compressing (using bzip2) tarball $FULLPKG.tar.gz"
85
bzip2 -9c $FULLPKG.tar > $FULLPKG.tar.bz2
86
87
# TODO: The name "-win.zip" may carries additional meaning, such as text
88
# files converted to windows line endings; or it might be expected to
89
# contained pre-compiled binaries.
90
# However, GAP insists on the suffix "-win.zip", so we keep using that for now
91
# (instead of plain .zip).
92
echo "Zipping $FULLPKG-win.zip..."
93
zip -r9 --quiet $FULLPKG-win.zip $FULLPKG
94
95
96
# Update website repository if available
97
if [ -d $WEB_DIR ] ; then
98
echo "Updating website"
99
cd $WEB_DIR
100
cp $DEST_DIR/$FULLPKG/README .
101
cp $DEST_DIR/$FULLPKG/PackageInfo.g .
102
rm -rf doc/
103
mkdir -p doc/
104
cp $DEST_DIR/$FULLPKG/htm/*.htm doc/
105
cp $DEST_DIR/$FULLPKG/doc/manual.pdf doc/
106
cp $DEST_DIR/$FULLPKG/doc/manual.dvi doc/
107
cp $DEST_DIR/$FULLPKG/standalone-doc/guide.pdf doc/
108
cp $DEST_DIR/$FULLPKG/standalone-doc/guide.dvi doc/
109
fi
110
111
echo "Done:"
112
cd $DEST_DIR
113
ls -l $FULLPKG.tar.gz $FULLPKG.tar.bz2 $FULLPKG-win.zip
114
115
exit 0
116
117