forked from ppurka/sagelib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspkg-dist
executable file
·61 lines (45 loc) · 1.58 KB
/
spkg-dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
if [ $# -ne 2 ]; then
echo "Usage: $0 <SAGE_VERSION> <SAGE_ROOT>"
echo "Build SAGE source code package."
exit 0
fi
SAGE_VERSION=$1
SAGE_ROOT=$2
PATH=$SAGE_ROOT/local/bin/:$PATH
export PATH SAGE_VERSION SAGE_ROOT
if [ -e tmp ]; then
rm -rf tmp
fi
mkdir tmp
if [ ! -d dist ]; then
mkdir dist
fi
CUR=`pwd`
# Remove the doctest cache files.
rm -rf */.doctest */*/.doctest */*/*/.doctest */*/*/*/.doctest */*/*/*/*/.doctest */*/*/*/*/*/.doctest
rm -rf */.doctest* */*/.doctest* */*/*/.doctest* */*/*/*/.doctest* */*/*/*/*/.doctest* */*/*/*/*/*/.doctest*
cp -pr MANIFEST.in README* install doc sage sage-push pull setup.py module_list.py spkg-* .hg .hgtags .hgignore bundle export build.py clib.py sagebuild.py spkg-delauto c_lib debian tmp/
cd tmp/
rm -rf c_lib/*.so c_lib/*.os c_lib/*/*.os c_lib/*/*/*.os
if [ $? -ne 0 ]; then
echo "Error deleting c_lib temp files"
fi
# Remove the .cython_hash file, since including this in the bdist will
# completely break "sage -br".
# Also, do not distribute these build files (.os and .os);
# it wastes space and causes problems!
rm -f .cython_hash c_lib/*.so c_lib/*.os
# Delete all the autogenerated files, since they will get created again
# when SAGE is built or upgraded.
cd sage; "$CUR"/spkg-delauto .; cd ..
# Create the sdist using Python's distutils.
python setup.py sdist
# Recompress it in bz2 format, which is better.
cd dist
gunzip sage-$SAGE_VERSION.tar.gz
bzip2 -f sage-$SAGE_VERSION.tar
mv sage-$SAGE_VERSION.tar.bz2 ../../dist/sage-$SAGE_VERSION.spkg
# Delete the tmp directory.
cd ../..
rm -rf tmp