/usr/share/sagemath/bin/sage-sdist is in sagemath-common 7.4-9.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 62 63 64 | #!/usr/bin/env bash
########################################################
# Build Sage source distribution
# This script should be called by the spkg/bin/sage script
########################################################
set -e
CMD="${0##*/}"
die () {
echo >&2 -e "$@"
exit 1
}
usage () {
echo "usage: $CMD [TMP_DIR]"
}
if [ $# -gt 1 ]; then
usage
die
fi
if [ -z "$SAGE_ROOT" ]; then
die "must be run from within a Sage enviroment, or with SAGE_ROOT provided"
fi
if [ -z "$SAGE_SRC" ]; then
die "must be run from within a Sage enviroment, or with SAGE_SRC provided"
fi
if [ "$#" -gt 0 ]; then
TMP_DIR="$1"
else
TMP_DIR="$SAGE_ROOT/tmp"
fi
source "$SAGE_SRC/bin/sage-version.sh"
echo "Sage version $SAGE_VERSION, release date $SAGE_RELEASE_DATE"
TARGET="sage-$SAGE_VERSION"
sage-clone-source "$SAGE_ROOT" "$TMP_DIR/$TARGET"
# Download and copy all upstream tarballs
cd "$SAGE_ROOT/build/make"
export SAGE_SPKG_COPY_UPSTREAM="$TMP_DIR/$TARGET/upstream"
$MAKE download-for-sdist
# Create source .tar.gz
cd "$TMP_DIR"
echo "Creating dist/$TARGET.tar.gz ..."
chmod -R go=rX "$TARGET"
tar zcf "$TARGET".tar.gz "$TARGET"
mkdir -p "$SAGE_ROOT"/dist
rm -rf "$SAGE_ROOT/dist/$TARGET"
echo "Moving final distribution file to $SAGE_ROOT/dist"
mv "$TARGET" "$SAGE_ROOT"/dist/
mv "$TARGET".* "$SAGE_ROOT"/dist/
|