aboutsummaryrefslogtreecommitdiff
path: root/academic/sage
diff options
context:
space:
mode:
Diffstat (limited to 'academic/sage')
-rw-r--r--academic/sage/README15
-rw-r--r--academic/sage/README.BUILDOPTS60
-rw-r--r--academic/sage/doinst.sh21
-rw-r--r--academic/sage/profile.d/sage.csh5
-rw-r--r--academic/sage/profile.d/sage.sh5
-rw-r--r--academic/sage/sage-notebook.desktop19
-rw-r--r--academic/sage/sage.SlackBuild112
-rw-r--r--academic/sage/sage.info10
-rw-r--r--academic/sage/slack-desc19
9 files changed, 266 insertions, 0 deletions
diff --git a/academic/sage/README b/academic/sage/README
new file mode 100644
index 0000000000000..2a59ca5dd6c3b
--- /dev/null
+++ b/academic/sage/README
@@ -0,0 +1,15 @@
+Sage is a free open-source mathematics software system licensed under
+the GPL. It combines the power of many existing open-source packages
+into a common Python-based interface.
+Mission: Creating a viable free open source alternative to Magma,
+
+Sage can be used in several ways: through an interactive command line,
+by writing stand-alone scripts, through the graphical notebook
+interface in a browser, or through the KDE Cantor application (part
+of a full Slackware installation).
+
+Building sage requires >5GB of disk space, so you may need to
+redefine $TMP and/or $OUTPUT.
+
+See README.BUILDOPTS for additional (important) information about
+build options and such.
diff --git a/academic/sage/README.BUILDOPTS b/academic/sage/README.BUILDOPTS
new file mode 100644
index 0000000000000..3bcf17762bde9
--- /dev/null
+++ b/academic/sage/README.BUILDOPTS
@@ -0,0 +1,60 @@
+Sage uses specific versions of a number of software components (i.e.
+R, gap, gp, ipython, maxima, mwrank, hg, python, singular, etc.). Each
+of thes components will be compiled during the build process and
+installed to a local tree (/opt/sage). The sage directory will be
+placed in /opt, however it should be portable enough to be moved to any
+location.
+
+SlackBuild Options:
+
+SAGEROOT=/install/path [Default:/opt/sage]
+By default, sage will be installed to /opt/sage. However, the sage
+folder is portable and can be installed to any location of your
+choosing. The final destination for SAGE_ROOT can be specified
+by passing a value for SAGEROOT to the slackbuild. The final install
+will be >2GB, so you may need to point SAGEROOT to a different
+partition if your /opt partition is not large enough. The sage tree
+can also be moved after installation, however you will need to update
+the sage.* scripts in /etc/profile.d to point to the new SAGE_ROOT.
+Example: to install sage to your home directory do the following
+SAGEROOT=/home/user/opt/sage ./sage.SlackBuild
+
+TEST={yes|no} [Default:no]
+All examples in the documentation (over 93,000 lines of input) can be
+tested after Sage has been built with the following (Note: it is not
+uncommon for this to produce 2 or 3 errors)
+TEST=yes ./sage.SlackBuild
+
+INSTALLSCRIPTS={yes|no} [Default:no]
+Sage's local versions of R, gap, gp, ipython, maxima, mwrank, hg, and
+singular can be used independently of Sage by placing scripts for each
+in the PATH. This can be enabled with the following (Note: the scripts
+will be installed to the location SAGEROOT/bin)
+INSTALLSCRIPTS=yes ./sage.SlackBuild
+
+PDFDOC={yes|no} [Default:no]
+By default, only the html version of the documentation will be built.
+The pdf version can be built with the following (Note: this requires
+LaTeX to be installed):
+PDFDOC=yes ./sage.Slackbuild
+
+OPTIONALSPKG={package1|"package1 package2 ..."|no} [Default:no]
+There are a number of optional .spkg files (packages) that can be
+be installed after sage has been built. These packages are downloaded
+from a sage server before they are installed, therefore you will need a
+network connection for this to work. A list of the available optional
+packages and a description of each can be found at
+http://www.sagemath.org/packages/optional
+These packages can be installed with the following (Note: it is not
+necessary to give the full version number of the package you are
+installing, simply giving the base name is sufficient):
+OPTIONALSPKG="package1 package2 package3 ..." ./sage.SlackBuild
+
+The upstream developers "highly recommend" the database_gap package,
+which would be installed with
+OPTIONALSPKG="database_gap" ./sage.SlackBuild
+
+To install multiple packages, i.e. the database_gap package and the
+sage-mod package do the following:
+OPTIONALSPKG="database_gap sage-mod" ./sage.SlackBuild
+
diff --git a/academic/sage/doinst.sh b/academic/sage/doinst.sh
new file mode 100644
index 0000000000000..4f7e8e2e8fee0
--- /dev/null
+++ b/academic/sage/doinst.sh
@@ -0,0 +1,21 @@
+# update texmf to recognize the newly installed sagetex
+if [ -x usr/share/texmf/bin/texhash ]; then
+ /usr/share/texmf/bin/texhash /usr/share/texmf >/dev/null 2>&1
+fi
+
+# run sage at least once as root after moving it to a new location
+echo "exit" | SAGEROOT/sage
+
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
+
+if [ -x /usr/bin/update-mime-database ]; then
+ /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
+fi
+
+if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
+ if [ -x /usr/bin/gtk-update-icon-cache ]; then
+ /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/academic/sage/profile.d/sage.csh b/academic/sage/profile.d/sage.csh
new file mode 100644
index 0000000000000..ea47f7cbd5808
--- /dev/null
+++ b/academic/sage/profile.d/sage.csh
@@ -0,0 +1,5 @@
+#!/bin/csh
+# Add SAGE_ROOT path and MANPATH for Sage:
+setenv SAGE_ROOT SAGEROOT
+set path = ( $path ${SAGE_ROOT} )
+setenv MANPATH ${MANPATH}:${SAGE_ROOT}/local/man:${SAGE_ROOT}/local/share/man
diff --git a/academic/sage/profile.d/sage.sh b/academic/sage/profile.d/sage.sh
new file mode 100644
index 0000000000000..4d4de1552f17e
--- /dev/null
+++ b/academic/sage/profile.d/sage.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Add SAGE_ROOT PATH and MANPATH for Sage:
+SAGE_ROOT=SAGEROOT
+PATH="$PATH:${SAGE_ROOT}"
+MANPATH="$MANPATH:${SAGE_ROOT}/local/man:${SAGE_ROOT}/local/share/man"
diff --git a/academic/sage/sage-notebook.desktop b/academic/sage/sage-notebook.desktop
new file mode 100644
index 0000000000000..595aacc4fe2cf
--- /dev/null
+++ b/academic/sage/sage-notebook.desktop
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Version=1.0
+Name=SAGE
+Comment=SAGE NOTEBOOK
+Comment[en_US]=SAGE NOTEBOOK
+Exec=sage -notebook
+GenericName=
+GenericName[de]=
+Icon=sageicon
+MimeType=
+Name[de]=SAGE
+StartupNotify=true
+Terminal=true
+Type=Application
+Categories=Education;Science;Math;
+X-DCOP-ServiceType=
+X-KDE-SubstituteUID=false
+X-KDE-Username=
+GenericName[en_US]=
diff --git a/academic/sage/sage.SlackBuild b/academic/sage/sage.SlackBuild
new file mode 100644
index 0000000000000..b65bfa9bb4086
--- /dev/null
+++ b/academic/sage/sage.SlackBuild
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+# Slackware build script for sage
+# Written by Jack Maddox <jack@auburn.edu>
+
+PRGNAM=sage
+VERSION=${VERSION:-4.7}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+SAGEROOT=${SAGEROOT:-/opt/sage}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar
+cd $PRGNAM-$VERSION
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+mkdir -p $PKG/$SAGEROOT $PKG/usr/share/{applications,pixmaps} \
+ $PKG/usr/doc/$PRGNAM-$VERSION $PKG/etc/profile.d
+make
+
+# test all examples in the documentation (over 93,000 line of input)
+[ "${TEST:-no}" = "yes" ] && make test
+
+# build the pdf version of the documentation
+# (Note: this requires a LaTeX installation)
+if [ "${PDFDOC:-no}" = "yes" ]; then
+ ./sage -docbuild all pdf
+ cp -av devel/sage/doc/output/pdf $PKG/usr/doc/$PRGNAM-$VERSION
+fi
+
+# install optional packages as defined by the OPTIONALSPKG flag
+OPTIONALSPKG=${OPTIONALSPKG:-no}
+if [ "$OPTIONALSPKG" != "no" ]; then
+ for i in ${OPTIONALSPKG}; do
+ ./sage -i $(./sage -optional | grep ${i})
+ done
+fi
+
+cp -av * $PKG/$SAGEROOT
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+# Sage installs specific versions of a number of software components which
+# may be different from the system-wide versions of those components. For
+# this reason, the man and info pages are not moved to /usr/man and
+# /usr/info. To avoid possible conflicts, they are compressed in place.
+find $PKG/$SAGEROOT/local/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/$SAGEROOT/local/man -type l ) ; do
+ ln -s $( readlink $i ).gz $i.gz ; rm $i
+done
+find $PKG/$SAGEROOT/local/share/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/$SAGEROOT/local/share/man -type l ) ; do
+ ln -s $( readlink $i ).gz $i.gz ; rm $i
+done
+gzip -9 $PKG/$SAGEROOT/local/share/info/*.info*
+
+# Add profile scripts
+sed "s%SAGEROOT%${SAGEROOT}%" $CWD/profile.d/sage.sh > $PKG/etc/profile.d/sage.sh
+sed "s%SAGEROOT%${SAGEROOT}%" $CWD/profile.d/sage.csh > $PKG/etc/profile.d/sage.csh
+chmod 0755 $PKG/etc/profile.d/*
+
+# install scripts to SAGEROOT/bin that allow the internal sage versions of: gap,
+# gp, singular, maxima, M2, kash, mwrank, ipython, hg, and R to be run independently
+# and add SAGEROOT/bin to the PATH
+if [ "${INSTALLSCRIPTS:-no}" = "yes" ]; then
+ mkdir $PKG$SAGEROOT/bin
+ echo "install_scripts('$PKG$SAGEROOT/bin')" | ./sage
+ sed -i 's%$PATH:${SAGE_ROOT}%$PATH:${SAGE_ROOT}:${SAGE_ROOT}/bin%' $PKG/etc/profile.d/sage.sh
+ sed -i 's%$path ${SAGE_ROOT}%$path ${SAGE_ROOT} ${SAGE_ROOT}/bin%' $PKG/etc/profile.d/sage.csh
+fi
+
+cat $CWD/$PRGNAM-notebook.desktop > $PKG/usr/share/applications/$PRGNAM-notebook.desktop
+cp data/extcode/notebook/images/sageicon.png $PKG/usr/share/pixmaps/
+
+# install sagetex to a location that is accessible to the system TeX installation
+cp -a local/share/texmf $PKG/usr/share
+
+cp -a COPYING.txt README.txt $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+sed "s%SAGEROOT%${SAGEROOT}%" $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+chown -R root:root . # some ownership is not correct; this is an easy fix
+/sbin/makepkg -p -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/academic/sage/sage.info b/academic/sage/sage.info
new file mode 100644
index 0000000000000..96080e0d77c0a
--- /dev/null
+++ b/academic/sage/sage.info
@@ -0,0 +1,10 @@
+PRGNAM="sage"
+VERSION="4.7"
+HOMEPAGE="http://www.sagemath.org"
+DOWNLOAD="http://sage.math.washington.edu/home/release/sage-4.7/sage-4.7.tar"
+MD5SUM="db4d891feed487e1696b8d01ae3b6469"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+MAINTAINER="Jack Maddox"
+EMAIL="jack@auburn.edu"
+APPROVED="rworkman"
diff --git a/academic/sage/slack-desc b/academic/sage/slack-desc
new file mode 100644
index 0000000000000..1f70c7c975d3a
--- /dev/null
+++ b/academic/sage/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+sage: sage (python based mathematics software)
+sage:
+sage: Sage is a free open-source mathematics software system licensed under
+sage: the GPL. It combines the power of many existing open-source packages
+sage: into a common Python-based interface.
+sage: Mission: Creating a viable free open source alternative to Magma,
+sage: Maple, Mathematica and Matlab.
+sage:
+sage: Home: http://www.sagemath.org
+sage:
+sage: